From 4834be9fe5aaff5e8524c291260cfb8e35ee577a Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Wed, 13 Jun 2018 14:55:40 -0500 Subject: [PATCH] run indent --- examples/doxygen/theta_timestepping.cc | 6 +- examples/step-10/step-10.cc | 8 +- examples/step-11/step-11.cc | 32 +- examples/step-12/step-12.cc | 25 +- examples/step-13/step-13.cc | 114 +-- examples/step-14/step-14.cc | 325 ++++---- examples/step-15/step-15.cc | 43 +- examples/step-16/step-16.cc | 30 +- examples/step-17/step-17.cc | 41 +- examples/step-18/step-18.cc | 65 +- examples/step-20/step-20.cc | 70 +- examples/step-21/step-21.cc | 85 +- examples/step-22/step-22.cc | 49 +- examples/step-23/step-23.cc | 70 +- examples/step-24/step-24.cc | 38 +- examples/step-25/step-25.cc | 31 +- examples/step-26/step-26.cc | 65 +- examples/step-27/step-27.cc | 36 +- examples/step-28/step-28.cc | 113 +-- examples/step-29/step-29.cc | 43 +- examples/step-3/step-3.cc | 21 +- examples/step-30/step-30.cc | 111 ++- examples/step-31/step-31.cc | 131 +-- examples/step-32/step-32.cc | 489 ++++++------ examples/step-33/step-33.cc | 157 ++-- examples/step-34/step-34.cc | 52 +- examples/step-35/step-35.cc | 232 +++--- examples/step-36/step-36.cc | 22 +- examples/step-37/step-37.cc | 54 +- examples/step-38/step-38.cc | 29 +- examples/step-39/step-39.cc | 22 +- examples/step-4/step-4.cc | 27 +- examples/step-40/step-40.cc | 44 +- examples/step-41/step-41.cc | 41 +- examples/step-42/step-42.cc | 170 ++-- examples/step-43/step-43.cc | 207 ++--- examples/step-44/step-44.cc | 263 +++--- examples/step-45/step-45.cc | 64 +- examples/step-46/step-46.cc | 126 +-- examples/step-48/step-48.cc | 62 +- examples/step-49/step-49.cc | 24 +- examples/step-5/step-5.cc | 21 +- examples/step-50/step-50.cc | 49 +- examples/step-51/step-51.cc | 250 +++--- examples/step-52/step-52.cc | 99 ++- examples/step-53/step-53.cc | 25 +- examples/step-54/step-54.cc | 15 +- examples/step-55/step-55.cc | 87 +- examples/step-56/step-56.cc | 77 +- examples/step-57/step-57.cc | 69 +- examples/step-59/step-59.cc | 45 +- examples/step-6/step-6.cc | 16 +- examples/step-60/step-60.cc | 68 +- examples/step-7/step-7.cc | 64 +- examples/step-8/step-8.cc | 29 +- examples/step-9/step-9.cc | 99 +-- include/deal.II/algorithms/newton.templates.h | 16 +- .../deal.II/algorithms/operator.templates.h | 6 +- .../algorithms/theta_timestepping.templates.h | 10 +- include/deal.II/base/aligned_vector.h | 92 ++- include/deal.II/base/array_view.h | 32 +- include/deal.II/base/exceptions.h | 108 +-- include/deal.II/base/function.templates.h | 85 +- .../deal.II/base/function_time.templates.h | 4 +- include/deal.II/base/geometry_info.h | 109 +-- include/deal.II/base/graph_coloring.h | 6 +- include/deal.II/base/index_set.h | 144 ++-- include/deal.II/base/iterator_range.h | 14 +- include/deal.II/base/linear_index_iterator.h | 4 +- include/deal.II/base/mg_level_object.h | 4 +- include/deal.II/base/mpi.h | 18 +- include/deal.II/base/mpi.templates.h | 58 +- include/deal.II/base/parallel.h | 60 +- include/deal.II/base/parameter_acceptor.h | 6 +- include/deal.II/base/parameter_handler.h | 3 +- include/deal.II/base/partitioner.templates.h | 39 +- include/deal.II/base/patterns.h | 12 +- include/deal.II/base/point.h | 40 +- include/deal.II/base/polynomial.h | 6 +- include/deal.II/base/polynomial_space.h | 10 +- include/deal.II/base/qprojector.h | 8 +- include/deal.II/base/quadrature_point_data.h | 25 +- include/deal.II/base/smartpointer.h | 24 +- include/deal.II/base/symmetric_tensor.h | 33 +- include/deal.II/base/synchronous_iterator.h | 5 +- include/deal.II/base/table.h | 136 ++-- include/deal.II/base/table_handler.h | 15 +- include/deal.II/base/tensor.h | 44 +- include/deal.II/base/tensor_accessors.h | 47 +- .../deal.II/base/tensor_function.templates.h | 17 +- .../deal.II/base/tensor_product_polynomials.h | 10 +- .../base/tensor_product_polynomials_bubbles.h | 4 +- .../base/tensor_product_polynomials_const.h | 4 +- include/deal.II/base/thread_local_storage.h | 7 +- include/deal.II/base/thread_management.h | 44 +- include/deal.II/base/time_stepping.h | 11 +- .../deal.II/base/time_stepping.templates.h | 30 +- include/deal.II/base/timer.h | 8 +- include/deal.II/base/utilities.h | 6 +- include/deal.II/base/vector_slice.h | 16 +- include/deal.II/base/vectorization.h | 12 +- include/deal.II/base/work_stream.h | 95 +-- .../differentiation/ad/ad_number_traits.h | 7 +- .../differentiation/ad/adolc_number_types.h | 18 +- include/deal.II/distributed/tria.h | 8 +- include/deal.II/dofs/dof_accessor.templates.h | 356 +++++---- include/deal.II/dofs/dof_handler.h | 28 +- include/deal.II/dofs/dof_renumbering.h | 6 +- include/deal.II/fe/block_mask.h | 9 +- include/deal.II/fe/component_mask.h | 8 +- include/deal.II/fe/fe_dg_vector.templates.h | 20 +- include/deal.II/fe/fe_poly.templates.h | 66 +- include/deal.II/fe/fe_poly_face.h | 10 +- include/deal.II/fe/fe_poly_face.templates.h | 12 +- include/deal.II/fe/fe_series.h | 8 +- include/deal.II/fe/fe_system.h | 23 +- include/deal.II/fe/fe_tools.templates.h | 93 ++- .../fe/fe_tools_extrapolate.templates.h | 51 +- .../fe/fe_tools_interpolate.templates.h | 27 +- include/deal.II/fe/fe_values.h | 7 +- include/deal.II/fe/fe_values_extractors.h | 30 +- include/deal.II/fe/mapping_q_generic.h | 20 +- include/deal.II/grid/composition_manifold.h | 11 +- include/deal.II/grid/filtered_iterator.h | 62 +- include/deal.II/grid/grid_tools.h | 38 +- .../deal.II/grid/tensor_product_manifold.h | 29 +- .../deal.II/grid/tria_accessor.templates.h | 183 +++-- include/deal.II/grid/tria_iterator.h | 44 +- .../deal.II/grid/tria_iterator.templates.h | 60 +- include/deal.II/grid/tria_objects.h | 19 +- include/deal.II/hp/dof_faces.h | 76 +- include/deal.II/hp/dof_handler.h | 14 +- include/deal.II/hp/dof_level.h | 10 +- include/deal.II/lac/affine_constraints.h | 31 +- .../lac/affine_constraints.templates.h | 160 ++-- include/deal.II/lac/arpack_solver.h | 26 +- include/deal.II/lac/block_indices.h | 22 +- include/deal.II/lac/block_linear_operator.h | 6 +- include/deal.II/lac/block_matrix_array.h | 16 +- include/deal.II/lac/block_matrix_base.h | 24 +- .../lac/block_sparse_matrix_ez.templates.h | 16 +- include/deal.II/lac/block_sparsity_pattern.h | 5 +- include/deal.II/lac/block_vector.templates.h | 4 +- include/deal.II/lac/block_vector_base.h | 51 +- include/deal.II/lac/chunk_sparse_matrix.h | 50 +- .../lac/chunk_sparse_matrix.templates.h | 102 +-- include/deal.II/lac/chunk_sparsity_pattern.h | 34 +- include/deal.II/lac/cuda_atomic.h | 8 +- .../deal.II/lac/dynamic_sparsity_pattern.h | 57 +- include/deal.II/lac/eigen.h | 28 +- include/deal.II/lac/filtered_matrix.h | 33 +- include/deal.II/lac/full_matrix.h | 12 +- include/deal.II/lac/full_matrix.templates.h | 15 +- include/deal.II/lac/identity_matrix.h | 6 +- .../lac/la_parallel_block_vector.templates.h | 14 +- .../lac/la_parallel_vector.templates.h | 181 +++-- include/deal.II/lac/la_vector.h | 7 +- include/deal.II/lac/la_vector.templates.h | 126 +-- include/deal.II/lac/lapack_full_matrix.h | 8 +- include/deal.II/lac/linear_operator.h | 6 +- include/deal.II/lac/matrix_block.h | 32 +- include/deal.II/lac/matrix_iterator.h | 8 +- include/deal.II/lac/packaged_operation.h | 12 +- include/deal.II/lac/parpack_solver.h | 62 +- include/deal.II/lac/petsc_matrix_base.h | 12 +- .../deal.II/lac/petsc_parallel_block_vector.h | 15 +- include/deal.II/lac/petsc_parallel_vector.h | 4 +- include/deal.II/lac/petsc_vector_base.h | 11 +- include/deal.II/lac/pointer_matrix.h | 41 +- include/deal.II/lac/precondition.h | 87 +- include/deal.II/lac/precondition_block.h | 12 +- .../lac/precondition_block.templates.h | 43 +- include/deal.II/lac/precondition_block_base.h | 12 +- include/deal.II/lac/precondition_selector.h | 6 +- include/deal.II/lac/read_write_vector.h | 30 +- .../deal.II/lac/read_write_vector.templates.h | 31 +- .../deal.II/lac/relaxation_block.templates.h | 14 +- include/deal.II/lac/slepc_solver.h | 30 +- include/deal.II/lac/solver.h | 18 +- include/deal.II/lac/solver_bicgstab.h | 42 +- include/deal.II/lac/solver_cg.h | 18 +- include/deal.II/lac/solver_control.h | 6 +- include/deal.II/lac/solver_fire.h | 20 +- include/deal.II/lac/solver_gmres.h | 60 +- include/deal.II/lac/solver_minres.h | 12 +- include/deal.II/lac/solver_qmrs.h | 32 +- include/deal.II/lac/solver_relaxation.h | 4 +- include/deal.II/lac/solver_richardson.h | 18 +- include/deal.II/lac/sparse_decomposition.h | 10 +- .../lac/sparse_decomposition.templates.h | 21 +- include/deal.II/lac/sparse_matrix.h | 51 +- include/deal.II/lac/sparse_matrix.templates.h | 103 +-- include/deal.II/lac/sparse_matrix_ez.h | 30 +- .../deal.II/lac/sparse_matrix_ez.templates.h | 30 +- include/deal.II/lac/sparse_mic.templates.h | 5 +- include/deal.II/lac/sparse_vanka.templates.h | 67 +- include/deal.II/lac/sparsity_pattern.h | 25 +- .../deal.II/lac/swappable_vector.templates.h | 11 +- include/deal.II/lac/tensor_product_matrix.h | 32 +- .../lac/trilinos_parallel_block_vector.h | 10 +- include/deal.II/lac/trilinos_precondition.h | 44 +- include/deal.II/lac/trilinos_sparse_matrix.h | 110 +-- .../deal.II/lac/trilinos_sparsity_pattern.h | 12 +- include/deal.II/lac/trilinos_vector.h | 16 +- include/deal.II/lac/utilities.h | 8 +- include/deal.II/lac/vector.h | 24 +- include/deal.II/lac/vector.templates.h | 152 ++-- include/deal.II/lac/vector_memory.h | 9 +- include/deal.II/lac/vector_memory.templates.h | 10 +- .../deal.II/lac/vector_operations_internal.h | 200 ++--- .../deal.II/matrix_free/cuda_fe_evaluation.h | 10 +- .../deal.II/matrix_free/cuda_matrix_free.h | 10 +- .../matrix_free/cuda_matrix_free.templates.h | 74 +- .../matrix_free/cuda_tensor_product_kernels.h | 10 +- .../deal.II/matrix_free/dof_info.templates.h | 26 +- .../deal.II/matrix_free/evaluation_kernels.h | 215 ++--- .../deal.II/matrix_free/face_setup_internal.h | 20 +- include/deal.II/matrix_free/fe_evaluation.h | 621 ++++++++------- .../matrix_free/mapping_data_on_the_fly.h | 20 +- .../matrix_free/mapping_info.templates.h | 53 +- include/deal.II/matrix_free/matrix_free.h | 102 +-- .../matrix_free/matrix_free.templates.h | 104 +-- include/deal.II/matrix_free/operators.h | 59 +- include/deal.II/matrix_free/shape_info.h | 23 +- .../matrix_free/shape_info.templates.h | 26 +- .../matrix_free/tensor_product_kernels.h | 140 ++-- include/deal.II/meshworker/assembler.h | 29 +- include/deal.II/meshworker/dof_info.h | 28 +- .../deal.II/meshworker/dof_info.templates.h | 10 +- include/deal.II/meshworker/functional.h | 3 +- include/deal.II/meshworker/integration_info.h | 50 +- include/deal.II/meshworker/loop.h | 20 +- include/deal.II/meshworker/output.h | 8 +- include/deal.II/meshworker/simple.h | 51 +- .../meshworker/vector_selector.templates.h | 44 +- include/deal.II/multigrid/mg_block_smoother.h | 16 +- include/deal.II/multigrid/mg_coarse.h | 43 +- .../deal.II/multigrid/mg_constrained_dofs.h | 17 +- include/deal.II/multigrid/mg_matrix.h | 13 +- include/deal.II/multigrid/mg_smoother.h | 24 +- .../deal.II/multigrid/mg_transfer.templates.h | 10 +- .../mg_transfer_component.templates.h | 15 +- .../multigrid/mg_transfer_matrix_free.h | 25 +- include/deal.II/multigrid/multigrid.h | 80 +- .../multigrid/sparse_matrix_collection.h | 5 +- .../numerics/data_out_dof_data.templates.h | 98 +-- include/deal.II/numerics/data_postprocessor.h | 10 +- .../numerics/dof_output_operator.templates.h | 6 +- .../deal.II/numerics/dof_print_solver_step.h | 8 +- .../numerics/error_estimator.templates.h | 139 ++-- .../numerics/fe_field_function.templates.h | 22 +- include/deal.II/numerics/kdtree.h | 4 +- .../numerics/matrix_creator.templates.h | 259 +++--- include/deal.II/numerics/solution_transfer.h | 24 +- .../deal.II/numerics/vector_tools.templates.h | 451 ++++++----- .../deal.II/optimization/rol/vector_adaptor.h | 4 +- include/deal.II/physics/notation.h | 80 +- include/deal.II/sundials/arkode.h | 26 +- include/deal.II/sundials/ida.h | 32 +- include/deal.II/sundials/kinsol.h | 32 +- source/algorithms/timestep_control.cc | 29 +- source/base/auto_derivative_function.cc | 10 +- source/base/bounding_box.cc | 10 +- source/base/conditional_ostream.cc | 7 +- source/base/convergence_table.cc | 13 +- source/base/data_out_base.cc | 524 ++++++------ source/base/event.cc | 4 +- source/base/exceptions.cc | 43 +- source/base/flow_function.cc | 36 +- source/base/function_cspline.cc | 32 +- source/base/function_derivative.cc | 20 +- source/base/function_lib.cc | 120 +-- source/base/function_lib_cutoff.cc | 22 +- source/base/function_parser.cc | 8 +- source/base/function_spherical.cc | 6 +- source/base/index_set.cc | 28 +- source/base/logstream.cc | 30 +- source/base/mpi.cc | 11 +- source/base/mpi.inst.in | 40 +- source/base/multithread_info.cc | 8 +- source/base/parallel.cc | 14 +- source/base/parameter_acceptor.cc | 11 +- source/base/parameter_handler.cc | 137 ++-- source/base/parsed_function.cc | 22 +- source/base/partitioner.cc | 101 +-- source/base/partitioner.inst.in | 44 +- source/base/path_search.cc | 10 +- source/base/patterns.cc | 156 ++-- source/base/polynomial.cc | 51 +- source/base/polynomials_abf.cc | 8 +- source/base/polynomials_adini.cc | 14 +- source/base/polynomials_bdm.cc | 14 +- source/base/polynomials_bernstein.cc | 6 +- .../polynomials_integrated_legendre_sz.cc | 4 +- source/base/polynomials_nedelec.cc | 8 +- source/base/polynomials_p.cc | 18 +- source/base/polynomials_piecewise.cc | 10 +- source/base/polynomials_raviart_thomas.cc | 8 +- source/base/polynomials_rt_bubbles.cc | 30 +- source/base/process_grid.cc | 44 +- source/base/quadrature.cc | 144 ++-- source/base/quadrature_lib.cc | 159 ++-- source/base/quadrature_selector.cc | 6 +- source/base/subscriptor.cc | 21 +- source/base/table_handler.cc | 43 +- source/base/tensor_product_polynomials.cc | 29 +- .../tensor_product_polynomials_bubbles.cc | 10 +- .../base/tensor_product_polynomials_const.cc | 10 +- source/base/thread_management.cc | 4 +- source/base/timer.cc | 92 ++- source/base/utilities.cc | 12 +- source/distributed/grid_refinement.cc | 10 +- source/distributed/p4est_wrappers.cc | 10 +- source/distributed/shared_tria.cc | 45 +- source/distributed/solution_transfer.cc | 6 +- source/distributed/tria.cc | 148 ++-- source/distributed/tria_base.cc | 18 +- source/dofs/dof_accessor.cc | 6 +- source/dofs/dof_accessor_get.cc | 27 +- source/dofs/dof_accessor_get.inst.in | 12 +- source/dofs/dof_accessor_set.cc | 27 +- source/dofs/dof_accessor_set.inst.in | 12 +- source/dofs/dof_handler.cc | 87 +- source/dofs/dof_handler_policy.cc | 260 +++--- source/dofs/dof_renumbering.cc | 126 +-- source/dofs/dof_tools.cc | 134 ++-- source/dofs/dof_tools.inst.in | 77 +- source/dofs/dof_tools_constraints.cc | 93 ++- source/dofs/dof_tools_sparsity.cc | 127 ++- source/dofs/dof_tools_sparsity.inst.in | 11 +- source/dofs/number_cache.cc | 20 +- source/fe/fe.cc | 132 +-- source/fe/fe_abf.cc | 50 +- source/fe/fe_bdm.cc | 35 +- source/fe/fe_bernstein.cc | 33 +- source/fe/fe_data.cc | 57 +- source/fe/fe_dg_vector.cc | 16 +- source/fe/fe_dgp.cc | 28 +- source/fe/fe_dgp_monomial.cc | 42 +- source/fe/fe_dgp_nonparametric.cc | 26 +- source/fe/fe_dgq.cc | 160 ++-- source/fe/fe_enriched.cc | 154 ++-- source/fe/fe_face.cc | 103 +-- source/fe/fe_nedelec.cc | 411 ++++++---- source/fe/fe_nedelec_sz.cc | 92 ++- source/fe/fe_nothing.cc | 18 +- source/fe/fe_p1nc.cc | 15 +- source/fe/fe_poly.cc | 64 +- source/fe/fe_poly_tensor.cc | 362 +++++---- source/fe/fe_q.cc | 37 +- source/fe/fe_q_base.cc | 141 ++-- source/fe/fe_q_bubbles.cc | 118 +-- source/fe/fe_q_dg0.cc | 56 +- source/fe/fe_q_hierarchical.cc | 197 ++--- source/fe/fe_q_iso_q1.cc | 28 +- source/fe/fe_rannacher_turek.cc | 22 +- source/fe/fe_raviart_thomas.cc | 50 +- source/fe/fe_raviart_thomas_nodal.cc | 55 +- source/fe/fe_rt_bubbles.cc | 42 +- source/fe/fe_series.cc | 26 +- source/fe/fe_system.cc | 306 +++---- source/fe/fe_trace.cc | 42 +- source/fe/fe_values.cc | 284 ++++--- source/fe/fe_values.decl.1.inst.in | 5 +- source/fe/fe_values.decl.2.inst.in | 5 +- source/fe/fe_values.inst.in | 15 +- source/fe/mapping.cc | 4 +- source/fe/mapping_c1.cc | 7 +- source/fe/mapping_cartesian.cc | 34 +- source/fe/mapping_fe_field.cc | 119 +-- source/fe/mapping_manifold.cc | 98 +-- source/fe/mapping_q.cc | 21 +- source/fe/mapping_q1.cc | 3 +- source/fe/mapping_q1_eulerian.cc | 8 +- source/fe/mapping_q_eulerian.cc | 33 +- source/fe/mapping_q_generic.cc | 162 ++-- source/gmsh/utilities.cc | 18 +- source/grid/cell_id.cc | 23 +- source/grid/grid_generator.cc | 262 +++--- source/grid/grid_in.cc | 166 ++-- source/grid/grid_out.cc | 211 ++--- source/grid/grid_refinement.cc | 11 +- source/grid/grid_refinement.inst.in | 17 +- source/grid/grid_reordering.cc | 41 +- source/grid/grid_tools.cc | 217 ++--- source/grid/grid_tools_cache.cc | 8 +- source/grid/grid_tools_dof_handlers.cc | 31 +- source/grid/intergrid_map.cc | 6 +- source/grid/manifold.cc | 83 +- source/grid/manifold_lib.cc | 182 +++-- source/grid/persistent_tria.cc | 20 +- source/grid/tria.cc | 456 ++++++----- source/grid/tria_accessor.cc | 38 +- source/grid/tria_levels.cc | 30 +- source/grid/tria_objects.cc | 31 +- source/hp/dof_handler.cc | 77 +- source/hp/fe_collection.cc | 7 +- source/hp/fe_values.cc | 160 ++-- source/hp/mapping_collection.cc | 5 +- source/lac/affine_constraints.cc | 33 +- source/lac/affine_constraints.inst.in | 66 +- source/lac/block_matrix_array.cc | 37 +- source/lac/block_sparsity_pattern.cc | 99 +-- source/lac/chunk_sparse_matrix.inst.in | 20 +- source/lac/chunk_sparsity_pattern.cc | 28 +- source/lac/cuda_solver_direct.cu | 24 +- source/lac/cuda_sparse_matrix.cu | 30 +- source/lac/cuda_vector.cu | 113 ++- source/lac/dynamic_sparsity_pattern.cc | 84 +- source/lac/exceptions.cc | 3 +- source/lac/full_matrix.inst.in | 118 +-- source/lac/lapack_full_matrix.cc | 37 +- source/lac/matrix_lib.cc | 3 +- source/lac/matrix_out.cc | 8 +- source/lac/petsc_matrix_base.cc | 6 +- source/lac/petsc_matrix_free.cc | 19 +- source/lac/petsc_parallel_sparse_matrix.cc | 51 +- source/lac/petsc_parallel_vector.cc | 21 +- source/lac/petsc_precondition.cc | 62 +- source/lac/petsc_solver.cc | 107 +-- source/lac/petsc_sparse_matrix.cc | 6 +- source/lac/petsc_vector_base.cc | 34 +- source/lac/scalapack.cc | 124 +-- source/lac/slepc_solver.cc | 68 +- source/lac/slepc_spectral_transformation.cc | 42 +- source/lac/solver_bicgstab.cc | 16 +- source/lac/solver_control.cc | 64 +- source/lac/sparse_direct.cc | 34 +- source/lac/sparse_matrix.inst.in | 90 ++- source/lac/sparse_matrix_ez.inst.in | 10 +- source/lac/sparsity_pattern.cc | 145 ++-- source/lac/sparsity_tools.cc | 50 +- source/lac/tridiagonal_matrix.cc | 12 +- source/lac/trilinos_block_sparse_matrix.cc | 10 +- source/lac/trilinos_block_vector.cc | 5 +- source/lac/trilinos_epetra_vector.cc | 35 +- source/lac/trilinos_precondition.cc | 171 ++-- source/lac/trilinos_precondition_ml.cc | 35 +- source/lac/trilinos_precondition_muelu.cc | 34 +- source/lac/trilinos_solver.cc | 202 ++--- source/lac/trilinos_sparse_matrix.cc | 754 +++++++++--------- source/lac/trilinos_sparsity_pattern.cc | 111 +-- source/lac/trilinos_vector.cc | 63 +- source/matrix_free/matrix_free.inst.in | 32 +- source/matrix_free/task_info.cc | 120 +-- source/meshworker/mesh_worker.cc | 16 +- source/multigrid/mg_level_global_transfer.cc | 20 +- source/multigrid/mg_tools.cc | 23 +- source/multigrid/mg_transfer_block.inst.in | 18 +- source/multigrid/mg_transfer_component.cc | 5 +- source/multigrid/mg_transfer_internal.cc | 43 +- source/multigrid/mg_transfer_matrix_free.cc | 38 +- source/multigrid/mg_transfer_prebuilt.cc | 25 +- source/multigrid/multigrid.cc | 48 +- source/non_matching/coupling.cc | 18 +- .../immersed_surface_quadrature.cc | 6 +- source/numerics/data_out.cc | 23 +- source/numerics/data_out_faces.cc | 27 +- source/numerics/data_out_rotation.cc | 33 +- source/numerics/data_out_stack.cc | 5 +- source/numerics/data_postprocessor.cc | 18 +- source/numerics/derivative_approximation.cc | 6 +- source/numerics/error_estimator_1d.cc | 49 +- source/numerics/histogram.cc | 37 +- source/numerics/kdtree.cc | 4 +- source/numerics/matrix_tools.cc | 6 +- source/numerics/point_value_history.cc | 65 +- source/numerics/solution_transfer.cc | 33 +- source/numerics/time_dependent.cc | 132 +-- source/opencascade/boundary_lib.cc | 5 +- source/opencascade/manifold_lib.cc | 72 +- source/opencascade/utilities.cc | 17 +- source/opencascade/utilities.inst.in | 5 +- source/particles/particle.cc | 58 +- source/particles/particle_accessor.cc | 13 +- source/particles/particle_handler.cc | 164 ++-- source/particles/particle_iterator.cc | 4 +- source/particles/property_pool.cc | 4 +- source/sundials/arkode.cc | 21 +- source/sundials/ida.cc | 31 +- source/sundials/kinsol.cc | 18 +- tests/algorithms/newton_01.cc | 6 +- tests/algorithms/theta_01.cc | 6 +- tests/aniso/solution_transfer.cc | 3 +- tests/arpack/arpack_advection_diffusion.cc | 18 +- .../parpack_advection_diffusion_petsc.cc | 52 +- .../parpack_advection_diffusion_trilinos.cc | 45 +- tests/arpack/step-36_ar.cc | 16 +- tests/arpack/step-36_ar_shift.cc | 16 +- tests/arpack/step-36_parpack.cc | 58 +- tests/arpack/step-36_parpack_mf.cc | 29 +- tests/arpack/step-36_parpack_mf_02.cc | 32 +- tests/arpack/step-36_parpack_mf_03.cc | 38 +- tests/arpack/step-36_parpack_trilinos.cc | 45 +- tests/base/aligned_vector_04.cc | 7 +- tests/base/aligned_vector_05.cc | 6 +- tests/base/auto_derivative_function.cc | 3 +- tests/base/cell_data_storage_01.cc | 3 +- tests/base/cell_data_storage_02.cc | 6 +- tests/base/convergence_table_01.cc | 10 +- tests/base/convergence_table_04.cc | 33 +- tests/base/convergence_table_05.cc | 6 +- tests/base/full_tensor_02.cc | 8 +- tests/base/function_parser_02.cc | 20 +- tests/base/function_parser_04.cc | 3 +- tests/base/functions.h | 6 +- tests/base/functions_08.cc | 5 +- tests/base/functions_10.cc | 5 +- tests/base/functions_11.cc | 10 +- tests/base/functions_constant_function_00.cc | 20 +- tests/base/functions_spherical_01.cc | 14 +- tests/base/functions_spherical_02.cc | 10 +- tests/base/index_set_20_offset.cc | 8 +- tests/base/index_set_28.cc | 6 +- tests/base/index_set_29.cc | 6 +- tests/base/is_finite_complex.cc | 10 +- tests/base/parallel_transform_03.cc | 16 +- tests/base/polynomial_jacobi_roots.cc | 6 +- tests/base/polynomial_jacobi_roots_ld.cc | 6 +- tests/base/product_type_05.cc | 18 +- tests/base/quadrature_check_tensor_product.cc | 8 +- tests/base/quadrature_point_data.cc | 3 +- tests/base/quadrature_point_data_02.cc | 3 +- tests/base/quadrature_point_data_03.cc | 3 +- tests/base/quadrature_simplex_01.cc | 10 +- tests/base/quadrature_simplex_02.cc | 10 +- tests/base/quadrature_simplex_03.cc | 10 +- tests/base/quadrature_simplex_04.cc | 15 +- tests/base/quadrature_simplex_05.cc | 5 +- tests/base/reference.cc | 3 +- tests/base/table.cc | 10 +- tests/base/table_06.cc | 7 +- tests/base/task_11.cc | 6 +- tests/base/thread_local_storage_03.cc | 3 +- tests/base/thread_local_storage_04.cc | 3 +- tests/base/thread_local_storage_05.cc | 3 +- tests/base/thread_local_storage_06.cc | 3 +- tests/base/thread_validity_01.cc | 3 +- tests/base/thread_validity_02.cc | 3 +- tests/base/thread_validity_03.cc | 3 +- tests/base/thread_validity_04.cc | 3 +- tests/base/thread_validity_05.cc | 6 +- tests/base/thread_validity_06.cc | 6 +- tests/base/thread_validity_13.cc | 6 +- tests/base/thread_validity_14.cc | 6 +- tests/base/timer_06.cc | 11 +- tests/base/timer_07.cc | 11 +- tests/base/utilities_pack_unpack_05.cc | 10 +- tests/base/utilities_pack_unpack_06.cc | 29 +- tests/base/vectorization_03.cc | 5 +- tests/base/work_stream_03.cc | 47 +- tests/base/work_stream_03_graph.cc | 55 +- tests/base/work_stream_05_graph.cc | 20 +- tests/bits/anna_1.cc | 6 +- tests/bits/anna_2.cc | 6 +- tests/bits/anna_3.cc | 6 +- tests/bits/anna_4.cc | 15 +- tests/bits/anna_6.cc | 21 +- tests/bits/apply_boundary_values_01.cc | 6 +- tests/bits/apply_boundary_values_02.cc | 6 +- tests/bits/block_sparse_matrix_1.cc | 5 +- tests/bits/block_sparse_matrix_2.cc | 5 +- tests/bits/christian_1.cc | 3 +- tests/bits/denis_1.cc | 5 +- tests/bits/error_estimator_01.cc | 3 +- tests/bits/error_estimator_02.cc | 3 +- .../face_orientation_and_fe_nedelec_01.cc | 12 +- tests/bits/face_orientation_and_fe_q_01.cc | 12 +- tests/bits/face_orientation_and_fe_q_02.cc | 12 +- tests/bits/faceq_subface_interpolation.cc | 10 +- tests/bits/fe_field_function_01_vector.cc | 3 +- tests/bits/fe_field_function_02_vector.cc | 3 +- tests/bits/fe_field_function_04_vector.cc | 3 +- tests/bits/fe_field_function_05_vector.cc | 3 +- tests/bits/fe_field_function_06_vector.cc | 3 +- tests/bits/fe_field_function_07_vector.cc | 3 +- tests/bits/fe_field_function_08_vector.cc | 3 +- tests/bits/fe_q_constraints.cc | 19 +- tests/bits/fe_tools_cpfqpm_01.cc | 6 +- tests/bits/fe_tools_cpfqpm_02.cc | 6 +- tests/bits/fe_tools_cpfqpm_03.cc | 6 +- tests/bits/fe_tools_cpfqpm_04.cc | 12 +- tests/bits/fe_tools_cpfqpm_05.cc | 6 +- tests/bits/find_cell_12.cc | 5 +- tests/bits/find_cell_7.cc | 5 +- tests/bits/find_closest_vertex_1.cc | 5 +- tests/bits/gerold_1.cc | 4 +- tests/bits/joa_1.cc | 30 +- tests/bits/make_boundary_constraints_01.cc | 6 +- tests/bits/make_boundary_constraints_02.cc | 6 +- .../bits/map_dofs_to_support_points_hp_01.cc | 5 +- .../bits/map_dofs_to_support_points_hp_02.cc | 5 +- tests/bits/normals_1.cc | 5 +- tests/bits/normals_2.cc | 6 +- tests/bits/normals_3.cc | 6 +- tests/bits/normals_4.cc | 6 +- tests/bits/periodic_flux_coupling_01.cc | 4 +- tests/bits/periodicity_01.cc | 15 +- tests/bits/periodicity_02.cc | 15 +- tests/bits/periodicity_03.cc | 15 +- tests/bits/periodicity_04.cc | 16 +- tests/bits/periodicity_05.cc | 4 +- tests/bits/periodicity_06.cc | 8 +- tests/bits/periodicity_07.cc | 8 +- tests/bits/point_difference_01.cc | 6 +- tests/bits/point_difference_02.cc | 6 +- tests/bits/point_gradient_01.cc | 14 +- tests/bits/point_gradient_02.cc | 14 +- tests/bits/point_gradient_hp_01.cc | 14 +- tests/bits/point_gradient_hp_02.cc | 22 +- tests/bits/point_value_01.cc | 6 +- tests/bits/point_value_02.cc | 6 +- tests/bits/point_value_hp_01.cc | 6 +- tests/bits/point_value_hp_02.cc | 6 +- tests/bits/q_points.cc | 15 +- tests/bits/solution_transfer.cc | 3 +- tests/bits/static_condensation.cc | 54 +- tests/bits/step-10-high-order.cc | 6 +- tests/bits/step-10.cc | 19 +- tests/bits/step-11.cc | 38 +- tests/bits/step-12.cc | 99 ++- tests/bits/step-13.cc | 117 +-- tests/bits/step-14.cc | 248 +++--- tests/bits/step-16.cc | 18 +- tests/bits/step-2.cc | 5 +- tests/bits/step-3.cc | 21 +- tests/bits/step-4.cc | 27 +- tests/bits/step-4_dg_periodic.cc | 4 +- tests/bits/step-4_dg_periodic_coupling.cc | 4 +- tests/bits/step-5.cc | 24 +- tests/bits/step-51.cc | 191 ++--- tests/bits/step-51p.cc | 191 ++--- tests/bits/step-6-racoptimize-2.cc | 29 +- tests/bits/step-6-racoptimize.cc | 24 +- tests/bits/step-6.cc | 30 +- tests/bits/step-7.cc | 43 +- tests/bits/step-8.cc | 32 +- tests/bits/subface_interpolation.cc | 10 +- tests/bits/volume_1.cc | 18 +- tests/bits/volume_2.cc | 22 +- tests/bits/volume_3.cc | 22 +- tests/bits/volume_4.cc | 22 +- tests/codim_one/bem.cc | 15 +- tests/codim_one/boundary_indicator_01.cc | 5 +- tests/codim_one/data_out_03.cc | 3 +- tests/codim_one/error_estimator_01.cc | 3 +- tests/codim_one/error_estimator_02.cc | 6 +- tests/codim_one/extract_boundary_mesh_00.cc | 6 +- tests/codim_one/extract_boundary_mesh_04.cc | 6 +- tests/codim_one/extract_boundary_mesh_07.cc | 16 +- tests/codim_one/gradients.cc | 5 +- tests/codim_one/hanging_nodes_01.cc | 5 +- tests/codim_one/hanging_nodes_02.cc | 5 +- tests/codim_one/hanging_nodes_03.cc | 5 +- tests/codim_one/integrate_log.cc | 5 +- tests/codim_one/integrate_log_2.cc | 6 +- ...polate_boundary_values_01_vector_valued.cc | 3 +- ...polate_boundary_values_02_vector_valued.cc | 17 +- tests/codim_one/mapping_01.cc | 6 +- tests/codim_one/mapping_02.cc | 6 +- tests/codim_one/mapping_q_eulerian.cc | 5 +- tests/codim_one/normal_vectors_01.cc | 6 +- tests/codim_one/transform_01.cc | 5 +- tests/cuda/matrix_vector_common.h | 5 +- tests/cuda/matrix_vector_mf.h | 4 +- tests/cuda/solver_02.cu | 16 +- tests/cuda/sparse_matrix_01.cu | 6 +- tests/data_out/data_out.cc | 4 +- tests/data_out/data_out_08.cc | 8 +- tests/data_out/data_out_11.cc | 12 +- .../data_out_base_gnuplot_labels_02.cc | 6 +- tests/data_out/data_out_complex_03_mixed.cc | 5 +- tests/data_out/data_out_curved_cells.cc | 5 +- tests/data_out/data_out_faces_01.cc | 10 +- tests/data_out/data_out_faces_02.cc | 10 +- .../data_out_faces_postprocessor_scalar_02.cc | 3 +- .../data_out_faces_postprocessor_vector_02.cc | 3 +- tests/data_out/data_out_hdf5_02.cc | 6 +- .../data_out/data_out_postprocessor_01-new.cc | 9 +- .../data_out_postprocessor_scalar_01-new.cc | 12 +- .../data_out_postprocessor_scalar_02.cc | 3 +- .../data_out_postprocessor_tensor_01.cc | 33 +- .../data_out_postprocessor_vector_01-new.cc | 13 +- .../data_out_postprocessor_vector_02.cc | 3 +- .../data_out_postprocessor_vector_03.cc | 22 +- tests/data_out/data_out_rotation_01.cc | 10 +- tests/data_out/data_out_rotation_02.cc | 10 +- ...ta_out_rotation_postprocessor_scalar_02.cc | 3 +- tests/distributed_grids/2d_refinement_10.cc | 20 +- tests/distributed_grids/3d_refinement_07.cc | 6 +- tests/distributed_grids/3d_refinement_12.cc | 20 +- .../distributed_grids/solution_transfer_02.cc | 3 +- .../distributed_grids/solution_transfer_03.cc | 3 +- tests/dofs/block_list_04.cc | 15 +- tests/dofs/block_list_05.cc | 6 +- tests/dofs/block_relaxation_01.cc | 17 +- tests/dofs/dof_test.cc | 4 +- tests/dofs/dof_tools_00a.cc | 24 +- tests/dofs/dof_tools_05.cc | 16 +- tests/dofs/dof_tools_13a.cc | 10 +- tests/dofs/dof_tools_15c.cc | 6 +- tests/dofs/dof_tools_15d.cc | 6 +- tests/dofs/dof_tools_16d.cc | 6 +- tests/dofs/dof_tools_20.cc | 16 +- tests/dofs/dof_tools_21.cc | 5 +- tests/dofs/dof_tools_21_b.cc | 22 +- tests/dofs/dof_tools_21_b_x.cc | 5 +- tests/dofs/dof_tools_21_b_x_q3.cc | 5 +- tests/dofs/dof_tools_21_b_y.cc | 5 +- tests/dofs/dof_tools_21_c.cc | 22 +- tests/dofs/dof_tools_22a.cc | 22 +- ...t_dofs_with_support_contained_within_01.cc | 5 +- ...t_dofs_with_support_contained_within_02.cc | 15 +- ...t_dofs_with_support_contained_within_03.cc | 5 +- ...t_dofs_with_support_contained_within_04.cc | 22 +- ...write_gnuplot_dof_support_point_info_01.cc | 17 +- tests/dofs/extract_dofs_by_component_01_mg.cc | 6 +- tests/dofs/extract_dofs_by_component_02_mg.cc | 6 +- .../interpolate_based_on_material_id_01.cc | 9 +- tests/dofs/interpolate_boundary_values_01.cc | 15 +- tests/dofs/interpolate_boundary_values_02.cc | 12 +- tests/dofs/interpolate_dgq_01.cc | 3 +- tests/dofs/interpolate_dgq_02.cc | 3 +- tests/dofs/interpolate_q_01.cc | 3 +- tests/dofs/interpolate_q_02.cc | 3 +- tests/dofs/interpolate_q_system_01.cc | 4 +- tests/dofs/interpolate_q_system_02.cc | 4 +- tests/dofs/interpolate_q_system_mask_01.cc | 17 +- tests/dofs/interpolate_q_system_mask_02.cc | 17 +- tests/dofs/n_boundary_dofs_02.cc | 5 +- tests/dofs/n_boundary_dofs_03.cc | 5 +- tests/dofs/range_based_for_step-6.cc | 19 +- tests/dofs/sparsity_pattern.cc | 5 +- tests/dofs/sparsity_pattern_01.cc | 5 +- tests/dofs/sparsity_pattern_02.cc | 5 +- tests/dofs/sparsity_pattern_03.cc | 5 +- tests/dofs/sparsity_pattern_04.cc | 5 +- tests/fail/abf_approximation_01.cc | 24 +- tests/fail/circular_01.cc | 164 ++-- tests/fail/hp-step-14.cc | 248 +++--- tests/fail/hp-step-15.cc | 39 +- tests/fail/rt_distorted_01.cc | 31 +- tests/fail/rt_distorted_02.cc | 21 +- tests/fail/step-15.cc | 39 +- tests/fail/vectors_boundary_rhs_hp_02.cc | 9 +- tests/fail/vectors_rhs_hp_02.cc | 9 +- tests/fe/abf_01.cc | 11 +- tests/fe/abf_02.cc | 5 +- tests/fe/cell_similarity_11.cc | 6 +- tests/fe/curl_curl_01.cc | 12 +- tests/fe/deformed_projection.h | 8 +- tests/fe/derivatives.cc | 6 +- tests/fe/derivatives_bernstein.cc | 6 +- tests/fe/derivatives_face.cc | 6 +- tests/fe/fe_dgq_hessian_divergence_theorem.cc | 5 +- tests/fe/fe_enriched_01.cc | 3 +- tests/fe/fe_enriched_02.cc | 8 +- tests/fe/fe_enriched_03.cc | 3 +- tests/fe/fe_enriched_04.cc | 8 +- tests/fe/fe_enriched_05.cc | 3 +- tests/fe/fe_enriched_06.cc | 3 +- tests/fe/fe_enriched_07.cc | 3 +- tests/fe/fe_enriched_08.cc | 18 +- tests/fe/fe_enriched_08a.cc | 15 +- tests/fe/fe_enriched_compare_to_fe_system.cc | 9 +- .../fe/fe_enriched_compare_to_fe_system_2.cc | 12 +- tests/fe/fe_enriched_step-36.cc | 86 +- tests/fe/fe_enriched_step-36b.cc | 111 +-- tests/fe/fe_face_orientation_nedelec.h | 15 +- tests/fe/fe_face_orientation_nedelec_0.cc | 9 +- tests/fe/fe_face_values_1d.cc | 13 +- .../fe_nedelec_hessian_divergence_theorem.cc | 5 +- tests/fe/fe_nedelec_sz_face_orientation.cc | 6 +- tests/fe/fe_nedelec_sz_non_rect_2d.cc | 19 +- tests/fe/fe_nedelec_sz_non_rect_face.cc | 19 +- tests/fe/fe_nothing.cc | 15 +- tests/fe/fe_project_2d.cc | 9 +- tests/fe/fe_project_3d.cc | 24 +- tests/fe/fe_prolongation_sys_06.cc | 16 +- tests/fe/fe_prolongation_sys_08.cc | 16 +- tests/fe/fe_q_bubbles.cc | 22 +- tests/fe/fe_q_dg0.cc | 40 +- tests/fe/fe_q_hessian_divergence_theorem.cc | 5 +- tests/fe/fe_rannacher_turek_02.cc | 5 +- tests/fe/fe_restriction_sys_06.cc | 16 +- tests/fe/fe_restriction_sys_08.cc | 16 +- tests/fe/fe_restriction_sys_10.cc | 16 +- tests/fe/fe_rt_hessian_divergence_theorem.cc | 5 +- tests/fe/fe_series_01.cc | 5 +- tests/fe/fe_series_02.cc | 6 +- tests/fe/fe_series_04.cc | 3 +- tests/fe/fe_series_05.cc | 6 +- tests/fe/fe_series_06.cc | 5 +- tests/fe/fe_system_components_base.cc | 5 +- tests/fe/fe_system_from_list.cc | 10 +- tests/fe/fe_tools.cc | 5 +- tests/fe/fe_values_function_manifold.cc | 41 +- tests/fe/fe_values_no_mapping.cc | 3 +- tests/fe/fe_values_view_01.cc | 5 +- tests/fe/fe_values_view_02.cc | 11 +- tests/fe/fe_values_view_03.cc | 5 +- tests/fe/fe_values_view_04.cc | 23 +- tests/fe/fe_values_view_05.cc | 5 +- tests/fe/fe_values_view_06.cc | 5 +- tests/fe/fe_values_view_07.cc | 5 +- tests/fe/fe_values_view_08.cc | 5 +- tests/fe/fe_values_view_09.cc | 5 +- tests/fe/fe_values_view_10.cc | 5 +- tests/fe/fe_values_view_10_single_01.cc | 5 +- tests/fe/fe_values_view_10_single_02.cc | 5 +- tests/fe/fe_values_view_10_single_03.cc | 5 +- tests/fe/fe_values_view_11.cc | 5 +- tests/fe/fe_values_view_12.cc | 5 +- tests/fe/fe_values_view_13.cc | 5 +- tests/fe/fe_values_view_14.cc | 5 +- tests/fe/fe_values_view_15.cc | 5 +- tests/fe/fe_values_view_16.cc | 5 +- tests/fe/fe_values_view_17.cc | 5 +- tests/fe/fe_values_view_18.cc | 5 +- tests/fe/fe_values_view_19.cc | 5 +- tests/fe/fe_values_view_20.cc | 5 +- tests/fe/fe_values_view_21.cc | 23 +- tests/fe/fe_values_view_21_nonsymmetric.cc | 23 +- tests/fe/fe_values_view_22.cc | 23 +- tests/fe/fe_values_view_25b_nonsymmetric.cc | 11 +- tests/fe/fe_values_view_28.cc | 9 +- tests/fe/fe_values_view_29.cc | 9 +- tests/fe/fe_values_view_30.cc | 3 +- ...w_get_function_from_local_dof_values_01.cc | 5 +- ...w_get_function_from_local_dof_values_02.cc | 5 +- tests/fe/fe_values_view_tensor_01.cc | 23 +- tests/fe/injection_q_system.cc | 13 +- tests/fe/interpolate_common.h | 3 +- tests/fe/interpolate_q_system_mixed_01.cc | 23 +- tests/fe/jacobians.cc | 18 +- tests/fe/jacobians_face.cc | 60 +- tests/fe/jacobians_face_cartesian.cc | 60 +- tests/fe/jacobians_face_fe_field.cc | 60 +- tests/fe/nedelec_2.cc | 15 +- tests/fe/nedelec_3.cc | 5 +- tests/fe/nedelec_crash_01.cc | 3 +- tests/fe/nedelec_crash_hp.cc | 10 +- tests/fe/nedelec_face_interpolation.cc | 10 +- tests/fe/nedelec_non_rect_2d.cc | 19 +- tests/fe/nedelec_non_rect_face.cc | 19 +- tests/fe/non_primitive_1.cc | 25 +- tests/fe/non_primitive_2.cc | 20 +- tests/fe/rt_7.cc | 5 +- tests/fe/rt_approximation_01.cc | 24 +- tests/fe/rt_bubbles_15.cc | 5 +- tests/fe/rt_hessian.cc | 5 +- tests/fe/rt_normal_02.cc | 12 +- tests/fe/rtdiff.cc | 10 +- tests/fe/rtn_2.cc | 5 +- tests/fe/shapes.h | 46 +- tests/fe/system_03.cc | 5 +- tests/fe/system_04.cc | 5 +- tests/full_matrix/full_matrix_10.cc | 5 +- tests/full_matrix/full_matrix_11.cc | 5 +- tests/gla/block_mat_02.cc | 38 +- tests/gla/block_mat_03.cc | 42 +- tests/gla/extract_subvector_to_parallel.cc | 20 +- tests/gla/mat_03.cc | 12 +- tests/gla/mat_04.cc | 24 +- tests/grid/coarsening_02.cc | 10 +- tests/grid/coarsening_02_1d.cc | 10 +- tests/grid/coarsening_03.cc | 10 +- .../distributed_compute_point_locations_02.cc | 5 +- tests/grid/filtered_iterator.cc | 20 +- tests/grid/filtered_iterator_02.cc | 25 +- tests/grid/grid_generator_06.cc | 6 +- tests/grid/grid_generator_07.cc | 5 +- tests/grid/grid_out_gnuplot_02.cc | 8 +- tests/grid/grid_out_per_processor_vtu_01.cc | 6 +- tests/grid/grid_out_per_processor_vtu_02.cc | 6 +- tests/grid/grid_out_svg_01.cc | 5 +- tests/grid/grid_out_svg_02.cc | 5 +- tests/grid/grid_parallelepiped_03.cc | 6 +- tests/grid/grid_parallelepiped_04.cc | 6 +- tests/grid/grid_remove_anisotropy.cc | 5 +- .../grid/grid_tools_halo_layer_ghost_cells.cc | 6 +- tests/grid/grid_tools_min_max_diameter_01.cc | 5 +- tests/grid/grid_transform_03.cc | 6 +- tests/grid/grid_transform_3d.cc | 12 +- tests/grid/intergrid_constraints.cc | 6 +- tests/grid/merge_triangulations_04.cc | 36 +- tests/grid/mesh_3d.h | 20 +- tests/grid/mesh_3d_14.cc | 9 +- tests/grid/mesh_3d_16.cc | 5 +- tests/grid/mesh_3d_20.cc | 10 +- tests/grid/mesh_3d_22.cc | 9 +- tests/grid/mesh_3d_25.cc | 9 +- tests/grid/mesh_3d_26.cc | 9 +- tests/grid/mesh_3d_7.cc | 10 +- tests/grid/mesh_smoothing_03.cc | 6 +- tests/grid/normal_vector_03.cc | 5 +- tests/grid/refine_and_coarsen_01.cc | 6 +- tests/grid/subdomain_ids.cc | 24 +- tests/grid/vertex_as_face_07.cc | 20 +- tests/hp/boundary_matrices.cc | 9 +- tests/hp/boundary_matrices_hp.cc | 9 +- tests/hp/compare_hp_vs_nonhp_01.cc | 56 +- tests/hp/crash_09.cc | 6 +- tests/hp/crash_11.cc | 6 +- tests/hp/crash_12.cc | 10 +- tests/hp/crash_17.cc | 39 +- tests/hp/crash_18.cc | 39 +- tests/hp/crash_19.cc | 12 +- tests/hp/crash_21.cc | 3 +- tests/hp/distribute_dofs_linear_time.cc | 6 +- tests/hp/face_domination_01.cc | 6 +- tests/hp/face_domination_02.cc | 6 +- tests/hp/face_domination_03.cc | 8 +- tests/hp/face_domination_04.cc | 6 +- tests/hp/fe_nothing_08.cc | 6 +- tests/hp/fe_nothing_09.cc | 6 +- tests/hp/fe_nothing_11.cc | 6 +- tests/hp/fe_nothing_18.cc | 61 +- tests/hp/fe_nothing_20.cc | 5 +- tests/hp/fe_nothing_21.cc | 5 +- tests/hp/flux_sparsity.cc | 12 +- tests/hp/flux_sparsity_02.cc | 30 +- tests/hp/get_interpolated_dof_values_02.cc | 5 +- tests/hp/hp_constraints_common.h | 14 +- tests/hp/hp_constraints_common_no_support.h | 14 +- .../hp/hp_constraints_neither_dominate_01.cc | 6 +- .../hp/hp_constraints_neither_dominate_02.cc | 11 +- tests/hp/hp_q_hierarchical_constraints.cc | 15 +- tests/hp/integrate_difference_02.cc | 12 +- tests/hp/integrate_difference_03.cc | 9 +- tests/hp/interpolate_dgq_01.cc | 17 +- tests/hp/interpolate_dgq_02.cc | 17 +- tests/hp/interpolate_nothing_01.cc | 8 +- tests/hp/interpolate_nothing_02.cc | 19 +- tests/hp/interpolate_nothing_03.cc | 5 +- tests/hp/interpolate_q_01.cc | 17 +- tests/hp/interpolate_q_02.cc | 17 +- tests/hp/interpolate_q_system_01.cc | 18 +- tests/hp/interpolate_q_system_02.cc | 18 +- tests/hp/matrices.cc | 9 +- tests/hp/matrices_hp.cc | 9 +- tests/hp/n_boundary_dofs_02.cc | 5 +- tests/hp/n_boundary_dofs_03.cc | 5 +- tests/hp/project_01.cc | 8 +- tests/hp/project_02.cc | 8 +- tests/hp/q_vs_dgq.cc | 3 +- tests/hp/renumber_block_wise_01b.cc | 6 +- .../hp/set_dof_values_by_interpolation_02.cc | 5 +- tests/hp/solution_transfer.cc | 19 +- tests/hp/solution_transfer_12.cc | 17 +- tests/hp/step-10.cc | 19 +- tests/hp/step-11.cc | 51 +- tests/hp/step-12.cc | 113 ++- tests/hp/step-13.cc | 108 +-- tests/hp/step-2.cc | 5 +- tests/hp/step-27.cc | 36 +- tests/hp/step-3.cc | 21 +- tests/hp/step-3a.cc | 20 +- tests/hp/step-3a_mapping_collection.cc | 20 +- tests/hp/step-3b.cc | 20 +- tests/hp/step-3c.cc | 20 +- tests/hp/step-4.cc | 29 +- tests/hp/step-5.cc | 26 +- tests/hp/step-6.cc | 32 +- tests/hp/step-7.cc | 54 +- tests/hp/step-8.cc | 32 +- tests/hp/vectors_boundary_rhs_01.cc | 9 +- tests/hp/vectors_boundary_rhs_02.cc | 9 +- tests/hp/vectors_boundary_rhs_03.cc | 9 +- tests/hp/vectors_boundary_rhs_hp_01.cc | 9 +- tests/hp/vectors_boundary_rhs_hp_03.cc | 9 +- tests/hp/vectors_point_source_hp_01.cc | 6 +- tests/hp/vectors_rhs_01.cc | 9 +- tests/hp/vectors_rhs_02.cc | 9 +- tests/hp/vectors_rhs_03.cc | 9 +- tests/hp/vectors_rhs_hp_01.cc | 9 +- tests/hp/vectors_rhs_hp_03.cc | 9 +- tests/integrators/advection_01.cc | 45 +- .../assembler_simple_system_inhom_01.cc | 53 +- tests/integrators/divergence_01.cc | 20 +- tests/integrators/elasticity_01.cc | 41 +- tests/integrators/elasticity_02.cc | 10 +- tests/integrators/grad_div_01.cc | 41 +- tests/integrators/laplacian_01.cc | 41 +- tests/integrators/mesh_worker_02.cc | 10 +- tests/integrators/mesh_worker_03.cc | 10 +- tests/integrators/mesh_worker_1d_dg.cc | 16 +- tests/lac/block_matrices_04.cc | 43 +- tests/lac/block_vector_iterator.cc | 11 +- tests/lac/constrained_linear_operator_01.cc | 16 +- tests/lac/constraints_block_01.cc | 6 +- tests/lac/constraints_c1.cc | 10 +- tests/lac/constraints_hanging_nodes_bc.cc | 6 +- tests/lac/constraints_local_to_global.cc | 16 +- .../lac/constraints_local_to_global_chunk.cc | 16 +- tests/lac/constraints_shift_01.cc | 5 +- tests/lac/diagonal_matrix_02.cc | 33 +- tests/lac/filtered_matrix_06.cc | 5 +- tests/lac/inhomogeneous_constraints.cc | 41 +- tests/lac/inhomogeneous_constraints_block.cc | 15 +- .../inhomogeneous_constraints_nonsymmetric.cc | 25 +- tests/lac/inhomogeneous_constraints_vector.cc | 25 +- tests/lac/la_vector_norms.cc | 8 +- tests/lac/la_vector_output.cc | 6 +- tests/lac/linear_operator_11.cc | 16 +- tests/lac/linear_operator_12.cc | 41 +- tests/lac/linear_operator_12a.cc | 41 +- tests/lac/linear_operator_13.cc | 97 +-- tests/lac/linear_operator_14.cc | 121 +-- tests/lac/matrices_02.cc | 9 +- tests/lac/matrix_out.cc | 10 +- tests/lac/matrix_out_02.cc | 5 +- tests/lac/precondition_chebyshev_01.cc | 4 +- tests/lac/quickmatrix.h | 6 +- tests/lac/schur_complement_01.cc | 5 +- tests/lac/schur_complement_03.cc | 60 +- tests/lac/solver_monitor.cc | 5 +- tests/lac/solver_signals.cc | 5 +- tests/lac/sparse_matrices.cc | 22 +- .../tensor_product_matrix_vectorized_01.cc | 15 +- .../tensor_product_matrix_vectorized_02.cc | 15 +- .../tensor_product_matrix_vectorized_03.cc | 15 +- .../tensor_product_matrix_vectorized_04.cc | 15 +- tests/lac/utilities_01.cc | 12 +- tests/lac/utilities_02.cc | 27 +- tests/lac/vector_norms.cc | 8 +- ...ector_operations_parallel_for_start_end.cc | 11 +- ...or_operations_parallel_reduce_start_end.cc | 5 +- tests/lapack/solver_cg.cc | 5 +- tests/manifold/chart_manifold_03.cc | 4 +- tests/manifold/chart_manifold_03_embedded.cc | 4 +- tests/manifold/chart_manifold_06.cc | 4 +- tests/manifold/chart_manifold_06_embedded.cc | 4 +- tests/manifold/chart_manifold_07.cc | 3 +- tests/manifold/chart_manifold_08.cc | 3 +- tests/manifold/spherical_manifold_01.cc | 5 +- tests/manifold/spherical_manifold_08.cc | 10 +- tests/manifold/spherical_manifold_09.cc | 63 +- tests/manifold/spherical_manifold_10.cc | 5 +- tests/manifold/spherical_manifold_12.cc | 10 +- tests/manifold/transfinite_manifold_01.cc | 9 +- tests/manifold/transfinite_manifold_02.cc | 9 +- tests/manifold/transfinite_manifold_04.cc | 9 +- tests/manifold/transfinite_manifold_07.cc | 8 +- tests/manifold/tria_boundary_id_01.cc | 5 +- .../fe_face_values_1d_mapping_cartesian.cc | 13 +- .../mappings/fe_face_values_1d_mapping_q2.cc | 13 +- tests/mappings/mapping.cc | 18 +- tests/mappings/mapping_fe_field_01.cc | 6 +- tests/mappings/mapping_fe_field_03.cc | 5 +- .../mapping_fe_field_real_to_unit_b2_mask.cc | 6 +- .../mapping_fe_field_real_to_unit_q2_mask.cc | 6 +- tests/mappings/mapping_manifold_02.cc | 6 +- tests/mappings/mapping_manifold_03.cc | 6 +- tests/mappings/mapping_manifold_04.cc | 6 +- tests/mappings/mapping_manifold_05.cc | 14 +- tests/mappings/mapping_manifold_07.cc | 8 +- tests/mappings/mapping_manifold_step-3.cc | 21 +- tests/mappings/mapping_project_01.cc | 15 +- tests/mappings/mapping_q1_cartesian_grid.cc | 8 +- tests/mappings/mapping_q1_eulerian_01.cc | 3 +- tests/mappings/mapping_q4_3d.cc | 6 +- tests/mappings/mapping_q_eulerian.cc | 17 +- tests/mappings/mapping_q_eulerian_01.cc | 3 +- tests/mappings/mapping_q_eulerian_02.cc | 3 +- tests/mappings/mapping_q_eulerian_03.cc | 3 +- tests/mappings/mapping_q_eulerian_05.cc | 5 +- tests/mappings/mapping_q_eulerian_06.cc | 5 +- tests/mappings/mapping_q_eulerian_07.cc | 13 +- tests/mappings/mapping_q_eulerian_08.cc | 38 +- tests/mappings/mapping_q_eulerian_09.cc | 13 +- tests/mappings/mapping_q_eulerian_11.cc | 13 +- tests/mappings/mapping_q_manifold_01.cc | 3 +- tests/mappings/mapping_q_manifold_02.cc | 28 +- tests/matrix_free/assemble_matrix_03.cc | 36 +- tests/matrix_free/cell_categorization.cc | 7 +- tests/matrix_free/compare_faces_by_cells.cc | 6 +- tests/matrix_free/compress_constraints.cc | 6 +- tests/matrix_free/copy.cc | 6 +- tests/matrix_free/copy_feevaluation.cc | 19 +- tests/matrix_free/dg_pbc_02.cc | 13 +- .../estimate_condition_number_mass.cc | 9 +- tests/matrix_free/faces_value_optimization.cc | 4 +- .../faces_value_optimization_02.cc | 4 +- tests/matrix_free/get_functions_common.h | 22 +- tests/matrix_free/get_functions_faces.cc | 3 +- tests/matrix_free/get_functions_float.cc | 6 +- tests/matrix_free/get_functions_multife.cc | 21 +- tests/matrix_free/get_functions_multife2.cc | 27 +- tests/matrix_free/get_functions_notempl.cc | 24 +- tests/matrix_free/get_functions_rect.cc | 24 +- tests/matrix_free/get_functions_variants.cc | 3 +- .../matrix_free/get_functions_variants_gl.cc | 3 +- tests/matrix_free/get_values_plain.cc | 9 +- tests/matrix_free/integrate_functions.cc | 10 +- .../integrate_functions_multife.cc | 27 +- .../integrate_functions_multife2.cc | 22 +- .../interpolate_functions_common.h | 7 +- tests/matrix_free/interpolate_to_mg.cc | 24 +- tests/matrix_free/inverse_mass_01.cc | 3 +- tests/matrix_free/inverse_mass_02.cc | 3 +- tests/matrix_free/inverse_mass_03.cc | 3 +- tests/matrix_free/laplace_operator_01.cc | 28 +- tests/matrix_free/laplace_operator_02.cc | 29 +- tests/matrix_free/mass_operator_01.cc | 23 +- tests/matrix_free/mass_operator_02.cc | 23 +- tests/matrix_free/mass_operator_03.cc | 17 +- tests/matrix_free/mass_operator_04.cc | 6 +- tests/matrix_free/matrix_vector_02.cc | 6 +- tests/matrix_free/matrix_vector_03.cc | 6 +- tests/matrix_free/matrix_vector_06.cc | 6 +- tests/matrix_free/matrix_vector_06_notempl.cc | 6 +- tests/matrix_free/matrix_vector_07.cc | 6 +- tests/matrix_free/matrix_vector_08.cc | 6 +- tests/matrix_free/matrix_vector_09.cc | 6 +- tests/matrix_free/matrix_vector_10.cc | 23 +- tests/matrix_free/matrix_vector_11.cc | 6 +- tests/matrix_free/matrix_vector_12.cc | 41 +- tests/matrix_free/matrix_vector_13.cc | 29 +- tests/matrix_free/matrix_vector_15.cc | 17 +- tests/matrix_free/matrix_vector_16.cc | 22 +- tests/matrix_free/matrix_vector_17.cc | 6 +- tests/matrix_free/matrix_vector_18.cc | 14 +- tests/matrix_free/matrix_vector_19.cc | 23 +- tests/matrix_free/matrix_vector_20.cc | 34 +- tests/matrix_free/matrix_vector_21.cc | 29 +- tests/matrix_free/matrix_vector_22.cc | 41 +- tests/matrix_free/matrix_vector_23.cc | 46 +- tests/matrix_free/matrix_vector_blocks.cc | 9 +- tests/matrix_free/matrix_vector_common.h | 5 +- tests/matrix_free/matrix_vector_curl.cc | 14 +- tests/matrix_free/matrix_vector_div.cc | 14 +- tests/matrix_free/matrix_vector_faces_12.cc | 30 +- .../matrix_free/matrix_vector_faces_common.h | 39 +- tests/matrix_free/matrix_vector_hp.cc | 56 +- .../matrix_vector_large_degree_02.cc | 11 +- tests/matrix_free/matrix_vector_mf.h | 13 +- tests/matrix_free/matrix_vector_mg.cc | 17 +- tests/matrix_free/matrix_vector_stokes.cc | 14 +- .../matrix_free/matrix_vector_stokes_base.cc | 5 +- .../matrix_free/matrix_vector_stokes_flux.cc | 37 +- .../matrix_vector_stokes_noflux.cc | 19 +- .../matrix_vector_stokes_notempl.cc | 19 +- .../matrix_vector_stokes_onedof.cc | 26 +- .../matrix_free/matrix_vector_stokes_qdg0.cc | 14 +- .../matrix_free/matrix_vector_stokes_qdg0b.cc | 8 +- tests/matrix_free/multigrid_dg_periodic.cc | 4 +- tests/matrix_free/multigrid_dg_sip_01.cc | 8 +- tests/matrix_free/multigrid_dg_sip_02.cc | 8 +- tests/matrix_free/no_index_initialize.cc | 6 +- tests/matrix_free/parallel_multigrid.cc | 9 +- tests/matrix_free/parallel_multigrid_02.cc | 13 +- .../parallel_multigrid_adaptive_01.cc | 18 +- .../parallel_multigrid_adaptive_02.cc | 21 +- .../parallel_multigrid_adaptive_03.cc | 23 +- .../parallel_multigrid_adaptive_04.cc | 21 +- .../parallel_multigrid_adaptive_05.cc | 18 +- .../parallel_multigrid_adaptive_06.cc | 16 +- .../parallel_multigrid_adaptive_06ref.cc | 21 +- .../parallel_multigrid_adaptive_07.cc | 38 +- tests/matrix_free/parallel_multigrid_mf.cc | 13 +- tests/matrix_free/quadrature_points.cc | 6 +- tests/matrix_free/step-37.cc | 51 +- tests/matrix_free/step-48.cc | 52 +- tests/matrix_free/step-48b.cc | 48 +- tests/matrix_free/step-48c.cc | 53 +- tests/matrix_free/stokes_computation.cc | 131 +-- tests/matrix_free/thread_correctness.cc | 6 +- tests/matrix_free/thread_correctness_hp.cc | 21 +- tests/meshworker/mesh_loop_gmg_01.cc | 9 +- tests/meshworker/mesh_loop_mpi_01.cc | 5 +- tests/meshworker/step-11-mesh_loop.cc | 70 +- tests/meshworker/step-50-mesh_loop.cc | 61 +- .../mpi/cell_weights_01_back_and_forth_01.cc | 10 +- .../mpi/cell_weights_01_back_and_forth_02.cc | 5 +- tests/mpi/condense_01.cc | 5 +- tests/mpi/constraint_matrix_condense_01.cc | 5 +- tests/mpi/constraint_matrix_set_zero_02.cc | 10 +- tests/mpi/constraints_consistent_01.cc | 10 +- tests/mpi/data_out_faces_01.cc | 15 +- tests/mpi/data_out_faces_02.cc | 5 +- tests/mpi/data_out_hdf5_02.cc | 6 +- tests/mpi/derivative_approximation_01.cc | 6 +- tests/mpi/distribute_flux_sparsity_pattern.cc | 24 +- tests/mpi/distribute_sp_01.cc | 6 +- tests/mpi/distribute_sp_02.cc | 12 +- tests/mpi/extract_boundary_dofs.cc | 5 +- tests/mpi/fe_field_function_03.cc | 5 +- tests/mpi/fe_tools_extrapolate_common.h | 9 +- tests/mpi/flux_edge_01.cc | 27 +- tests/mpi/has_active_dofs_01.cc | 22 +- tests/mpi/has_active_dofs_02.cc | 22 +- tests/mpi/has_hanging_nodes.cc | 20 +- tests/mpi/hp_step-40.cc | 56 +- tests/mpi/hp_unify_dof_indices_01.cc | 6 +- tests/mpi/interpolate_02.cc | 10 +- tests/mpi/interpolate_04.cc | 5 +- tests/mpi/interpolate_05.cc | 6 +- tests/mpi/interpolate_to_different_mesh_01.cc | 7 +- tests/mpi/interpolate_to_different_mesh_02.cc | 81 +- tests/mpi/mesh_worker_01.cc | 6 +- tests/mpi/muelu_periodicity.cc | 69 +- tests/mpi/multigrid_adaptive.cc | 43 +- tests/mpi/multigrid_uniform.cc | 43 +- tests/mpi/no_flux_constraints.cc | 5 +- tests/mpi/no_flux_constraints_02.cc | 5 +- tests/mpi/no_flux_constraints_03.cc | 5 +- tests/mpi/normal_flux_constraints.cc | 5 +- tests/mpi/p4est_2d_constraintmatrix_03.cc | 6 +- tests/mpi/p4est_2d_constraintmatrix_04.cc | 6 +- tests/mpi/p4est_3d_constraintmatrix_03.cc | 6 +- tests/mpi/p4est_save_02.cc | 5 +- tests/mpi/p4est_save_03.cc | 10 +- tests/mpi/p4est_save_04.cc | 5 +- tests/mpi/parallel_block_vector_01.cc | 5 +- tests/mpi/parallel_block_vector_02.cc | 5 +- tests/mpi/parallel_block_vector_04.cc | 9 +- tests/mpi/parallel_block_vector_05.cc | 6 +- tests/mpi/parallel_block_vector_06.cc | 6 +- tests/mpi/parallel_block_vector_07.cc | 6 +- tests/mpi/parallel_block_vector_08.cc | 6 +- tests/mpi/parallel_block_vector_09.cc | 6 +- tests/mpi/parallel_block_vector_10.cc | 6 +- tests/mpi/parallel_block_vector_11.cc | 6 +- tests/mpi/parallel_block_vector_12.cc | 6 +- tests/mpi/parallel_block_vector_13.cc | 5 +- tests/mpi/parallel_vector_01.cc | 5 +- tests/mpi/parallel_vector_02.cc | 5 +- tests/mpi/parallel_vector_03.cc | 5 +- tests/mpi/parallel_vector_03a.cc | 5 +- tests/mpi/parallel_vector_04.cc | 5 +- tests/mpi/parallel_vector_05.cc | 5 +- tests/mpi/parallel_vector_06.cc | 5 +- tests/mpi/parallel_vector_07.cc | 5 +- tests/mpi/parallel_vector_08.cc | 10 +- tests/mpi/parallel_vector_09.cc | 5 +- tests/mpi/parallel_vector_10.cc | 5 +- tests/mpi/parallel_vector_11.cc | 5 +- tests/mpi/parallel_vector_12.cc | 10 +- tests/mpi/parallel_vector_13.cc | 5 +- tests/mpi/parallel_vector_14.cc | 5 +- tests/mpi/parallel_vector_15.cc | 5 +- tests/mpi/parallel_vector_16.cc | 5 +- tests/mpi/parallel_vector_18.cc | 5 +- tests/mpi/parallel_vector_19.cc | 5 +- tests/mpi/parallel_vector_21.cc | 5 +- tests/mpi/parallel_vector_back_interpolate.cc | 5 +- tests/mpi/parallel_vector_interpolate.cc | 5 +- tests/mpi/periodic_neighbor_01.cc | 8 +- tests/mpi/periodicity_01.cc | 40 +- tests/mpi/periodicity_02.cc | 69 +- tests/mpi/periodicity_03.cc | 117 +-- tests/mpi/periodicity_04.cc | 5 +- tests/mpi/petsc_01.cc | 10 +- tests/mpi/petsc_bug_ghost_vector_01.cc | 39 +- tests/mpi/petsc_distribute_01_block.cc | 22 +- tests/mpi/petsc_locally_owned_elements.cc | 6 +- tests/mpi/point_value_01.cc | 6 +- .../refine_and_coarsen_fixed_fraction_01.cc | 6 +- .../refine_and_coarsen_fixed_fraction_02.cc | 6 +- .../refine_and_coarsen_fixed_fraction_03.cc | 6 +- .../refine_and_coarsen_fixed_fraction_04.cc | 6 +- .../refine_and_coarsen_fixed_fraction_05.cc | 6 +- .../refine_and_coarsen_fixed_fraction_06.cc | 6 +- .../refine_and_coarsen_fixed_fraction_07.cc | 6 +- .../mpi/refine_and_coarsen_fixed_number_01.cc | 6 +- .../mpi/refine_and_coarsen_fixed_number_02.cc | 6 +- .../mpi/refine_and_coarsen_fixed_number_03.cc | 6 +- .../mpi/refine_and_coarsen_fixed_number_04.cc | 6 +- .../mpi/refine_and_coarsen_fixed_number_05.cc | 6 +- .../mpi/refine_and_coarsen_fixed_number_07.cc | 6 +- tests/mpi/renumber_cuthill_mckee.cc | 35 +- tests/mpi/renumber_cuthill_mckee_02.cc | 35 +- tests/mpi/renumber_z_order_01.cc | 5 +- tests/mpi/renumber_z_order_02.cc | 5 +- tests/mpi/renumber_z_order_04.cc | 6 +- tests/mpi/solution_transfer_01.cc | 5 +- tests/mpi/step-37.cc | 55 +- tests/mpi/step-39-block.cc | 55 +- tests/mpi/step-39.cc | 40 +- tests/mpi/step-40.cc | 56 +- tests/mpi/step-40_cuthill_mckee.cc | 67 +- tests/mpi/step-40_cuthill_mckee_MPI-subset.cc | 67 +- tests/mpi/step-40_direct_solver.cc | 40 +- tests/mpi/tria_signals_02.cc | 6 +- tests/mpi/tria_signals_03.cc | 6 +- tests/mpi/tria_signals_04.cc | 6 +- tests/mpi/tria_signals_05.cc | 6 +- tests/mpi/tria_signals_06.cc | 6 +- tests/mpi/trilinos_matvec_01.cc | 10 +- tests/mpi/trilinos_matvec_02.cc | 10 +- tests/mpi/trilinos_matvec_03.cc | 10 +- tests/mpi/trilinos_sparse_matrix_01.cc | 5 +- tests/mpi/trilinos_sparse_matrix_02.cc | 5 +- tests/mpi/trilinos_sparse_matrix_03.cc | 5 +- tests/mpi/trilinos_sparse_matrix_04.cc | 5 +- tests/mpi/trilinos_sparse_matrix_05.cc | 5 +- tests/mpi/trilinos_sparse_matrix_mmult_01.cc | 5 +- tests/mpi/trilinos_sparse_matrix_print_01.cc | 5 +- tests/multigrid/constrained_dofs_03.cc | 5 +- tests/multigrid/events_01.cc | 51 +- tests/multigrid/interface_matrix_entry_01.cc | 11 +- tests/multigrid/mg_coarse_01.cc | 57 +- tests/multigrid/mg_renumbered_01.cc | 37 +- tests/multigrid/mg_renumbered_02.cc | 17 +- tests/multigrid/mg_renumbered_03.cc | 14 +- tests/multigrid/smoother_block.cc | 3 +- tests/multigrid/step-16-02.cc | 30 +- tests/multigrid/step-16-03.cc | 50 +- tests/multigrid/step-16-04.cc | 50 +- tests/multigrid/step-16-05.cc | 32 +- tests/multigrid/step-16-06.cc | 32 +- tests/multigrid/step-16-07.cc | 48 +- .../step-16-50-mpi-linear-operator.cc | 47 +- tests/multigrid/step-16-50-mpi-smoother.cc | 47 +- tests/multigrid/step-16-50-mpi.cc | 47 +- tests/multigrid/step-16-50-serial.cc | 42 +- tests/multigrid/step-16-bdry1.cc | 25 +- tests/multigrid/step-16.cc | 48 +- tests/multigrid/step-39-02.cc | 22 +- tests/multigrid/step-39-02a.cc | 22 +- tests/multigrid/step-39-03.cc | 22 +- tests/multigrid/step-39.cc | 22 +- tests/multigrid/step-50_01.cc | 50 +- tests/multigrid/step-50_02.cc | 45 +- tests/multigrid/transfer_matrix_free_08.cc | 10 +- tests/multigrid/transfer_matrix_free_09.cc | 15 +- tests/multigrid/transfer_matrix_free_10.cc | 15 +- tests/multigrid/transfer_matrix_free_12.cc | 10 +- tests/multigrid/transfer_system_04.cc | 5 +- tests/multigrid/transfer_system_05.cc | 10 +- .../multigrid/transfer_system_adaptive_04.cc | 5 +- .../multigrid/transfer_system_adaptive_06.cc | 5 +- .../multigrid/transfer_system_adaptive_08.cc | 5 +- .../multigrid/transfer_system_adaptive_09.cc | 10 +- tests/non_matching/coupling_04.cc | 5 +- tests/non_matching/coupling_05.cc | 15 +- tests/non_matching/coupling_06.cc | 15 +- .../immersed_surface_quadrature.cc | 5 +- tests/numerics/assemble_matrix_parallel_01.cc | 67 +- tests/numerics/assemble_matrix_parallel_02.cc | 104 +-- tests/numerics/assemble_matrix_parallel_03.cc | 67 +- tests/numerics/assemble_matrix_parallel_04.cc | 104 +-- .../create_laplace_matrix_constraints_02b.cc | 6 +- .../create_mass_matrix_constraints_02b.cc | 6 +- tests/numerics/derivative_approximation_02.cc | 15 +- tests/numerics/derivative_approximation_03.cc | 15 +- tests/numerics/derivatives.cc | 5 +- tests/numerics/error_estimator.cc | 3 +- tests/numerics/error_estimator_02.cc | 11 +- tests/numerics/error_estimator_02_complex.cc | 21 +- tests/numerics/generalized_interpolation.h | 6 +- tests/numerics/kelly_crash_02.cc | 125 +-- tests/numerics/no_flux_04.cc | 9 +- tests/numerics/no_flux_10.cc | 11 +- tests/numerics/no_flux_11.cc | 6 +- tests/numerics/no_flux_12.cc | 6 +- tests/numerics/no_flux_13.cc | 6 +- tests/numerics/no_flux_hp_04.cc | 3 +- tests/numerics/normal_flux_inhom_01.cc | 5 +- tests/numerics/point_value_history_01.cc | 5 +- tests/numerics/point_value_history_02.cc | 11 +- tests/numerics/point_value_history_03.cc | 12 +- tests/numerics/project_boundary_01.cc | 6 +- tests/numerics/project_boundary_rt_01.cc | 4 +- tests/numerics/project_bv_curl_conf.cc | 3 +- tests/numerics/project_bv_curl_conf_02.cc | 3 +- tests/numerics/project_bv_div_conf.cc | 3 +- tests/numerics/project_common.h | 6 +- tests/numerics/project_parallel_common.h | 21 +- tests/numerics/project_parallel_qp_common.h | 11 +- tests/numerics/project_parallel_qpmf_common.h | 12 +- tests/numerics/project_to_surface_01.cc | 3 +- tests/numerics/project_to_surface_02.cc | 3 +- tests/numerics/subtract_mean_value_02.cc | 10 +- tests/numerics/tangential_flux_inhom_01.cc | 5 +- tests/numerics/time_dependent_01.cc | 6 +- tests/numerics/vectors_boundary_rhs_01.cc | 9 +- tests/numerics/vectors_boundary_rhs_02.cc | 9 +- tests/numerics/vectors_boundary_rhs_03.cc | 9 +- tests/numerics/vectors_point_source_01.cc | 3 +- tests/numerics/vectors_rhs_01.cc | 9 +- tests/numerics/vectors_rhs_03.cc | 9 +- tests/opencascade/create_tria_02.cc | 5 +- .../normal_to_mesh_projection_03.cc | 5 +- .../parameter_acceptor_04.cc | 7 +- .../parameter_acceptor_05.cc | 7 +- .../parameter_acceptor_06.cc | 7 +- .../parameter_acceptor_07.cc | 7 +- .../parameter_acceptor_08.cc | 8 +- .../parameter_handler/parameter_handler_1.cc | 5 +- .../parameter_handler/parameter_handler_13.cc | 11 +- .../parameter_handler_13a.cc | 12 +- .../parameter_handler_1_exception.cc | 5 +- .../parameter_handler_1_include.cc | 5 +- .../parameter_handler_1_include_fail.cc | 5 +- .../parameter_handler/parameter_handler_2.cc | 5 +- .../parameter_handler/parameter_handler_21.cc | 15 +- .../parameter_handler_2_read_from_string.cc | 5 +- .../parameter_handler/parameter_handler_4a.cc | 26 +- .../parameter_handler_4a_with_alias.cc | 26 +- ...ameter_handler_4a_with_alias_deprecated.cc | 26 +- .../parameter_handler/parameter_handler_8.cc | 32 +- .../parameter_handler/parameter_handler_9.cc | 32 +- .../parameter_handler_action_01.cc | 5 +- .../parameter_handler_action_02.cc | 5 +- .../parameter_handler_backslash_05.cc | 10 +- .../parameter_handler_read_json.cc | 12 +- .../parameter_handler_read_xml.cc | 12 +- .../parameter_handler_read_xml_error_01.cc | 12 +- .../parameter_handler_read_xml_error_02.cc | 12 +- .../parameter_handler_read_xml_error_03.cc | 12 +- .../parameter_handler_read_xml_error_04.cc | 12 +- .../parameter_handler_write_json.cc | 12 +- .../parameter_handler_write_section_1.cc | 12 +- .../parameter_handler_write_section_2.cc | 12 +- .../parameter_handler_write_section_xml.cc | 12 +- .../parameter_handler_write_xml.cc | 12 +- tests/parameter_handler/patterns_03.cc | 6 +- tests/parameter_handler/patterns_10.cc | 8 +- tests/parameter_handler/patterns_12.cc | 5 +- tests/parameter_handler/save_flags.cc | 12 +- tests/parameter_handler/write_latex_01.cc | 10 +- tests/particles/particle_04.cc | 5 +- tests/particles/particle_05.cc | 5 +- tests/particles/particle_06.cc | 5 +- tests/particles/particle_handler_01.cc | 11 +- tests/particles/particle_handler_02.cc | 24 +- tests/particles/particle_handler_03.cc | 22 +- tests/particles/particle_handler_04.cc | 22 +- tests/particles/particle_handler_05.cc | 10 +- tests/petsc/block_vector_iterator_03.cc | 11 +- tests/petsc/copy_to_dealvec.cc | 5 +- tests/petsc/copy_to_dealvec_block.cc | 10 +- tests/petsc/deal_solver_01.cc | 6 +- tests/petsc/deal_solver_02.cc | 6 +- tests/petsc/deal_solver_03.cc | 6 +- tests/petsc/deal_solver_04.cc | 6 +- tests/petsc/deal_solver_05.cc | 6 +- tests/petsc/matrix_out_03.cc | 5 +- tests/petsc/petsc_mf_testmatrix.h | 8 +- tests/petsc/solver_01.cc | 6 +- tests/petsc/solver_02.cc | 6 +- tests/petsc/solver_03.cc | 6 +- tests/petsc/solver_03_mf.cc | 6 +- .../petsc/solver_03_precondition_boomeramg.cc | 6 +- ...ver_03_precondition_boomeramg_symmetric.cc | 6 +- .../petsc/solver_03_precondition_eisenstat.cc | 6 +- tests/petsc/solver_03_precondition_icc.cc | 6 +- tests/petsc/solver_03_precondition_ilu.cc | 6 +- tests/petsc/solver_03_precondition_lu.cc | 6 +- .../petsc/solver_03_precondition_parasails.cc | 6 +- tests/petsc/solver_03_precondition_sor.cc | 6 +- tests/petsc/solver_03_precondition_ssor.cc | 6 +- tests/petsc/solver_04.cc | 6 +- tests/petsc/solver_05.cc | 6 +- tests/petsc/solver_06.cc | 6 +- tests/petsc/solver_07.cc | 6 +- tests/petsc/solver_08.cc | 6 +- tests/petsc/solver_09.cc | 6 +- tests/petsc/solver_10.cc | 6 +- tests/petsc/solver_11.cc | 6 +- tests/petsc/solver_12.cc | 12 +- tests/petsc/solver_13.cc | 12 +- tests/petsc_complex/09.cc | 8 +- tests/petsc_complex/element_access_00.cc | 8 +- tests/petsc_complex/fe_get_function_values.cc | 20 +- .../parallel_sparse_matrix_01.cc | 11 +- tests/petsc_complex/solver_real_01.cc | 6 +- tests/petsc_complex/solver_real_02.cc | 6 +- tests/physics/elasticity-kinematics_01.cc | 44 +- tests/physics/notation-kelvin_02.cc | 5 +- tests/physics/step-18-rotation_matrix.cc | 69 +- tests/physics/step-18.cc | 69 +- ...-standard_tensors-material_push_forward.cc | 279 ++++--- .../step-44-standard_tensors-spatial.cc | 277 ++++--- tests/physics/step-44.cc | 277 ++++--- tests/physics/transformations-rotations_01.cc | 5 +- tests/quick_tests/arpack.cc | 7 +- tests/quick_tests/cuda.cu | 12 +- tests/quick_tests/step-petsc.cc | 4 +- tests/quick_tests/step-slepc.cc | 6 +- tests/quick_tests/step-trilinos.cc | 4 +- tests/quick_tests/step.cc | 40 +- tests/quick_tests/sundials-ida.cc | 16 +- tests/scalapack/scalapack_04.cc | 6 +- tests/scalapack/scalapack_05.cc | 6 +- tests/scalapack/scalapack_07.cc | 5 +- tests/scalapack/scalapack_08.cc | 12 +- tests/scalapack/scalapack_11.cc | 6 +- tests/scalapack/scalapack_12_a.cc | 5 +- tests/scalapack/scalapack_12_b.cc | 5 +- tests/scalapack/scalapack_12_c.cc | 5 +- tests/scalapack/scalapack_12_d.cc | 5 +- tests/scalapack/scalapack_13_a.cc | 5 +- tests/scalapack/scalapack_13_b.cc | 5 +- tests/scalapack/scalapack_15.cc | 5 +- tests/scalapack/scalapack_15_a.cc | 5 +- tests/serialization/dof_handler_01.cc | 6 +- tests/serialization/parameter_handler.cc | 18 +- tests/serialization/particle_handler_01.cc | 10 +- tests/sharedtria/tria_multigrid_01.cc | 6 +- tests/slepc/solve_01.cc | 11 +- tests/slepc/solve_04.cc | 41 +- tests/slepc/step-36_parallel.cc | 70 +- tests/slepc/step-36_parallel_02.cc | 70 +- tests/slepc/step-36_parallel_03.cc | 76 +- tests/slepc/testmatrix.h | 9 +- tests/sparsity/sparsity_pattern.cc | 12 +- tests/sparsity/sparsity_pattern_common.h | 30 +- tests/sundials/copy_01.cc | 8 +- tests/sundials/harmonic_oscillator_01.cc | 18 +- tests/tensors/symmetric_tensor_02.cc | 8 +- tests/tensors/symmetric_tensor_15.cc | 5 +- tests/tensors/symmetric_tensor_17.cc | 8 +- tests/tensors/symmetric_tensor_35.cc | 30 +- tests/tensors/symmetric_tensor_37.cc | 5 +- tests/tensors/tensor_25.cc | 13 +- tests/tensors/tensor_accessors_04.cc | 5 +- tests/testmatrix.h | 4 +- tests/tests.h | 6 +- tests/trilinos/64.cc | 8 +- tests/trilinos/assemble_matrix_parallel_01.cc | 76 +- tests/trilinos/assemble_matrix_parallel_02.cc | 52 +- tests/trilinos/assemble_matrix_parallel_03.cc | 52 +- tests/trilinos/assemble_matrix_parallel_04.cc | 52 +- tests/trilinos/assemble_matrix_parallel_05.cc | 57 +- tests/trilinos/assemble_matrix_parallel_06.cc | 52 +- tests/trilinos/assemble_matrix_parallel_07.cc | 52 +- tests/trilinos/block_vector_iterator_03.cc | 11 +- tests/trilinos/copy_to_dealvec.cc | 5 +- tests/trilinos/copy_to_dealvec_block.cc | 10 +- tests/trilinos/deal_solver_01.cc | 6 +- tests/trilinos/deal_solver_02.cc | 6 +- tests/trilinos/deal_solver_03.cc | 6 +- tests/trilinos/deal_solver_04.cc | 6 +- tests/trilinos/deal_solver_05.cc | 6 +- tests/trilinos/deal_solver_06.cc | 6 +- tests/trilinos/direct_solver.cc | 16 +- tests/trilinos/direct_solver_2.cc | 52 +- tests/trilinos/direct_solver_3.cc | 61 +- tests/trilinos/elide_zeros.cc | 18 +- tests/trilinos/n_nonzeros_02.cc | 14 +- tests/trilinos/n_nonzeros_02_parallel.cc | 14 +- .../trilinos/parallel_block_vector_copy_01.cc | 7 +- tests/trilinos/precondition.cc | 16 +- tests/trilinos/precondition_amg_dgp.cc | 9 +- tests/trilinos/precondition_amg_smoother.cc | 16 +- tests/trilinos/precondition_muelu_dgp.cc | 9 +- tests/trilinos/precondition_muelu_q_iso_q1.cc | 27 +- tests/trilinos/precondition_muelu_smoother.cc | 16 +- tests/trilinos/precondition_q_iso_q1.cc | 27 +- tests/trilinos/renumbering_01.cc | 20 +- tests/trilinos/solver_03.cc | 6 +- tests/trilinos/solver_05.cc | 6 +- tests/trilinos/solver_07.cc | 6 +- tests/trilinos/solver_control_01.cc | 12 +- tests/trilinos/solver_control_02.cc | 18 +- tests/trilinos/solver_control_03.cc | 12 +- tests/trilinos/solver_control_06.cc | 75 +- tests/trilinos/subtract_mean_value_04.cc | 5 +- .../trilinos/trilinos_sparsity_pattern_02.cc | 17 +- .../trilinos/trilinos_sparsity_pattern_05.cc | 12 +- tests/vector/complex_vector_21_negative.cc | 12 +- tests/vector_tools/boundaries.cc | 3 +- tests/vector_tools/boundaries_complex.cc | 8 +- tests/vector_tools/boundaries_complex_hp.cc | 8 +- tests/vector_tools/integrate_difference_01.cc | 3 +- .../integrate_difference_01_complex_01.cc | 3 +- .../integrate_difference_01_complex_02.cc | 3 +- .../integrate_difference_01_complex_03.cc | 3 +- tests/vector_tools/integrate_difference_02.cc | 3 +- tests/vector_tools/integrate_difference_03.cc | 3 +- tests/vector_tools/integrate_difference_04.cc | 3 +- .../integrate_difference_04_hp.cc | 3 +- .../integrate_difference_04_hp_02.cc | 3 +- tests/vector_tools/integrate_difference_05.cc | 3 +- tests/zoltan/zoltan_01.cc | 5 +- 1578 files changed, 25233 insertions(+), 20009 deletions(-) diff --git a/examples/doxygen/theta_timestepping.cc b/examples/doxygen/theta_timestepping.cc index 11a428ddc1..b920bced2b 100644 --- a/examples/doxygen/theta_timestepping.cc +++ b/examples/doxygen/theta_timestepping.cc @@ -81,7 +81,8 @@ int main() } -Explicit::Explicit(const FullMatrix &M) : matrix(&M) +Explicit::Explicit(const FullMatrix &M) + : matrix(&M) { m.reinit(M.m(), M.n()); } @@ -103,7 +104,8 @@ void Explicit::operator()(AnyData &out, const AnyData &in) } -Implicit::Implicit(const FullMatrix &M) : matrix(&M) +Implicit::Implicit(const FullMatrix &M) + : matrix(&M) { m.reinit(M.m(), M.n()); } diff --git a/examples/step-10/step-10.cc b/examples/step-10/step-10.cc index 1b93704371..db6ed8ff5d 100644 --- a/examples/step-10/step-10.cc +++ b/examples/step-10/step-10.cc @@ -343,9 +343,11 @@ namespace Step10 // Then we create a FEFaceValues object instead of a FEValues object // as in the previous function. Again, we pass a mapping as first // argument. - FEFaceValues fe_face_values( - mapping, fe, quadrature, update_JxW_values); - ConvergenceTable table; + FEFaceValues fe_face_values(mapping, + fe, + quadrature, + update_JxW_values); + ConvergenceTable table; for (unsigned int refinement = 0; refinement < 6; ++refinement, triangulation.refine_global(1)) diff --git a/examples/step-11/step-11.cc b/examples/step-11/step-11.cc index 5c68388fa8..5c81e3db2d 100644 --- a/examples/step-11/step-11.cc +++ b/examples/step-11/step-11.cc @@ -106,10 +106,10 @@ namespace Step11 // denotes the polynomial degree), and mappings of given order. Print to // screen what we are about to do. template - LaplaceProblem::LaplaceProblem(const unsigned int mapping_degree) : - fe(1), - dof_handler(triangulation), - mapping(mapping_degree) + LaplaceProblem::LaplaceProblem(const unsigned int mapping_degree) + : fe(1) + , dof_handler(triangulation) + , mapping(mapping_degree) { std::cout << "Using mapping with degree " << mapping_degree << ":" << std::endl @@ -148,8 +148,9 @@ namespace Step11 // whose every element equals true when one just default // constructs such an object, so this is what we'll do here. std::vector boundary_dofs(dof_handler.n_dofs(), false); - DoFTools::extract_boundary_dofs( - dof_handler, ComponentMask(), boundary_dofs); + DoFTools::extract_boundary_dofs(dof_handler, + ComponentMask(), + boundary_dofs); // Now first for the generation of the constraints: as mentioned in the // introduction, we constrain one of the nodes on the boundary by the @@ -263,11 +264,14 @@ namespace Step11 // side function. // // Let us look at the way the matrix and body forces are integrated: - const unsigned int gauss_degree = std::max( - static_cast(std::ceil(1. * (mapping.get_degree() + 1) / 2)), - 2U); - MatrixTools::create_laplace_matrix( - mapping, dof_handler, QGauss(gauss_degree), system_matrix); + const unsigned int gauss_degree = + std::max(static_cast( + std::ceil(1. * (mapping.get_degree() + 1) / 2)), + 2U); + MatrixTools::create_laplace_matrix(mapping, + dof_handler, + QGauss(gauss_degree), + system_matrix); VectorTools::create_right_hand_side(mapping, dof_handler, QGauss(gauss_degree), @@ -363,8 +367,10 @@ namespace Step11 // Then, the function just called returns its results as a vector of // values each of which denotes the norm on one cell. To get the global // norm, we do the following: - const double norm = VectorTools::compute_global_error( - triangulation, norm_per_cell, VectorTools::H1_seminorm); + const double norm = + VectorTools::compute_global_error(triangulation, + norm_per_cell, + VectorTools::H1_seminorm); // Last task -- generate output: output_table.add_value("cells", triangulation.n_active_cells()); diff --git a/examples/step-12/step-12.cc b/examples/step-12/step-12.cc index ddea7f92c9..3f4b85c354 100644 --- a/examples/step-12/step-12.cc +++ b/examples/step-12/step-12.cc @@ -219,10 +219,10 @@ namespace Step12 // We start with the constructor. The 1 in the constructor call of // fe is the polynomial degree. template - AdvectionProblem::AdvectionProblem() : - mapping(), - fe(1), - dof_handler(triangulation) + AdvectionProblem::AdvectionProblem() + : mapping() + , fe(1) + , dof_handler(triangulation) {} @@ -277,8 +277,9 @@ namespace Step12 // used. Since the quadratures for cells, boundary and interior faces can // be selected independently, we have to hand over this value three times. const unsigned int n_gauss_points = dof_handler.get_fe().degree + 1; - info_box.initialize_gauss_quadrature( - n_gauss_points, n_gauss_points, n_gauss_points); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points, + n_gauss_points); // These are the types of values we need for integrating our system. They // are added to the flags used on cells, boundary and interior faces, as @@ -547,8 +548,10 @@ namespace Step12 Vector gradient_indicator(triangulation.n_active_cells()); // Now the approximate gradients are computed - DerivativeApproximation::approximate_gradient( - mapping, dof_handler, solution, gradient_indicator); + DerivativeApproximation::approximate_gradient(mapping, + dof_handler, + solution, + gradient_indicator); // and they are cell-wise scaled by the factor $h^{1+d/2}$ typename DoFHandler::active_cell_iterator cell = @@ -559,8 +562,10 @@ namespace Step12 std::pow(cell->diameter(), 1 + 1.0 * dim / 2); // Finally they serve as refinement indicator. - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, gradient_indicator, 0.3, 0.1); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + gradient_indicator, + 0.3, + 0.1); triangulation.execute_coarsening_and_refinement(); } diff --git a/examples/step-13/step-13.cc b/examples/step-13/step-13.cc index 5850155fc1..6dd3566ef3 100644 --- a/examples/step-13/step-13.cc +++ b/examples/step-13/step-13.cc @@ -199,9 +199,9 @@ namespace Step13 template PointValueEvaluation::PointValueEvaluation( const Point &evaluation_point, - TableHandler & results_table) : - evaluation_point(evaluation_point), - results_table(results_table) + TableHandler & results_table) + : evaluation_point(evaluation_point) + , results_table(results_table) {} @@ -383,9 +383,9 @@ namespace Step13 template SolutionOutput::SolutionOutput( const std::string & output_name_base, - const DataOutBase::OutputFormat output_format) : - output_name_base(output_name_base), - output_format(output_format) + const DataOutBase::OutputFormat output_format) + : output_name_base(output_name_base) + , output_format(output_format) {} @@ -523,8 +523,8 @@ namespace Step13 // The implementation of the only two non-abstract functions is then // rather boring: template - Base::Base(Triangulation &coarse_grid) : - triangulation(&coarse_grid) + Base::Base(Triangulation &coarse_grid) + : triangulation(&coarse_grid) {} @@ -671,12 +671,12 @@ namespace Step13 Solver::Solver(Triangulation & triangulation, const FiniteElement &fe, const Quadrature & quadrature, - const Function & boundary_values) : - Base(triangulation), - fe(&fe), - quadrature(&quadrature), - dof_handler(triangulation), - boundary_values(&boundary_values) + const Function & boundary_values) + : Base(triangulation) + , fe(&fe) + , quadrature(&quadrature) + , dof_handler(triangulation) + , boundary_values(&boundary_values) {} @@ -883,8 +883,10 @@ namespace Step13 // expression to a function pointer type that is specific to the // version of the function that you want to call on the task.) std::map boundary_value_map; - VectorTools::interpolate_boundary_values( - dof_handler, 0, *boundary_values, boundary_value_map); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + *boundary_values, + boundary_value_map); rhs_task.join(); linear_system.hanging_node_constraints.condense(linear_system.rhs); @@ -892,8 +894,10 @@ namespace Step13 // Now that we have the complete linear system, we can also // treat boundary values, which need to be eliminated from both // the matrix and the right hand side: - MatrixTools::apply_boundary_values( - boundary_value_map, linear_system.matrix, solution, linear_system.rhs); + MatrixTools::apply_boundary_values(boundary_value_map, + linear_system.matrix, + solution, + linear_system.rhs); } @@ -904,17 +908,17 @@ namespace Step13 template Solver::AssemblyScratchData::AssemblyScratchData( const FiniteElement &fe, - const Quadrature & quadrature) : - fe_values(fe, quadrature, update_gradients | update_JxW_values) + const Quadrature & quadrature) + : fe_values(fe, quadrature, update_gradients | update_JxW_values) {} template Solver::AssemblyScratchData::AssemblyScratchData( - const AssemblyScratchData &scratch_data) : - fe_values(scratch_data.fe_values.get_fe(), - scratch_data.fe_values.get_quadrature(), - update_gradients | update_JxW_values) + const AssemblyScratchData &scratch_data) + : fe_values(scratch_data.fe_values.get_fe(), + scratch_data.fe_values.get_quadrature(), + update_gradients | update_JxW_values) {} @@ -1081,10 +1085,10 @@ namespace Step13 const FiniteElement &fe, const Quadrature & quadrature, const Function & rhs_function, - const Function & boundary_values) : - Base(triangulation), - Solver(triangulation, fe, quadrature, boundary_values), - rhs_function(&rhs_function) + const Function & boundary_values) + : Base(triangulation) + , Solver(triangulation, fe, quadrature, boundary_values) + , rhs_function(&rhs_function) {} @@ -1170,13 +1174,13 @@ namespace Step13 const FiniteElement &fe, const Quadrature & quadrature, const Function & rhs_function, - const Function & boundary_values) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - fe, - quadrature, - rhs_function, - boundary_values) + const Function & boundary_values) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + fe, + quadrature, + rhs_function, + boundary_values) {} @@ -1215,18 +1219,17 @@ namespace Step13 template - RefinementKelly::RefinementKelly( - Triangulation & coarse_grid, - const FiniteElement &fe, - const Quadrature & quadrature, - const Function & rhs_function, - const Function & boundary_values) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - fe, - quadrature, - rhs_function, - boundary_values) + RefinementKelly::RefinementKelly(Triangulation & coarse_grid, + const FiniteElement &fe, + const Quadrature & quadrature, + const Function &rhs_function, + const Function &boundary_values) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + fe, + quadrature, + rhs_function, + boundary_values) {} @@ -1241,8 +1244,10 @@ namespace Step13 typename FunctionMap::type(), this->solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - *this->triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(*this->triangulation, + estimated_error_per_cell, + 0.3, + 0.03); this->triangulation->execute_coarsening_and_refinement(); } @@ -1274,7 +1279,8 @@ namespace Step13 class Solution : public Function { public: - Solution() : Function() + Solution() + : Function() {} virtual double value(const Point & p, @@ -1299,7 +1305,8 @@ namespace Step13 class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double value(const Point & p, @@ -1443,8 +1450,9 @@ namespace Step13 results_table); // Also generate an evaluator which writes out the solution: - Evaluation::SolutionOutput postprocessor2( - std::string("solution-") + solver_name, DataOutBase::gnuplot); + Evaluation::SolutionOutput postprocessor2(std::string("solution-") + + solver_name, + DataOutBase::gnuplot); // Take these two evaluation objects and put them in a list... std::list *> postprocessor_list; diff --git a/examples/step-14/step-14.cc b/examples/step-14/step-14.cc index f3a112f5ef..34c3db408c 100644 --- a/examples/step-14/step-14.cc +++ b/examples/step-14/step-14.cc @@ -124,8 +124,8 @@ namespace Step14 template PointValueEvaluation::PointValueEvaluation( - const Point &evaluation_point) : - evaluation_point(evaluation_point) + const Point &evaluation_point) + : evaluation_point(evaluation_point) {} @@ -196,8 +196,8 @@ namespace Step14 template PointXDerivativeEvaluation::PointXDerivativeEvaluation( - const Point &evaluation_point) : - evaluation_point(evaluation_point) + const Point &evaluation_point) + : evaluation_point(evaluation_point) {} @@ -325,8 +325,8 @@ namespace Step14 template - GridOutput::GridOutput(const std::string &output_name_base) : - output_name_base(output_name_base) + GridOutput::GridOutput(const std::string &output_name_base) + : output_name_base(output_name_base) {} @@ -381,9 +381,9 @@ namespace Step14 template - Base::Base(Triangulation &coarse_grid) : - triangulation(&coarse_grid), - refinement_cycle(numbers::invalid_unsigned_int) + Base::Base(Triangulation &coarse_grid) + : triangulation(&coarse_grid) + , refinement_cycle(numbers::invalid_unsigned_int) {} @@ -485,13 +485,13 @@ namespace Step14 const FiniteElement & fe, const Quadrature & quadrature, const Quadrature &face_quadrature, - const Function & boundary_values) : - Base(triangulation), - fe(&fe), - quadrature(&quadrature), - face_quadrature(&face_quadrature), - dof_handler(triangulation), - boundary_values(&boundary_values) + const Function & boundary_values) + : Base(triangulation) + , fe(&fe) + , quadrature(&quadrature) + , face_quadrature(&face_quadrature) + , dof_handler(triangulation) + , boundary_values(&boundary_values) {} @@ -553,31 +553,35 @@ namespace Step14 linear_system.hanging_node_constraints.condense(linear_system.matrix); std::map boundary_value_map; - VectorTools::interpolate_boundary_values( - dof_handler, 0, *boundary_values, boundary_value_map); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + *boundary_values, + boundary_value_map); rhs_task.join(); linear_system.hanging_node_constraints.condense(linear_system.rhs); - MatrixTools::apply_boundary_values( - boundary_value_map, linear_system.matrix, solution, linear_system.rhs); + MatrixTools::apply_boundary_values(boundary_value_map, + linear_system.matrix, + solution, + linear_system.rhs); } template Solver::AssemblyScratchData::AssemblyScratchData( const FiniteElement &fe, - const Quadrature & quadrature) : - fe_values(fe, quadrature, update_gradients | update_JxW_values) + const Quadrature & quadrature) + : fe_values(fe, quadrature, update_gradients | update_JxW_values) {} template Solver::AssemblyScratchData::AssemblyScratchData( - const AssemblyScratchData &scratch_data) : - fe_values(scratch_data.fe_values.get_fe(), - scratch_data.fe_values.get_quadrature(), - update_gradients | update_JxW_values) + const AssemblyScratchData &scratch_data) + : fe_values(scratch_data.fe_values.get_fe(), + scratch_data.fe_values.get_quadrature(), + update_gradients | update_JxW_values) {} @@ -736,14 +740,14 @@ namespace Step14 const Quadrature & quadrature, const Quadrature &face_quadrature, const Function & rhs_function, - const Function &boundary_values) : - Base(triangulation), - Solver(triangulation, - fe, - quadrature, - face_quadrature, - boundary_values), - rhs_function(&rhs_function) + const Function & boundary_values) + : Base(triangulation) + , Solver(triangulation, + fe, + quadrature, + face_quadrature, + boundary_values) + , rhs_function(&rhs_function) {} @@ -830,14 +834,14 @@ namespace Step14 const Quadrature & quadrature, const Quadrature &face_quadrature, const Function & rhs_function, - const Function & boundary_values) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - fe, - quadrature, - face_quadrature, - rhs_function, - boundary_values) + const Function & boundary_values) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + fe, + quadrature, + face_quadrature, + rhs_function, + boundary_values) {} @@ -873,14 +877,14 @@ namespace Step14 const Quadrature & quadrature, const Quadrature &face_quadrature, const Function & rhs_function, - const Function & boundary_values) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - fe, - quadrature, - face_quadrature, - rhs_function, - boundary_values) + const Function & boundary_values) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + fe, + quadrature, + face_quadrature, + rhs_function, + boundary_values) {} @@ -895,8 +899,10 @@ namespace Step14 typename FunctionMap::type(), this->solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - *this->triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(*this->triangulation, + estimated_error_per_cell, + 0.3, + 0.03); this->triangulation->execute_coarsening_and_refinement(); } @@ -942,15 +948,15 @@ namespace Step14 const Quadrature &face_quadrature, const Function & rhs_function, const Function & boundary_values, - const Function & weighting_function) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - fe, - quadrature, - face_quadrature, - rhs_function, - boundary_values), - weighting_function(&weighting_function) + const Function & weighting_function) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + fe, + quadrature, + face_quadrature, + rhs_function, + boundary_values) + , weighting_function(&weighting_function) {} @@ -987,8 +993,10 @@ namespace Step14 estimated_error_per_cell(cell->active_cell_index()) *= weighting_function->value(cell->center()); - GridRefinement::refine_and_coarsen_fixed_number( - *this->triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(*this->triangulation, + estimated_error_per_cell, + 0.3, + 0.03); this->triangulation->execute_coarsening_and_refinement(); } @@ -1144,7 +1152,8 @@ namespace Step14 class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double value(const Point & p, @@ -1155,7 +1164,8 @@ namespace Step14 class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double value(const Point & p, @@ -1237,7 +1247,8 @@ namespace Step14 class RightHandSide : public Functions::ConstantFunction { public: - RightHandSide() : Functions::ConstantFunction(1.) + RightHandSide() + : Functions::ConstantFunction(1.) {} }; @@ -1456,8 +1467,8 @@ namespace Step14 template PointValueEvaluation::PointValueEvaluation( - const Point &evaluation_point) : - evaluation_point(evaluation_point) + const Point &evaluation_point) + : evaluation_point(evaluation_point) {} @@ -1535,8 +1546,8 @@ namespace Step14 template PointXDerivativeEvaluation::PointXDerivativeEvaluation( - const Point &evaluation_point) : - evaluation_point(evaluation_point) + const Point &evaluation_point) + : evaluation_point(evaluation_point) {} @@ -1683,14 +1694,14 @@ namespace Step14 const FiniteElement & fe, const Quadrature & quadrature, const Quadrature & face_quadrature, - const DualFunctional::DualFunctionalBase &dual_functional) : - Base(triangulation), - Solver(triangulation, - fe, - quadrature, - face_quadrature, - boundary_values), - dual_functional(&dual_functional) + const DualFunctional::DualFunctionalBase &dual_functional) + : Base(triangulation) + , Solver(triangulation, + fe, + quadrature, + face_quadrature, + boundary_values) + , dual_functional(&dual_functional) {} @@ -1905,31 +1916,31 @@ namespace Step14 WeightedResidual::CellData::CellData( const FiniteElement &fe, const Quadrature & quadrature, - const Function & right_hand_side) : - fe_values(fe, - quadrature, - update_values | update_hessians | update_quadrature_points | - update_JxW_values), - right_hand_side(&right_hand_side), - cell_residual(quadrature.size()), - rhs_values(quadrature.size()), - dual_weights(quadrature.size()), - cell_laplacians(quadrature.size()) + const Function & right_hand_side) + : fe_values(fe, + quadrature, + update_values | update_hessians | update_quadrature_points | + update_JxW_values) + , right_hand_side(&right_hand_side) + , cell_residual(quadrature.size()) + , rhs_values(quadrature.size()) + , dual_weights(quadrature.size()) + , cell_laplacians(quadrature.size()) {} template - WeightedResidual::CellData::CellData(const CellData &cell_data) : - fe_values(cell_data.fe_values.get_fe(), - cell_data.fe_values.get_quadrature(), - update_values | update_hessians | update_quadrature_points | - update_JxW_values), - right_hand_side(cell_data.right_hand_side), - cell_residual(cell_data.cell_residual), - rhs_values(cell_data.rhs_values), - dual_weights(cell_data.dual_weights), - cell_laplacians(cell_data.cell_laplacians) + WeightedResidual::CellData::CellData(const CellData &cell_data) + : fe_values(cell_data.fe_values.get_fe(), + cell_data.fe_values.get_quadrature(), + update_values | update_hessians | update_quadrature_points | + update_JxW_values) + , right_hand_side(cell_data.right_hand_side) + , cell_residual(cell_data.cell_residual) + , rhs_values(cell_data.rhs_values) + , dual_weights(cell_data.dual_weights) + , cell_laplacians(cell_data.cell_laplacians) {} @@ -1937,16 +1948,16 @@ namespace Step14 template WeightedResidual::FaceData::FaceData( const FiniteElement & fe, - const Quadrature &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 &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(); @@ -1959,23 +1970,24 @@ namespace Step14 template - WeightedResidual::FaceData::FaceData(const FaceData &face_data) : - fe_face_values_cell(face_data.fe_face_values_cell.get_fe(), - face_data.fe_face_values_cell.get_quadrature(), - update_values | update_gradients | update_JxW_values | - update_normal_vectors), - fe_face_values_neighbor( - face_data.fe_face_values_neighbor.get_fe(), - face_data.fe_face_values_neighbor.get_quadrature(), - update_values | update_gradients | update_JxW_values | - update_normal_vectors), - fe_subface_values_cell(face_data.fe_subface_values_cell.get_fe(), - face_data.fe_subface_values_cell.get_quadrature(), - update_gradients), - jump_residual(face_data.jump_residual), - dual_weights(face_data.dual_weights), - cell_grads(face_data.cell_grads), - neighbor_grads(face_data.neighbor_grads) + WeightedResidual::FaceData::FaceData(const FaceData &face_data) + : fe_face_values_cell(face_data.fe_face_values_cell.get_fe(), + face_data.fe_face_values_cell.get_quadrature(), + update_values | update_gradients | + update_JxW_values | update_normal_vectors) + , fe_face_values_neighbor( + face_data.fe_face_values_neighbor.get_fe(), + face_data.fe_face_values_neighbor.get_quadrature(), + update_values | update_gradients | update_JxW_values | + update_normal_vectors) + , fe_subface_values_cell( + face_data.fe_subface_values_cell.get_fe(), + face_data.fe_subface_values_cell.get_quadrature(), + update_gradients) + , jump_residual(face_data.jump_residual) + , dual_weights(face_data.dual_weights) + , cell_grads(face_data.cell_grads) + , neighbor_grads(face_data.neighbor_grads) {} @@ -1988,21 +2000,21 @@ namespace Step14 const Quadrature &primal_face_quadrature, const Function & rhs_function, const Vector & primal_solution, - const Vector & dual_weights) : - cell_data(primal_fe, primal_quadrature, rhs_function), - face_data(primal_fe, primal_face_quadrature), - primal_solution(primal_solution), - dual_weights(dual_weights) + const Vector & dual_weights) + : cell_data(primal_fe, primal_quadrature, rhs_function) + , face_data(primal_fe, primal_face_quadrature) + , primal_solution(primal_solution) + , dual_weights(dual_weights) {} template WeightedResidual::WeightedResidualScratchData:: WeightedResidualScratchData( - const WeightedResidualScratchData &scratch_data) : - cell_data(scratch_data.cell_data), - face_data(scratch_data.face_data), - primal_solution(scratch_data.primal_solution), - dual_weights(scratch_data.dual_weights) + const WeightedResidualScratchData &scratch_data) + : cell_data(scratch_data.cell_data) + , face_data(scratch_data.face_data) + , primal_solution(scratch_data.primal_solution) + , dual_weights(scratch_data.dual_weights) {} @@ -2016,19 +2028,19 @@ namespace Step14 const Quadrature & face_quadrature, const Function & rhs_function, const Function & bv, - const DualFunctional::DualFunctionalBase &dual_functional) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - primal_fe, + const DualFunctional::DualFunctionalBase &dual_functional) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + primal_fe, + quadrature, + face_quadrature, + rhs_function, + bv) + , DualSolver(coarse_grid, + dual_fe, quadrature, face_quadrature, - rhs_function, - bv), - DualSolver(coarse_grid, - dual_fe, - quadrature, - face_quadrature, - dual_functional) + dual_functional) {} @@ -2100,8 +2112,10 @@ namespace Step14 // 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.8, 0.02); + GridRefinement::refine_and_coarsen_fixed_fraction(*this->triangulation, + error_indicators, + 0.8, + 0.02); this->triangulation->execute_coarsening_and_refinement(); } @@ -2280,8 +2294,9 @@ namespace Step14 0.5 * face_integrals[cell->face(face_no)]; } std::cout << " Estimated error=" - << std::accumulate( - error_indicators.begin(), error_indicators.end(), 0.) + << std::accumulate(error_indicators.begin(), + error_indicators.end(), + 0.) << std::endl; } @@ -2720,11 +2735,11 @@ namespace Step14 // As for the implementation, first the constructor of the parameter object, // setting all values to their defaults: template - Framework::ProblemDescription::ProblemDescription() : - primal_fe_degree(1), - dual_fe_degree(2), - refinement_criterion(dual_weighted_error_estimator), - max_degrees_of_freedom(20000) + Framework::ProblemDescription::ProblemDescription() + : primal_fe_degree(1) + , dual_fe_degree(2) + , refinement_criterion(dual_weighted_error_estimator) + , max_degrees_of_freedom(20000) {} diff --git a/examples/step-15/step-15.cc b/examples/step-15/step-15.cc index 8557ae4e2e..daf5166d6c 100644 --- a/examples/step-15/step-15.cc +++ b/examples/step-15/step-15.cc @@ -141,7 +141,8 @@ namespace Step15 class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double value(const Point & p, @@ -164,9 +165,9 @@ namespace Step15 // few tutorials. template - MinimalSurfaceProblem::MinimalSurfaceProblem() : - dof_handler(triangulation), - fe(2) + MinimalSurfaceProblem::MinimalSurfaceProblem() + : dof_handler(triangulation) + , fe(2) {} @@ -314,8 +315,9 @@ namespace Step15 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -328,10 +330,14 @@ namespace Step15 hanging_node_constraints.condense(system_rhs); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, newton_update, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + newton_update, + system_rhs); } @@ -377,8 +383,10 @@ namespace Step15 present_solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); // Then we need an additional step: if, for example, you flag a cell that // is once more refined than its neighbor, and that neighbor is not @@ -463,8 +471,10 @@ namespace Step15 void MinimalSurfaceProblem::set_boundary_values() { std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + boundary_values); for (std::map::const_iterator p = boundary_values.begin(); p != boundary_values.end(); @@ -562,8 +572,9 @@ namespace Step15 hanging_node_constraints.condense(residual); std::vector boundary_dofs(dof_handler.n_dofs()); - DoFTools::extract_boundary_dofs( - dof_handler, ComponentMask(), boundary_dofs); + DoFTools::extract_boundary_dofs(dof_handler, + ComponentMask(), + boundary_dofs); for (unsigned int i = 0; i < dof_handler.n_dofs(); ++i) if (boundary_dofs[i] == true) residual(i) = 0; diff --git a/examples/step-16/step-16.cc b/examples/step-16/step-16.cc index 387c76c8ea..3e9faf5c41 100644 --- a/examples/step-16/step-16.cc +++ b/examples/step-16/step-16.cc @@ -113,8 +113,8 @@ namespace Step16 template - LaplaceIntegrator::LaplaceIntegrator() : - MeshWorker::LocalIntegrator(true, false, false) + LaplaceIntegrator::LaplaceIntegrator() + : MeshWorker::LocalIntegrator(true, false, false) {} @@ -156,14 +156,16 @@ namespace Step16 AssertDimension(dinfo.n_matrices(), 1); const double coefficient = (dinfo.cell->center()(0) > 0.) ? .1 : 1.; - LocalIntegrators::Laplace::cell_matrix( - dinfo.matrix(0, false).matrix, info.fe_values(0), coefficient); + LocalIntegrators::Laplace::cell_matrix(dinfo.matrix(0, false).matrix, + info.fe_values(0), + coefficient); if (dinfo.n_vectors() > 0) { std::vector rhs(info.fe_values(0).n_quadrature_points, 1.); - LocalIntegrators::L2::L2( - dinfo.vector(0).block(0), info.fe_values(0), rhs); + LocalIntegrators::L2::L2(dinfo.vector(0).block(0), + info.fe_values(0), + rhs); } } @@ -242,11 +244,11 @@ namespace Step16 // Triangulation::limit_level_difference_at_vertices flag to the constructor // of the triangulation class. template - LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation(Triangulation::limit_level_difference_at_vertices), - fe(degree), - dof_handler(triangulation), - degree(degree) + LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , fe(degree) + , dof_handler(triangulation) + , degree(degree) {} @@ -578,8 +580,10 @@ namespace Step16 typename FunctionMap::type(), solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } diff --git a/examples/step-17/step-17.cc b/examples/step-17/step-17.cc index 6c8bff75d3..24c4d3390c 100644 --- a/examples/step-17/step-17.cc +++ b/examples/step-17/step-17.cc @@ -198,7 +198,8 @@ namespace Step17 template - RightHandSide::RightHandSide() : Function(dim) + RightHandSide::RightHandSide() + : Function(dim) {} @@ -262,13 +263,13 @@ namespace Step17 // the latter is determined by testing whether the process currently // executing the constructor call is the first in the MPI universe. template - ElasticProblem::ElasticProblem() : - mpi_communicator(MPI_COMM_WORLD), - n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)), - this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)), - pcout(std::cout, (this_mpi_process == 0)), - dof_handler(triangulation), - fe(FE_Q(1), dim) + ElasticProblem::ElasticProblem() + : mpi_communicator(MPI_COMM_WORLD) + , n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)) + , this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)) + , pcout(std::cout, (this_mpi_process == 0)) + , dof_handler(triangulation) + , fe(FE_Q(1), dim) {} @@ -375,8 +376,10 @@ namespace Step17 // to this process (see step-18 or step-40 for a more efficient way to // handle this). DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern( - dof_handler, dsp, hanging_node_constraints, false); + DoFTools::make_sparsity_pattern(dof_handler, + dsp, + hanging_node_constraints, + false); // Now we determine the set of locally owned DoFs and use that to // initialize parallel vectors and matrix. Since the matrix and vectors @@ -397,8 +400,10 @@ namespace Step17 const IndexSet locally_owned_dofs = locally_owned_dofs_per_proc[this_mpi_process]; - system_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, dsp, mpi_communicator); + system_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + dsp, + mpi_communicator); solution.reinit(locally_owned_dofs, mpi_communicator); system_rhs.reinit(locally_owned_dofs, mpi_communicator); @@ -602,8 +607,10 @@ namespace Step17 // we therefore do not eliminate the entries in the affected // columns. std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(dim), boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(dim), + boundary_values); MatrixTools::apply_boundary_values( boundary_values, system_matrix, solution, system_rhs, false); } @@ -830,8 +837,10 @@ namespace Step17 // does it in exactly the same way. const Vector localized_all_errors(distributed_all_errors); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, localized_all_errors, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + localized_all_errors, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } diff --git a/examples/step-18/step-18.cc b/examples/step-18/step-18.cc index 5aa2ca766c..d741d992c3 100644 --- a/examples/step-18/step-18.cc +++ b/examples/step-18/step-18.cc @@ -568,7 +568,8 @@ namespace Step18 template - BodyForce::BodyForce() : Function(dim) + BodyForce::BodyForce() + : Function(dim) {} @@ -654,11 +655,11 @@ namespace Step18 template IncrementalBoundaryValues::IncrementalBoundaryValues( const double present_time, - const double present_timestep) : - Function(dim), - velocity(.08), - present_time(present_time), - present_timestep(present_timestep) + const double present_timestep) + : Function(dim) + , velocity(.08) + , present_time(present_time) + , present_timestep(present_timestep) {} @@ -711,20 +712,20 @@ namespace Step18 // Gaussian quadrature formula with 2 points in each coordinate // direction. The destructor should be obvious: template - TopLevel::TopLevel() : - triangulation(MPI_COMM_WORLD), - fe(FE_Q(1), dim), - dof_handler(triangulation), - quadrature_formula(2), - present_time(0.0), - present_timestep(1.0), - end_time(10.0), - timestep_no(0), - mpi_communicator(MPI_COMM_WORLD), - n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)), - this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)), - pcout(std::cout, this_mpi_process == 0), - n_local_cells(numbers::invalid_unsigned_int) + TopLevel::TopLevel() + : triangulation(MPI_COMM_WORLD) + , fe(FE_Q(1), dim) + , dof_handler(triangulation) + , quadrature_formula(2) + , present_time(0.0) + , present_timestep(1.0) + , end_time(10.0) + , timestep_no(0) + , mpi_communicator(MPI_COMM_WORLD) + , n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)) + , this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)) + , pcout(std::cout, this_mpi_process == 0) + , n_local_cells(numbers::invalid_unsigned_int) {} @@ -988,10 +989,9 @@ namespace Step18 for (unsigned int j = 0; j < dofs_per_cell; ++j) for (unsigned int q_point = 0; q_point < n_q_points; ++q_point) { - const SymmetricTensor<2, dim> eps_phi_i = get_strain( - fe_values, i, q_point), - eps_phi_j = get_strain( - fe_values, j, q_point); + const SymmetricTensor<2, dim> + eps_phi_i = get_strain(fe_values, i, q_point), + eps_phi_j = get_strain(fe_values, j, q_point); cell_matrix(i, j) += (eps_phi_i * stress_strain_tensor * eps_phi_j * fe_values.JxW(q_point)); @@ -1086,8 +1086,10 @@ namespace Step18 // motion, it has only its last component set: FEValuesExtractors::Scalar z_component(dim - 1); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(dim), boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(dim), + boundary_values); VectorTools::interpolate_boundary_values( dof_handler, 1, @@ -1468,8 +1470,10 @@ namespace Step18 // Once we have that, copy it back into local copies on all processors and // refine the mesh accordingly: error_per_cell = distributed_error_per_cell; - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, error_per_cell, 0.35, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + error_per_cell, + 0.35, + 0.03); triangulation.execute_coarsening_and_refinement(); // Finally, set up quadrature point data again on the new mesh, and only @@ -1731,8 +1735,9 @@ namespace Step18 // the incremental displacements and the gradients thereof at the // quadrature points, together with a vector that will hold this // information: - FEValues fe_values( - fe, quadrature_formula, update_values | update_gradients); + FEValues fe_values(fe, + quadrature_formula, + update_values | update_gradients); std::vector>> displacement_increment_grads( quadrature_formula.size(), std::vector>(dim)); diff --git a/examples/step-20/step-20.cc b/examples/step-20/step-20.cc index 2b35edac02..17eda9bb4e 100644 --- a/examples/step-20/step-20.cc +++ b/examples/step-20/step-20.cc @@ -125,7 +125,8 @@ namespace Step20 class RightHandSide : public Function { public: - RightHandSide() : Function(1) + RightHandSide() + : Function(1) {} virtual double value(const Point & p, @@ -138,7 +139,8 @@ namespace Step20 class PressureBoundaryValues : public Function { public: - PressureBoundaryValues() : Function(1) + PressureBoundaryValues() + : Function(1) {} virtual double value(const Point & p, @@ -150,7 +152,8 @@ namespace Step20 class ExactSolution : public Function { public: - ExactSolution() : Function(dim + 1) + ExactSolution() + : Function(dim + 1) {} virtual void vector_value(const Point &p, @@ -231,7 +234,8 @@ namespace Step20 class KInverse : public TensorFunction<2, dim> { public: - KInverse() : TensorFunction<2, dim>() + KInverse() + : TensorFunction<2, dim>() {} virtual void value_list(const std::vector> &points, @@ -295,10 +299,10 @@ namespace Step20 // used dim copies of the FE_Q(1) element, one // copy for the displacement in each coordinate direction. template - MixedLaplaceProblem::MixedLaplaceProblem(const unsigned int degree) : - degree(degree), - fe(FE_RaviartThomas(degree), 1, FE_DGQ(degree), 1), - dof_handler(triangulation) + MixedLaplaceProblem::MixedLaplaceProblem(const unsigned int degree) + : degree(degree) + , fe(FE_RaviartThomas(degree), 1, FE_DGQ(degree), 1) + , dof_handler(triangulation) {} @@ -540,8 +544,9 @@ namespace Step20 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], local_matrix(i, j)); + system_matrix.add(local_dof_indices[i], + local_dof_indices[j], + local_matrix(i, j)); for (unsigned int i = 0; i < dofs_per_cell; ++i) system_rhs(local_dof_indices[i]) += local_rhs(i); } @@ -581,7 +586,8 @@ namespace Step20 template - InverseMatrix::InverseMatrix(const MatrixType &m) : matrix(&m) + InverseMatrix::InverseMatrix(const MatrixType &m) + : matrix(&m) {} @@ -643,11 +649,11 @@ namespace Step20 SchurComplement ::SchurComplement( const BlockSparseMatrix & A, - const InverseMatrix> &Minv) : - system_matrix(&A), - m_inverse(&Minv), - tmp1(A.block(0, 0).m()), - tmp2(A.block(0, 0).m()) + const InverseMatrix> &Minv) + : system_matrix(&A) + , m_inverse(&Minv) + , tmp1(A.block(0, 0).m()) + , tmp2(A.block(0, 0).m()) {} @@ -682,10 +688,10 @@ namespace Step20 ApproximateSchurComplement::ApproximateSchurComplement( - const BlockSparseMatrix &A) : - system_matrix(&A), - tmp1(A.block(0, 0).m()), - tmp2(A.block(0, 0).m()) + const BlockSparseMatrix &A) + : system_matrix(&A) + , tmp1(A.block(0, 0).m()) + , tmp2(A.block(0, 0).m()) {} @@ -728,8 +734,10 @@ namespace Step20 ApproximateSchurComplement approximate_schur(system_matrix); InverseMatrix approximate_inverse( approximate_schur); - cg.solve( - schur_complement, solution.block(1), schur_rhs, approximate_inverse); + cg.solve(schur_complement, + solution.block(1), + schur_rhs, + approximate_inverse); std::cout << solver_control.last_step() << " CG Schur complement iterations to obtain convergence." @@ -822,8 +830,10 @@ namespace Step20 quadrature, VectorTools::L2_norm, &pressure_mask); - const double p_l2_error = VectorTools::compute_global_error( - triangulation, cellwise_errors, VectorTools::L2_norm); + const double p_l2_error = + VectorTools::compute_global_error(triangulation, + cellwise_errors, + VectorTools::L2_norm); VectorTools::integrate_difference(dof_handler, solution, @@ -832,8 +842,10 @@ namespace Step20 quadrature, VectorTools::L2_norm, &velocity_mask); - const double u_l2_error = VectorTools::compute_global_error( - triangulation, cellwise_errors, VectorTools::L2_norm); + const double u_l2_error = + VectorTools::compute_global_error(triangulation, + cellwise_errors, + VectorTools::L2_norm); std::cout << "Errors: ||e_p||_L2 = " << p_l2_error << ", ||e_u||_L2 = " << u_l2_error << std::endl; @@ -867,8 +879,10 @@ namespace Step20 interpretation.push_back(DataComponentInterpretation::component_is_scalar); DataOut data_out; - data_out.add_data_vector( - dof_handler, solution, solution_names, interpretation); + data_out.add_data_vector(dof_handler, + solution, + solution_names, + interpretation); data_out.build_patches(degree + 1); diff --git a/examples/step-21/step-21.cc b/examples/step-21/step-21.cc index 43c5f9d22e..504f3a59c9 100644 --- a/examples/step-21/step-21.cc +++ b/examples/step-21/step-21.cc @@ -140,7 +140,8 @@ namespace Step21 class PressureRightHandSide : public Function { public: - PressureRightHandSide() : Function(1) + PressureRightHandSide() + : Function(1) {} virtual double value(const Point & p, @@ -166,7 +167,8 @@ namespace Step21 class PressureBoundaryValues : public Function { public: - PressureBoundaryValues() : Function(1) + PressureBoundaryValues() + : Function(1) {} virtual double value(const Point & p, @@ -194,7 +196,8 @@ namespace Step21 class SaturationBoundaryValues : public Function { public: - SaturationBoundaryValues() : Function(1) + SaturationBoundaryValues() + : Function(1) {} virtual double value(const Point & p, @@ -233,7 +236,8 @@ namespace Step21 class InitialValues : public Function { public: - InitialValues() : Function(dim + 2) + InitialValues() + : Function(dim + 2) {} virtual double value(const Point & p, @@ -281,7 +285,8 @@ namespace Step21 class KInverse : public TensorFunction<2, dim> { public: - KInverse() : TensorFunction<2, dim>() + KInverse() + : TensorFunction<2, dim>() {} virtual void value_list(const std::vector> &points, @@ -353,7 +358,8 @@ namespace Step21 class KInverse : public TensorFunction<2, dim> { public: - KInverse() : TensorFunction<2, dim>() + KInverse() + : TensorFunction<2, dim>() {} virtual void @@ -462,7 +468,8 @@ namespace Step21 template - InverseMatrix::InverseMatrix(const MatrixType &m) : matrix(&m) + InverseMatrix::InverseMatrix(const MatrixType &m) + : matrix(&m) {} @@ -501,11 +508,11 @@ namespace Step21 SchurComplement::SchurComplement( const BlockSparseMatrix & A, - const InverseMatrix> &Minv) : - system_matrix(&A), - m_inverse(&Minv), - tmp1(A.block(0, 0).m()), - tmp2(A.block(0, 0).m()) + const InverseMatrix> &Minv) + : system_matrix(&A) + , m_inverse(&Minv) + , tmp1(A.block(0, 0).m()) + , tmp2(A.block(0, 0).m()) {} @@ -534,10 +541,10 @@ namespace Step21 ApproximateSchurComplement::ApproximateSchurComplement( - const BlockSparseMatrix &A) : - system_matrix(&A), - tmp1(A.block(0, 0).m()), - tmp2(A.block(0, 0).m()) + const BlockSparseMatrix &A) + : system_matrix(&A) + , tmp1(A.block(0, 0).m()) + , tmp2(A.block(0, 0).m()) {} @@ -565,19 +572,19 @@ namespace Step21 // before it is needed first, as described in a subsection of the // introduction. template - TwoPhaseFlowProblem::TwoPhaseFlowProblem(const unsigned int degree) : - degree(degree), - fe(FE_RaviartThomas(degree), - 1, - FE_DGQ(degree), - 1, - FE_DGQ(degree), - 1), - dof_handler(triangulation), - n_refinement_steps(5), - time_step(0), - timestep_number(1), - viscosity(0.2) + TwoPhaseFlowProblem::TwoPhaseFlowProblem(const unsigned int degree) + : degree(degree) + , fe(FE_RaviartThomas(degree), + 1, + FE_DGQ(degree), + 1, + FE_DGQ(degree), + 1) + , dof_handler(triangulation) + , n_refinement_steps(5) + , time_step(0) + , timestep_number(1) + , viscosity(0.2) {} @@ -807,8 +814,9 @@ namespace Step21 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], local_matrix(i, j)); + system_matrix.add(local_dof_indices[i], + local_dof_indices[j], + local_matrix(i, j)); for (unsigned int i = 0; i < dofs_per_cell; ++i) system_rhs(local_dof_indices[i]) += local_rhs(i); @@ -840,8 +848,9 @@ namespace Step21 update_values | update_normal_vectors | update_quadrature_points | update_JxW_values); - FEFaceValues fe_face_values_neighbor( - fe, face_quadrature_formula, update_values); + FEFaceValues fe_face_values_neighbor(fe, + face_quadrature_formula, + update_values); const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); @@ -851,12 +860,14 @@ namespace Step21 std::vector> old_solution_values(n_q_points, Vector(dim + 2)); - std::vector> old_solution_values_face( - n_face_q_points, Vector(dim + 2)); + std::vector> old_solution_values_face(n_face_q_points, + Vector(dim + + 2)); std::vector> old_solution_values_face_neighbor( n_face_q_points, Vector(dim + 2)); - std::vector> present_solution_values( - n_q_points, Vector(dim + 2)); + std::vector> present_solution_values(n_q_points, + Vector(dim + + 2)); std::vector> present_solution_values_face( n_face_q_points, Vector(dim + 2)); diff --git a/examples/step-22/step-22.cc b/examples/step-22/step-22.cc index 5cd937da04..dcb7a8138a 100644 --- a/examples/step-22/step-22.cc +++ b/examples/step-22/step-22.cc @@ -180,7 +180,8 @@ namespace Step22 class BoundaryValues : public Function { public: - BoundaryValues() : Function(dim + 1) + BoundaryValues() + : Function(dim + 1) {} virtual double value(const Point & p, @@ -220,7 +221,8 @@ namespace Step22 class RightHandSide : public Function { public: - RightHandSide() : Function(dim + 1) + RightHandSide() + : Function(dim + 1) {} virtual double value(const Point & p, @@ -284,9 +286,9 @@ namespace Step22 template InverseMatrix::InverseMatrix( const MatrixType & m, - const PreconditionerType &preconditioner) : - matrix(&m), - preconditioner(&preconditioner) + const PreconditionerType &preconditioner) + : matrix(&m) + , preconditioner(&preconditioner) {} @@ -348,11 +350,11 @@ namespace Step22 template SchurComplement::SchurComplement( const BlockSparseMatrix &system_matrix, - const InverseMatrix, PreconditionerType> &A_inverse) : - system_matrix(&system_matrix), - A_inverse(&A_inverse), - tmp1(system_matrix.block(0, 0).m()), - tmp2(system_matrix.block(0, 0).m()) + const InverseMatrix, PreconditionerType> &A_inverse) + : system_matrix(&system_matrix) + , A_inverse(&A_inverse) + , tmp1(system_matrix.block(0, 0).m()) + , tmp2(system_matrix.block(0, 0).m()) {} @@ -386,11 +388,11 @@ namespace Step22 // grids are too unstructured), see the documentation of // Triangulation::MeshSmoothing for details. template - StokesProblem::StokesProblem(const unsigned int degree) : - degree(degree), - triangulation(Triangulation::maximum_smoothing), - fe(FE_Q(degree + 1), dim, FE_Q(degree), 1), - dof_handler(triangulation) + StokesProblem::StokesProblem(const unsigned int degree) + : degree(degree) + , triangulation(Triangulation::maximum_smoothing) + , fe(FE_Q(degree + 1), dim, FE_Q(degree), 1) + , dof_handler(triangulation) {} @@ -493,8 +495,9 @@ namespace Step22 // DoFTools::count_dofs_per_component, but now grouped as // velocity and pressure block via block_component. std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block( - dof_handler, dofs_per_block, block_component); + DoFTools::count_dofs_per_block(dof_handler, + dofs_per_block, + block_component); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; std::cout << " Number of active cells: " << triangulation.n_active_cells() @@ -943,8 +946,10 @@ namespace Step22 estimated_error_per_cell, fe.component_mask(pressure)); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.0); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.0); triangulation.execute_coarsening_and_refinement(); } @@ -975,8 +980,10 @@ namespace Step22 const Point top_right = (dim == 2 ? Point(2, 0) : Point(2, 1, 0)); - GridGenerator::subdivided_hyper_rectangle( - triangulation, subdivisions, bottom_left, top_right); + GridGenerator::subdivided_hyper_rectangle(triangulation, + subdivisions, + bottom_left, + top_right); } // A boundary indicator of 1 is set to all boundaries that are subject to diff --git a/examples/step-23/step-23.cc b/examples/step-23/step-23.cc index b0ed75efaf..3cf802ae69 100644 --- a/examples/step-23/step-23.cc +++ b/examples/step-23/step-23.cc @@ -163,7 +163,8 @@ namespace Step23 class InitialValuesU : public Function { public: - InitialValuesU() : Function() + InitialValuesU() + : Function() {} virtual double value(const Point & p, @@ -175,7 +176,8 @@ namespace Step23 class InitialValuesV : public Function { public: - InitialValuesV() : Function() + InitialValuesV() + : Function() {} virtual double value(const Point & p, @@ -212,7 +214,8 @@ namespace Step23 class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double value(const Point & p, @@ -238,7 +241,8 @@ namespace Step23 class BoundaryValuesU : public Function { public: - BoundaryValuesU() : Function() + BoundaryValuesU() + : Function() {} virtual double value(const Point & p, @@ -251,7 +255,8 @@ namespace Step23 class BoundaryValuesV : public Function { public: - BoundaryValuesV() : Function() + BoundaryValuesV() + : Function() {} virtual double value(const Point & p, @@ -305,13 +310,13 @@ namespace Step23 // time step, see the section on Courant, Friedrichs, and Lewy in the // introduction): template - WaveEquation::WaveEquation() : - fe(1), - dof_handler(triangulation), - time_step(1. / 64), - time(time_step), - timestep_number(1), - theta(0.5) + WaveEquation::WaveEquation() + : fe(1) + , dof_handler(triangulation) + , time_step(1. / 64) + , time(time_step) + , timestep_number(1) + , theta(0.5) {} @@ -369,8 +374,9 @@ namespace Step23 matrix_v.reinit(sparsity_pattern); MatrixCreator::create_mass_matrix(dof_handler, QGauss(3), mass_matrix); - MatrixCreator::create_laplace_matrix( - dof_handler, QGauss(3), laplace_matrix); + MatrixCreator::create_laplace_matrix(dof_handler, + QGauss(3), + laplace_matrix); // The rest of the function is spent on setting vector sizes to the // correct value. The final line closes the hanging node constraints @@ -521,14 +527,18 @@ namespace Step23 RightHandSide rhs_function; rhs_function.set_time(time); - VectorTools::create_right_hand_side( - dof_handler, QGauss(2), rhs_function, tmp); + VectorTools::create_right_hand_side(dof_handler, + QGauss(2), + rhs_function, + tmp); forcing_terms = tmp; forcing_terms *= theta * time_step; rhs_function.set_time(time - time_step); - VectorTools::create_right_hand_side( - dof_handler, QGauss(2), rhs_function, tmp); + VectorTools::create_right_hand_side(dof_handler, + QGauss(2), + rhs_function, + tmp); forcing_terms.add((1 - theta) * time_step, tmp); @@ -546,8 +556,10 @@ namespace Step23 boundary_values_u_function.set_time(time); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, boundary_values_u_function, boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + boundary_values_u_function, + boundary_values); // The matrix for solve_u() is the same in every time steps, so one // could think that it is enough to do this only once at the @@ -559,8 +571,10 @@ namespace Step23 // it is the sum of the mass matrix and a weighted Laplace matrix: matrix_u.copy_from(mass_matrix); matrix_u.add(theta * theta * time_step * time_step, laplace_matrix); - MatrixTools::apply_boundary_values( - boundary_values, matrix_u, solution_u, system_rhs); + MatrixTools::apply_boundary_values(boundary_values, + matrix_u, + solution_u, + system_rhs); } solve_u(); @@ -588,11 +602,15 @@ namespace Step23 boundary_values_v_function.set_time(time); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, boundary_values_v_function, boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + boundary_values_v_function, + boundary_values); matrix_v.copy_from(mass_matrix); - MatrixTools::apply_boundary_values( - boundary_values, matrix_v, solution_v, system_rhs); + MatrixTools::apply_boundary_values(boundary_values, + matrix_v, + solution_v, + system_rhs); } solve_v(); diff --git a/examples/step-24/step-24.cc b/examples/step-24/step-24.cc index bb4b3d8322..b0d219508d 100644 --- a/examples/step-24/step-24.cc +++ b/examples/step-24/step-24.cc @@ -139,7 +139,8 @@ namespace Step24 class InitialValuesP : public Function { public: - InitialValuesP() : Function() + InitialValuesP() + : Function() {} virtual double value(const Point & p, @@ -148,7 +149,9 @@ namespace Step24 private: struct Source { - Source(const Point &l, const double r) : location(l), radius(r) + Source(const Point &l, const double r) + : location(l) + , radius(r) {} const Point location; @@ -186,14 +189,14 @@ namespace Step24 // i.e. theta is set to 0.5. The time step is later selected to satisfy $k = // \frac hc$: here we initialize it to an invalid number. template - TATForwardProblem::TATForwardProblem() : - fe(1), - dof_handler(triangulation), - time_step(std::numeric_limits::quiet_NaN()), - time(time_step), - timestep_number(1), - theta(0.5), - wave_speed(1.437) + TATForwardProblem::TATForwardProblem() + : fe(1) + , dof_handler(triangulation) + , time_step(std::numeric_limits::quiet_NaN()) + , time(time_step) + , timestep_number(1) + , theta(0.5) + , wave_speed(1.437) { // The second task in the constructor is to initialize the array that // holds the detector locations. The results of this program were compared @@ -287,8 +290,9 @@ namespace Step24 laplace_matrix.reinit(sparsity_pattern); MatrixCreator::create_mass_matrix(dof_handler, QGauss(3), mass_matrix); - MatrixCreator::create_laplace_matrix( - dof_handler, QGauss(3), laplace_matrix); + MatrixCreator::create_laplace_matrix(dof_handler, + QGauss(3), + laplace_matrix); // The second difference, as mentioned, to step-23 is that we need to // build the boundary mass matrix that grew out of the absorbing boundary @@ -333,8 +337,9 @@ namespace Step24 // domain. Like this: { const QGauss quadrature_formula(3); - FEFaceValues fe_values( - fe, quadrature_formula, update_values | update_JxW_values); + FEFaceValues fe_values(fe, + quadrature_formula, + update_values | update_JxW_values); const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); @@ -519,8 +524,9 @@ namespace Step24 detector_data << time; for (unsigned int i = 0; i < detector_locations.size(); ++i) detector_data << " " - << VectorTools::point_value( - dof_handler, solution_p, detector_locations[i]) + << VectorTools::point_value(dof_handler, + solution_p, + detector_locations[i]) << " "; detector_data << std::endl; diff --git a/examples/step-25/step-25.cc b/examples/step-25/step-25.cc index 6205fc79f3..4e0f59ed5f 100644 --- a/examples/step-25/step-25.cc +++ b/examples/step-25/step-25.cc @@ -153,8 +153,8 @@ namespace Step25 class ExactSolution : public Function { public: - ExactSolution(const unsigned int n_components = 1, const double time = 0.) : - Function(n_components, time) + ExactSolution(const unsigned int n_components = 1, const double time = 0.) + : Function(n_components, time) {} virtual double value(const Point & p, const unsigned int component = 0) const override; @@ -219,8 +219,8 @@ namespace Step25 class InitialValues : public Function { public: - InitialValues(const unsigned int n_components = 1, const double time = 0.) : - Function(n_components, time) + InitialValues(const unsigned int n_components = 1, const double time = 0.) + : Function(n_components, time) {} virtual double value(const Point & p, @@ -264,15 +264,15 @@ namespace Step25 // technique in step-24 using GridTools::minimal_cell_diameter would work as // well. template - SineGordonProblem::SineGordonProblem() : - fe(1), - dof_handler(triangulation), - n_global_refinements(6), - time(-5.4414), - final_time(2.7207), - time_step(10 * 1. / std::pow(2., 1. * n_global_refinements)), - theta(0.5), - output_timestep_skip(1) + SineGordonProblem::SineGordonProblem() + : fe(1) + , dof_handler(triangulation) + , n_global_refinements(6) + , time(-5.4414) + , final_time(2.7207) + , time_step(10 * 1. / std::pow(2., 1. * n_global_refinements)) + , theta(0.5) + , output_timestep_skip(1) {} // @sect4{SineGordonProblem::make_grid_and_dofs} @@ -309,8 +309,9 @@ namespace Step25 laplace_matrix.reinit(sparsity_pattern); MatrixCreator::create_mass_matrix(dof_handler, QGauss(3), mass_matrix); - MatrixCreator::create_laplace_matrix( - dof_handler, QGauss(3), laplace_matrix); + MatrixCreator::create_laplace_matrix(dof_handler, + QGauss(3), + laplace_matrix); solution.reinit(dof_handler.n_dofs()); solution_update.reinit(dof_handler.n_dofs()); diff --git a/examples/step-26/step-26.cc b/examples/step-26/step-26.cc index c9c629313b..449118ff4a 100644 --- a/examples/step-26/step-26.cc +++ b/examples/step-26/step-26.cc @@ -126,7 +126,9 @@ namespace Step26 class RightHandSide : public Function { public: - RightHandSide() : Function(), period(0.2) + RightHandSide() + : Function() + , period(0.2) {} virtual double value(const Point & p, @@ -200,13 +202,13 @@ namespace Step26 // period with 100 time steps) and chooses the Crank Nicolson method // by setting $\theta=1/2$. template - HeatEquation::HeatEquation() : - fe(1), - dof_handler(triangulation), - time(0.0), - time_step(1. / 500), - timestep_number(0), - theta(0.5) + HeatEquation::HeatEquation() + : fe(1) + , dof_handler(triangulation) + , time(0.0) + , time_step(1. / 500) + , timestep_number(0) + , theta(0.5) {} @@ -251,10 +253,12 @@ namespace Step26 laplace_matrix.reinit(sparsity_pattern); system_matrix.reinit(sparsity_pattern); - MatrixCreator::create_mass_matrix( - dof_handler, QGauss(fe.degree + 1), mass_matrix); - MatrixCreator::create_laplace_matrix( - dof_handler, QGauss(fe.degree + 1), laplace_matrix); + MatrixCreator::create_mass_matrix(dof_handler, + QGauss(fe.degree + 1), + mass_matrix); + MatrixCreator::create_laplace_matrix(dof_handler, + QGauss(fe.degree + 1), + laplace_matrix); solution.reinit(dof_handler.n_dofs()); old_solution.reinit(dof_handler.n_dofs()); @@ -340,8 +344,10 @@ namespace Step26 solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_fraction( - triangulation, estimated_error_per_cell, 0.6, 0.4); + GridRefinement::refine_and_coarsen_fixed_fraction(triangulation, + estimated_error_per_cell, + 0.6, + 0.4); if (triangulation.n_levels() > max_grid_level) for (typename Triangulation::active_cell_iterator cell = @@ -454,8 +460,9 @@ namespace Step26 forcing_terms.reinit(solution.size()); - VectorTools::interpolate( - dof_handler, Functions::ZeroFunction(), old_solution); + VectorTools::interpolate(dof_handler, + Functions::ZeroFunction(), + old_solution); solution = old_solution; output_results(); @@ -488,14 +495,18 @@ namespace Step26 // all ends up in the forcing_terms variable: RightHandSide rhs_function; rhs_function.set_time(time); - VectorTools::create_right_hand_side( - dof_handler, QGauss(fe.degree + 1), rhs_function, tmp); + VectorTools::create_right_hand_side(dof_handler, + QGauss(fe.degree + 1), + rhs_function, + tmp); forcing_terms = tmp; forcing_terms *= time_step * theta; rhs_function.set_time(time - time_step); - VectorTools::create_right_hand_side( - dof_handler, QGauss(fe.degree + 1), rhs_function, tmp); + VectorTools::create_right_hand_side(dof_handler, + QGauss(fe.degree + 1), + rhs_function, + tmp); forcing_terms.add(time_step * (1 - theta), tmp); @@ -523,11 +534,15 @@ namespace Step26 boundary_values_function.set_time(time); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, boundary_values_function, boundary_values); - - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + boundary_values_function, + boundary_values); + + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } // With this out of the way, all we have to do is solve the diff --git a/examples/step-27/step-27.cc b/examples/step-27/step-27.cc index 5ef9545063..5999537050 100644 --- a/examples/step-27/step-27.cc +++ b/examples/step-27/step-27.cc @@ -136,7 +136,8 @@ namespace Step27 class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double value(const Point & p, @@ -188,9 +189,9 @@ namespace Step27 } template - LaplaceProblem::LaplaceProblem() : - dof_handler(triangulation), - max_degree(dim <= 2 ? 7 : 5) + LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) + , max_degree(dim <= 2 ? 7 : 5) { for (unsigned int degree = 2; degree <= max_degree; ++degree) { @@ -233,8 +234,9 @@ namespace Step27 fourier_q_collection.push_back(quadrature); // Now we are ready to set-up the FESeries::Fourier object - fourier = std::make_shared>( - N, fe_collection, fourier_q_collection); + fourier = std::make_shared>(N, + fe_collection, + fourier_q_collection); // We need to resize the matrix of fourier coefficients according to the // number of modes N. @@ -268,8 +270,10 @@ namespace Step27 constraints.clear(); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); @@ -471,8 +475,10 @@ namespace Step27 // estimated error to flag those cells for refinement that have the // largest error. This is what we have always done: { - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); // Next we would like to figure out which of the cells that have been // flagged for refinement should actually have $p$ increased instead of @@ -708,8 +714,9 @@ namespace Step27 local_dof_values.reinit(cell->get_fe().dofs_per_cell); cell->get_dof_values(solution, local_dof_values); - fourier->calculate( - local_dof_values, cell->active_fe_index(), fourier_coefficients); + fourier->calculate(local_dof_values, + cell->active_fe_index(), + fourier_coefficients); // The next thing, as explained in the introduction, is that we wanted // to only fit our exponential decay of Fourier coefficients to the @@ -721,8 +728,9 @@ namespace Step27 std::pair, std::vector> res = FESeries::process_coefficients( fourier_coefficients, - std::bind( - &LaplaceProblem::predicate, this, std::placeholders::_1), + std::bind(&LaplaceProblem::predicate, + this, + std::placeholders::_1), VectorTools::Linfty_norm); Assert(res.first.size() == res.second.size(), ExcInternalError()); diff --git a/examples/step-28/step-28.cc b/examples/step-28/step-28.cc index 75fa338117..09982a4c9c 100644 --- a/examples/step-28/step-28.cc +++ b/examples/step-28/step-28.cc @@ -166,14 +166,14 @@ namespace Step28 // // At present, material data is stored for 8 different types of // material. This, as well, may easily be extended in the future. - MaterialData::MaterialData(const unsigned int n_groups) : - n_groups(n_groups), - n_materials(8), - diffusion(n_materials, n_groups), - sigma_r(n_materials, n_groups), - nu_sigma_f(n_materials, n_groups), - sigma_s(n_materials, n_groups, n_groups), - chi(n_materials, n_groups) + MaterialData::MaterialData(const unsigned int n_groups) + : n_groups(n_groups) + , n_materials(8) + , diffusion(n_materials, n_groups) + , sigma_r(n_materials, n_groups) + , nu_sigma_f(n_materials, n_groups) + , sigma_s(n_materials, n_groups, n_groups) + , chi(n_materials, n_groups) { switch (this->n_groups) { @@ -240,9 +240,9 @@ namespace Step28 default: - Assert( - false, - ExcMessage("Presently, only data for 2 groups is implemented")); + Assert(false, + ExcMessage( + "Presently, only data for 2 groups is implemented")); } } @@ -532,11 +532,11 @@ namespace Step28 EnergyGroup::EnergyGroup(const unsigned int group, const MaterialData & material_data, const Triangulation &coarse_grid, - const FiniteElement &fe) : - group(group), - material_data(material_data), - fe(fe), - dof_handler(triangulation) + const FiniteElement &fe) + : group(group) + , material_data(material_data) + , fe(fe) + , dof_handler(triangulation) { triangulation.copy_triangulation(coarse_grid); dof_handler.distribute_dofs(fe); @@ -697,8 +697,9 @@ namespace Step28 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); } hanging_node_constraints.condense(system_matrix); @@ -811,8 +812,10 @@ namespace Step28 FullMatrix unit_matrix(fe.dofs_per_cell); for (unsigned int i = 0; i < unit_matrix.m(); ++i) unit_matrix(i, i) = 1; - assemble_cross_group_rhs_recursive( - g_prime, cell_iter->first, cell_iter->second, unit_matrix); + assemble_cross_group_rhs_recursive(g_prime, + cell_iter->first, + cell_iter->second, + unit_matrix); } } @@ -861,19 +864,24 @@ namespace Step28 const QGauss quadrature_formula(fe.degree + 1); const unsigned int n_q_points = quadrature_formula.size(); - FEValues fe_values( - fe, quadrature_formula, update_values | update_JxW_values); + FEValues fe_values(fe, + quadrature_formula, + update_values | update_JxW_values); if (cell_g->level() > cell_g_prime->level()) fe_values.reinit(cell_g); else fe_values.reinit(cell_g_prime); - const double fission_dist_XS = material_data.get_fission_dist_XS( - group, g_prime.group, cell_g_prime->material_id()); + const double fission_dist_XS = + material_data.get_fission_dist_XS(group, + g_prime.group, + cell_g_prime->material_id()); - const double scattering_XS = material_data.get_scattering_XS( - g_prime.group, group, cell_g_prime->material_id()); + const double scattering_XS = + material_data.get_scattering_XS(g_prime.group, + group, + cell_g_prime->material_id()); FullMatrix local_mass_matrix_f(fe.dofs_per_cell, fe.dofs_per_cell); @@ -953,11 +961,15 @@ namespace Step28 prolongation_matrix); if (cell_g->has_children()) - assemble_cross_group_rhs_recursive( - g_prime, cell_g->child(child), cell_g_prime, new_matrix); + assemble_cross_group_rhs_recursive(g_prime, + cell_g->child(child), + cell_g_prime, + new_matrix); else - assemble_cross_group_rhs_recursive( - g_prime, cell_g, cell_g_prime->child(child), new_matrix); + assemble_cross_group_rhs_recursive(g_prime, + cell_g, + cell_g_prime->child(child), + new_matrix); } } @@ -973,8 +985,9 @@ namespace Step28 const QGauss quadrature_formula(fe.degree + 1); const unsigned int n_q_points = quadrature_formula.size(); - FEValues fe_values( - fe, quadrature_formula, update_values | update_JxW_values); + FEValues fe_values(fe, + quadrature_formula, + update_values | update_JxW_values); std::vector solution_values(n_q_points); @@ -1011,8 +1024,10 @@ namespace Step28 void EnergyGroup::solve() { hanging_node_constraints.condense(system_rhs); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); SolverControl solver_control(system_matrix.m(), 1e-12 * system_rhs.l2_norm()); @@ -1226,11 +1241,11 @@ namespace Step28 // parameters classes using the ParameterHandler capabilities. We will // therefore not comment further on this: template - NeutronDiffusionProblem::Parameters::Parameters() : - n_groups(2), - n_refinement_cycles(5), - fe_degree(2), - convergence_tolerance(1e-12) + NeutronDiffusionProblem::Parameters::Parameters() + : n_groups(2) + , n_refinement_cycles(5) + , fe_degree(2) + , convergence_tolerance(1e-12) {} @@ -1279,11 +1294,11 @@ namespace Step28 // and destructor have nothing of much interest: template NeutronDiffusionProblem::NeutronDiffusionProblem( - const Parameters ¶meters) : - parameters(parameters), - material_data(parameters.n_groups), - fe(parameters.fe_degree), - k_eff(std::numeric_limits::quiet_NaN()) + const Parameters ¶meters) + : parameters(parameters) + , material_data(parameters.n_groups) + , fe(parameters.fe_degree) + , k_eff(std::numeric_limits::quiet_NaN()) {} @@ -1507,8 +1522,9 @@ namespace Step28 { std::vector> threads; for (unsigned int group = 0; group < parameters.n_groups; ++group) - threads.push_back(Threads::new_thread( - &EnergyGroup::get_fission_source, *energy_groups[group])); + threads.push_back( + Threads::new_thread(&EnergyGroup::get_fission_source, + *energy_groups[group])); double fission_source = 0; for (unsigned int group = 0; group < parameters.n_groups; ++group) @@ -1625,8 +1641,9 @@ namespace Step28 Threads::ThreadGroup<> threads; for (unsigned int group = 0; group < parameters.n_groups; ++group) - threads += Threads::new_thread( - &EnergyGroup::assemble_system_matrix, *energy_groups[group]); + threads += + Threads::new_thread(&EnergyGroup::assemble_system_matrix, + *energy_groups[group]); threads.join_all(); double error; diff --git a/examples/step-29/step-29.cc b/examples/step-29/step-29.cc index 60a1f31a54..b7f6b3be32 100644 --- a/examples/step-29/step-29.cc +++ b/examples/step-29/step-29.cc @@ -99,7 +99,8 @@ namespace Step29 class DirichletBoundaryValues : public Function { public: - DirichletBoundaryValues() : Function(2){}; + DirichletBoundaryValues() + : Function(2){}; virtual void vector_value(const Point &p, Vector & values) const override; @@ -154,8 +155,8 @@ namespace Step29 // The constructor stores a reference to the ParameterHandler object that is // passed to it: - ParameterReader::ParameterReader(ParameterHandler ¶mhandler) : - prm(paramhandler) + ParameterReader::ParameterReader(ParameterHandler ¶mhandler) + : prm(paramhandler) {} // @sect4{ParameterReader::declare_parameters} @@ -318,8 +319,8 @@ namespace Step29 // In our case, only the function values of $v$ and $w$ are needed to // compute $|u|$, so we're good with the update_values flag. template - ComputeIntensity::ComputeIntensity() : - DataPostprocessorScalar("Intensity", update_values) + ComputeIntensity::ComputeIntensity() + : DataPostprocessorScalar("Intensity", update_values) {} @@ -403,10 +404,10 @@ namespace Step29 // system, which consists of two copies of the scalar Q1 field, one for $v$ // and one for $w$: template - UltrasoundProblem::UltrasoundProblem(ParameterHandler ¶m) : - prm(param), - dof_handler(triangulation), - fe(FE_Q(1), 2) + UltrasoundProblem::UltrasoundProblem(ParameterHandler ¶m) + : prm(param) + , dof_handler(triangulation) + , fe(FE_Q(1), 2) {} @@ -569,8 +570,9 @@ namespace Step29 update_values | update_gradients | update_JxW_values); - FEFaceValues fe_face_values( - fe, face_quadrature_formula, update_values | update_JxW_values); + FEFaceValues fe_face_values(fe, + face_quadrature_formula, + update_values | update_JxW_values); // As usual, the system matrix is assembled cell by cell, and we need a // matrix for storing the local cell contributions as well as an index @@ -732,8 +734,9 @@ namespace Step29 // ...and then add the entries to the system matrix one by one: 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); } @@ -742,11 +745,15 @@ namespace Step29 // values are provided by the DirichletBoundaryValues class // we defined above: std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 1, DirichletBoundaryValues(), boundary_values); - - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 1, + DirichletBoundaryValues(), + boundary_values); + + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); timer.stop(); deallog << "done (" << timer.cpu_time() << "s)" << std::endl; diff --git a/examples/step-3/step-3.cc b/examples/step-3/step-3.cc index cf5996ce0c..f3e64b939b 100644 --- a/examples/step-3/step-3.cc +++ b/examples/step-3/step-3.cc @@ -141,7 +141,9 @@ private: // you try to distribute degree of freedom on the mesh using the // distribute_dofs() function.) All the other member variables of the Step3 // class have a default constructor which does all we want. -Step3::Step3() : fe(1), dof_handler(triangulation) +Step3::Step3() + : fe(1) + , dof_handler(triangulation) {} @@ -457,8 +459,9 @@ void Step3::assemble_system() // obtained using local_dof_indices[i]: 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); // And again, we do the same thing for the right hand side vector. for (unsigned int i = 0; i < dofs_per_cell; ++i) @@ -510,13 +513,17 @@ void Step3::assemble_system() // of DoF numbers to boundary values is done by the std::map // class. std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction<2>(), boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction<2>(), + boundary_values); // Now that we got the list of boundary DoFs and their respective boundary // values, let's use them to modify the system of equations // accordingly. This is done by the following function call: - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/examples/step-30/step-30.cc b/examples/step-30/step-30.cc index a65a21fa5c..13ffc1bb2e 100644 --- a/examples/step-30/step-30.cc +++ b/examples/step-30/step-30.cc @@ -195,10 +195,10 @@ namespace Step30 // the quadrature points on faces or subfaces represented by the two objects // correspond to the same points in physical space. template - DGTransportEquation::DGTransportEquation() : - beta_function(), - rhs_function(), - boundary_function() + DGTransportEquation::DGTransportEquation() + : beta_function() + , rhs_function() + , boundary_function() {} @@ -366,22 +366,24 @@ namespace Step30 template - DGMethod::DGMethod(const bool anisotropic) : - mapping(), + DGMethod::DGMethod(const bool anisotropic) + : mapping() + , // Change here for DG methods of different degrees. - degree(1), - fe(degree), - dof_handler(triangulation), - anisotropic_threshold_ratio(3.), - anisotropic(anisotropic), + degree(1) + , fe(degree) + , dof_handler(triangulation) + , anisotropic_threshold_ratio(3.) + , anisotropic(anisotropic) + , // As beta is a linear function, we can choose the degree of the // quadrature for which the resulting integration is correct. Thus, we // choose to use degree+1 Gauss points, which enables us to // integrate exactly polynomials of degree 2*degree+1, enough // for all the integrals we will perform in this program. - quadrature(degree + 1), - face_quadrature(degree + 1), - dg() + quadrature(degree + 1) + , face_quadrature(degree + 1) + , dg() {} @@ -441,13 +443,19 @@ namespace Step30 const UpdateFlags neighbor_face_update_flags = update_values; - FEValues fe_v(mapping, fe, quadrature, update_flags); - FEFaceValues fe_v_face( - mapping, fe, face_quadrature, face_update_flags); - FESubfaceValues fe_v_subface( - mapping, fe, face_quadrature, face_update_flags); - FEFaceValues fe_v_face_neighbor( - mapping, fe, face_quadrature, neighbor_face_update_flags); + FEValues fe_v(mapping, fe, quadrature, update_flags); + FEFaceValues fe_v_face(mapping, + fe, + face_quadrature, + face_update_flags); + FESubfaceValues fe_v_subface(mapping, + fe, + face_quadrature, + face_update_flags); + FEFaceValues fe_v_face_neighbor(mapping, + fe, + face_quadrature, + neighbor_face_update_flags); FullMatrix ui_vi_matrix(dofs_per_cell, dofs_per_cell); @@ -539,10 +547,12 @@ namespace Step30 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[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)); @@ -592,10 +602,12 @@ namespace Step30 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[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)); @@ -646,8 +658,10 @@ namespace Step30 Vector gradient_indicator(triangulation.n_active_cells()); // We approximate the gradient, - DerivativeApproximation::approximate_gradient( - mapping, dof_handler, solution2, gradient_indicator); + DerivativeApproximation::approximate_gradient(mapping, + dof_handler, + solution2, + gradient_indicator); // and scale it to obtain an error indicator. typename DoFHandler::active_cell_iterator cell = @@ -658,8 +672,10 @@ namespace Step30 std::pow(cell->diameter(), 1 + 1.0 * dim / 2); // Then we use this indicator to flag the 30 percent of the cells with // highest error indicator to be refined. - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, gradient_indicator, 0.3, 0.1); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + gradient_indicator, + 0.3, + 0.1); // Now the refinement flags are set for those cells with a large error // indicator. If nothing is done to change this, those cells will be // refined isotropically. If the @p anisotropic flag given to this @@ -686,12 +702,18 @@ namespace Step30 UpdateFlags face_update_flags = UpdateFlags(update_values | update_JxW_values); - FEFaceValues fe_v_face( - mapping, fe, face_quadrature, face_update_flags); - FESubfaceValues fe_v_subface( - mapping, fe, face_quadrature, face_update_flags); - FEFaceValues fe_v_face_neighbor( - mapping, fe, face_quadrature, update_values); + FEFaceValues fe_v_face(mapping, + fe, + face_quadrature, + face_update_flags); + FESubfaceValues fe_v_subface(mapping, + fe, + face_quadrature, + face_update_flags); + FEFaceValues fe_v_face_neighbor(mapping, + fe, + face_quadrature, + update_values); // Now we need to loop over all active cells. typename DoFHandler::active_cell_iterator cell = @@ -741,8 +763,9 @@ namespace Step30 // get an iterator pointing to the cell behind the // present subface... typename DoFHandler::cell_iterator - neighbor_child = cell->neighbor_child_on_subface( - face_no, subface_no); + neighbor_child = + cell->neighbor_child_on_subface(face_no, + subface_no); Assert(!neighbor_child->has_children(), ExcInternalError()); // ... and reinit the respective FEFaceValues and @@ -956,8 +979,10 @@ namespace Step30 // completely isotropic cells for the original mesh. std::vector repetitions(dim, 1); repetitions[0] = 2; - GridGenerator::subdivided_hyper_rectangle( - triangulation, repetitions, p1, p2); + GridGenerator::subdivided_hyper_rectangle(triangulation, + repetitions, + p1, + p2); triangulation.refine_global(5 - dim); } diff --git a/examples/step-31/step-31.cc b/examples/step-31/step-31.cc index 4ecd245907..85fc938fc5 100644 --- a/examples/step-31/step-31.cc +++ b/examples/step-31/step-31.cc @@ -130,7 +130,8 @@ namespace Step31 class TemperatureInitialValues : public Function { public: - TemperatureInitialValues() : Function(1) + TemperatureInitialValues() + : Function(1) {} virtual double value(const Point & p, @@ -163,7 +164,8 @@ namespace Step31 class TemperatureRightHandSide : public Function { public: - TemperatureRightHandSide() : Function(1) + TemperatureRightHandSide() + : Function(1) {} virtual double value(const Point & p, @@ -281,9 +283,9 @@ namespace Step31 template InverseMatrix::InverseMatrix( const MatrixType & m, - const PreconditionerType &preconditioner) : - matrix(&m), - preconditioner(preconditioner) + const PreconditionerType &preconditioner) + : matrix(&m) + , preconditioner(preconditioner) {} @@ -402,11 +404,11 @@ namespace Step31 const TrilinosWrappers::BlockSparseMatrix &S, const InverseMatrix &Mpinv, - const PreconditionerTypeA & Apreconditioner) : - stokes_matrix(&S), - m_inverse(&Mpinv), - a_preconditioner(Apreconditioner), - tmp(complete_index_set(stokes_matrix->block(1, 1).m())) + const PreconditionerTypeA & Apreconditioner) + : stokes_matrix(&S) + , m_inverse(&Mpinv) + , a_preconditioner(Apreconditioner) + , tmp(complete_index_set(stokes_matrix->block(1, 1).m())) {} @@ -558,23 +560,25 @@ namespace Step31 // initialize the time stepping as well as the options for matrix assembly // and preconditioning: template - BoussinesqFlowProblem::BoussinesqFlowProblem() : - triangulation(Triangulation::maximum_smoothing), - global_Omega_diameter(std::numeric_limits::quiet_NaN()), - stokes_degree(1), - stokes_fe(FE_Q(stokes_degree + 1), dim, FE_Q(stokes_degree), 1), - stokes_dof_handler(triangulation), - - temperature_degree(2), - temperature_fe(temperature_degree), - temperature_dof_handler(triangulation), - - time_step(0), - old_time_step(0), - timestep_number(0), - rebuild_stokes_matrix(true), - rebuild_temperature_matrices(true), - rebuild_stokes_preconditioner(true) + BoussinesqFlowProblem::BoussinesqFlowProblem() + : triangulation(Triangulation::maximum_smoothing) + , global_Omega_diameter(std::numeric_limits::quiet_NaN()) + , stokes_degree(1) + , stokes_fe(FE_Q(stokes_degree + 1), dim, FE_Q(stokes_degree), 1) + , stokes_dof_handler(triangulation) + , + + temperature_degree(2) + , temperature_fe(temperature_degree) + , temperature_dof_handler(triangulation) + , + + time_step(0) + , old_time_step(0) + , timestep_number(0) + , rebuild_stokes_matrix(true) + , rebuild_temperature_matrices(true) + , rebuild_stokes_preconditioner(true) {} @@ -880,8 +884,10 @@ namespace Step31 stokes_constraints); std::set no_normal_flux_boundaries; no_normal_flux_boundaries.insert(0); - VectorTools::compute_no_normal_flux_constraints( - stokes_dof_handler, 0, no_normal_flux_boundaries, stokes_constraints); + VectorTools::compute_no_normal_flux_constraints(stokes_dof_handler, + 0, + no_normal_flux_boundaries, + stokes_constraints); stokes_constraints.close(); } { @@ -894,8 +900,9 @@ namespace Step31 } std::vector stokes_dofs_per_block(2); - DoFTools::count_dofs_per_block( - stokes_dof_handler, stokes_dofs_per_block, stokes_sub_blocks); + DoFTools::count_dofs_per_block(stokes_dof_handler, + stokes_dofs_per_block, + stokes_sub_blocks); const unsigned int n_u = stokes_dofs_per_block[0], n_p = stokes_dofs_per_block[1], @@ -1019,8 +1026,10 @@ namespace Step31 temperature_matrix.clear(); DynamicSparsityPattern dsp(n_T, n_T); - DoFTools::make_sparsity_pattern( - temperature_dof_handler, dsp, temperature_constraints, false); + DoFTools::make_sparsity_pattern(temperature_dof_handler, + dsp, + temperature_constraints, + false); temperature_matrix.reinit(dsp); temperature_mass_matrix.reinit(temperature_matrix); @@ -1167,10 +1176,10 @@ namespace Step31 std::vector> constant_modes; FEValuesExtractors::Vector velocity_components(0); - DoFTools::extract_constant_modes( - stokes_dof_handler, - stokes_fe.component_mask(velocity_components), - constant_modes); + DoFTools::extract_constant_modes(stokes_dof_handler, + stokes_fe.component_mask( + velocity_components), + constant_modes); TrilinosWrappers::PreconditionAMG::AdditionalData amg_data; amg_data.constant_modes = constant_modes; @@ -1276,8 +1285,9 @@ namespace Step31 update_values | update_quadrature_points | update_JxW_values | (rebuild_stokes_matrix == true ? update_gradients : UpdateFlags(0))); - FEValues temperature_fe_values( - temperature_fe, quadrature_formula, update_values); + FEValues temperature_fe_values(temperature_fe, + quadrature_formula, + update_values); const unsigned int dofs_per_cell = stokes_fe.dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); @@ -1399,8 +1409,9 @@ namespace Step31 stokes_matrix, stokes_rhs); else - stokes_constraints.distribute_local_to_global( - local_rhs, local_dof_indices, stokes_rhs); + stokes_constraints.distribute_local_to_global(local_rhs, + local_dof_indices, + stokes_rhs); } rebuild_stokes_matrix = false; @@ -1546,13 +1557,15 @@ namespace Step31 temperature_rhs = 0; const QGauss quadrature_formula(temperature_degree + 2); - FEValues temperature_fe_values( - temperature_fe, - quadrature_formula, - update_values | update_gradients | update_hessians | - update_quadrature_points | update_JxW_values); - FEValues stokes_fe_values( - stokes_fe, quadrature_formula, update_values); + FEValues temperature_fe_values(temperature_fe, + quadrature_formula, + update_values | update_gradients | + update_hessians | + update_quadrature_points | + update_JxW_values); + FEValues stokes_fe_values(stokes_fe, + quadrature_formula, + update_values); const unsigned int dofs_per_cell = temperature_fe.dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); @@ -1701,8 +1714,9 @@ namespace Step31 } cell->get_dof_indices(local_dof_indices); - temperature_constraints.distribute_local_to_global( - local_rhs, local_dof_indices, temperature_rhs); + temperature_constraints.distribute_local_to_global(local_rhs, + local_dof_indices, + temperature_rhs); } } @@ -1907,8 +1921,9 @@ namespace Step31 stokes_solution, stokes_names, stokes_component_interpretation); - data_out.add_data_vector( - temperature_dof_handler, temperature_solution, "T"); + data_out.add_data_vector(temperature_dof_handler, + temperature_solution, + "T"); data_out.build_patches(std::min(stokes_degree, temperature_degree)); std::ofstream output("solution-" + @@ -1964,8 +1979,10 @@ namespace Step31 temperature_solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_fraction( - triangulation, estimated_error_per_cell, 0.8, 0.1); + GridRefinement::refine_and_coarsen_fixed_fraction(triangulation, + estimated_error_per_cell, + 0.8, + 0.1); if (triangulation.n_levels() > max_grid_level) for (typename Triangulation::active_cell_iterator cell = triangulation.begin_active(max_grid_level); @@ -2167,9 +2184,9 @@ int main(int argc, char *argv[]) argc, argv, numbers::invalid_unsigned_int); // This program can only be run in serial. Otherwise, throw an exception. - AssertThrow( - Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD) == 1, - ExcMessage("This program can only be run in serial, use ./step-31")); + AssertThrow(Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD) == 1, + ExcMessage( + "This program can only be run in serial, use ./step-31")); BoussinesqFlowProblem<2> flow_problem; flow_problem.run(); diff --git a/examples/step-32/step-32.cc b/examples/step-32/step-32.cc index e355b1581e..80a9488193 100644 --- a/examples/step-32/step-32.cc +++ b/examples/step-32/step-32.cc @@ -151,7 +151,8 @@ namespace Step32 class TemperatureInitialValues : public Function { public: - TemperatureInitialValues() : Function(1) + TemperatureInitialValues() + : Function(1) {} virtual double value(const Point & p, @@ -237,12 +238,12 @@ namespace Step32 const TrilinosWrappers::BlockSparseMatrix &Spre, const PreconditionerTypeMp &Mppreconditioner, const PreconditionerTypeA & Apreconditioner, - const bool do_solve_A) : - stokes_matrix(&S), - stokes_preconditioner_matrix(&Spre), - mp_preconditioner(Mppreconditioner), - a_preconditioner(Apreconditioner), - do_solve_A(do_solve_A) + const bool do_solve_A) + : stokes_matrix(&S) + , stokes_preconditioner_matrix(&Spre) + , mp_preconditioner(Mppreconditioner) + , a_preconditioner(Apreconditioner) + , do_solve_A(do_solve_A) {} void vmult(TrilinosWrappers::MPI::BlockVector & dst, @@ -273,8 +274,10 @@ namespace Step32 { SolverControl solver_control(5000, utmp.l2_norm() * 1e-2); TrilinosWrappers::SolverCG solver(solver_control); - solver.solve( - stokes_matrix->block(0, 0), dst.block(0), utmp, a_preconditioner); + solver.solve(stokes_matrix->block(0, 0), + dst.block(0), + utmp, + a_preconditioner); } else a_preconditioner.vmult(dst.block(0), utmp); @@ -361,23 +364,23 @@ namespace Step32 const FiniteElement &stokes_fe, const Quadrature & stokes_quadrature, const Mapping & mapping, - const UpdateFlags update_flags) : - stokes_fe_values(mapping, stokes_fe, stokes_quadrature, update_flags), - grad_phi_u(stokes_fe.dofs_per_cell), - phi_p(stokes_fe.dofs_per_cell) + const UpdateFlags update_flags) + : stokes_fe_values(mapping, stokes_fe, stokes_quadrature, update_flags) + , grad_phi_u(stokes_fe.dofs_per_cell) + , phi_p(stokes_fe.dofs_per_cell) {} template StokesPreconditioner::StokesPreconditioner( - const StokesPreconditioner &scratch) : - stokes_fe_values(scratch.stokes_fe_values.get_mapping(), - scratch.stokes_fe_values.get_fe(), - scratch.stokes_fe_values.get_quadrature(), - scratch.stokes_fe_values.get_update_flags()), - grad_phi_u(scratch.grad_phi_u), - phi_p(scratch.phi_p) + const StokesPreconditioner &scratch) + : stokes_fe_values(scratch.stokes_fe_values.get_mapping(), + scratch.stokes_fe_values.get_fe(), + scratch.stokes_fe_values.get_quadrature(), + scratch.stokes_fe_values.get_update_flags()) + , grad_phi_u(scratch.grad_phi_u) + , phi_p(scratch.phi_p) {} @@ -422,33 +425,34 @@ namespace Step32 const Quadrature & stokes_quadrature, const UpdateFlags stokes_update_flags, const FiniteElement &temperature_fe, - const UpdateFlags temperature_update_flags) : - StokesPreconditioner(stokes_fe, - stokes_quadrature, - mapping, - stokes_update_flags), - temperature_fe_values(mapping, - temperature_fe, - stokes_quadrature, - temperature_update_flags), - phi_u(stokes_fe.dofs_per_cell), - grads_phi_u(stokes_fe.dofs_per_cell), - div_phi_u(stokes_fe.dofs_per_cell), - old_temperature_values(stokes_quadrature.size()) + const UpdateFlags temperature_update_flags) + : StokesPreconditioner(stokes_fe, + stokes_quadrature, + mapping, + stokes_update_flags) + , temperature_fe_values(mapping, + temperature_fe, + stokes_quadrature, + temperature_update_flags) + , phi_u(stokes_fe.dofs_per_cell) + , grads_phi_u(stokes_fe.dofs_per_cell) + , div_phi_u(stokes_fe.dofs_per_cell) + , old_temperature_values(stokes_quadrature.size()) {} template - StokesSystem::StokesSystem(const StokesSystem &scratch) : - StokesPreconditioner(scratch), - temperature_fe_values(scratch.temperature_fe_values.get_mapping(), - scratch.temperature_fe_values.get_fe(), - scratch.temperature_fe_values.get_quadrature(), - scratch.temperature_fe_values.get_update_flags()), - phi_u(scratch.phi_u), - grads_phi_u(scratch.grads_phi_u), - div_phi_u(scratch.div_phi_u), - old_temperature_values(scratch.old_temperature_values) + StokesSystem::StokesSystem(const StokesSystem &scratch) + : StokesPreconditioner(scratch) + , temperature_fe_values( + scratch.temperature_fe_values.get_mapping(), + scratch.temperature_fe_values.get_fe(), + scratch.temperature_fe_values.get_quadrature(), + scratch.temperature_fe_values.get_update_flags()) + , phi_u(scratch.phi_u) + , grads_phi_u(scratch.grads_phi_u) + , div_phi_u(scratch.div_phi_u) + , old_temperature_values(scratch.old_temperature_values) {} @@ -476,26 +480,27 @@ namespace Step32 TemperatureMatrix::TemperatureMatrix( const FiniteElement &temperature_fe, const Mapping & mapping, - const Quadrature & temperature_quadrature) : - temperature_fe_values(mapping, - temperature_fe, - temperature_quadrature, - update_values | update_gradients | - update_JxW_values), - phi_T(temperature_fe.dofs_per_cell), - grad_phi_T(temperature_fe.dofs_per_cell) + const Quadrature & temperature_quadrature) + : temperature_fe_values(mapping, + temperature_fe, + temperature_quadrature, + update_values | update_gradients | + update_JxW_values) + , phi_T(temperature_fe.dofs_per_cell) + , grad_phi_T(temperature_fe.dofs_per_cell) {} template TemperatureMatrix::TemperatureMatrix( - const TemperatureMatrix &scratch) : - temperature_fe_values(scratch.temperature_fe_values.get_mapping(), - scratch.temperature_fe_values.get_fe(), - scratch.temperature_fe_values.get_quadrature(), - scratch.temperature_fe_values.get_update_flags()), - phi_T(scratch.phi_T), - grad_phi_T(scratch.grad_phi_T) + const TemperatureMatrix &scratch) + : temperature_fe_values( + scratch.temperature_fe_values.get_mapping(), + scratch.temperature_fe_values.get_fe(), + scratch.temperature_fe_values.get_quadrature(), + scratch.temperature_fe_values.get_update_flags()) + , phi_T(scratch.phi_T) + , grad_phi_T(scratch.grad_phi_T) {} @@ -546,58 +551,63 @@ namespace Step32 const FiniteElement &temperature_fe, const FiniteElement &stokes_fe, const Mapping & mapping, - const Quadrature & quadrature) : - temperature_fe_values(mapping, - temperature_fe, - quadrature, - update_values | update_gradients | - update_hessians | update_quadrature_points | - update_JxW_values), - stokes_fe_values(mapping, - stokes_fe, - quadrature, - update_values | update_gradients), - phi_T(temperature_fe.dofs_per_cell), - grad_phi_T(temperature_fe.dofs_per_cell), - - old_velocity_values(quadrature.size()), - old_old_velocity_values(quadrature.size()), - old_strain_rates(quadrature.size()), - old_old_strain_rates(quadrature.size()), - - old_temperature_values(quadrature.size()), - old_old_temperature_values(quadrature.size()), - old_temperature_grads(quadrature.size()), - old_old_temperature_grads(quadrature.size()), - old_temperature_laplacians(quadrature.size()), - old_old_temperature_laplacians(quadrature.size()) + const Quadrature & quadrature) + : temperature_fe_values(mapping, + temperature_fe, + quadrature, + update_values | update_gradients | + update_hessians | update_quadrature_points | + update_JxW_values) + , stokes_fe_values(mapping, + stokes_fe, + quadrature, + update_values | update_gradients) + , phi_T(temperature_fe.dofs_per_cell) + , grad_phi_T(temperature_fe.dofs_per_cell) + , + + old_velocity_values(quadrature.size()) + , old_old_velocity_values(quadrature.size()) + , old_strain_rates(quadrature.size()) + , old_old_strain_rates(quadrature.size()) + , + + old_temperature_values(quadrature.size()) + , old_old_temperature_values(quadrature.size()) + , old_temperature_grads(quadrature.size()) + , old_old_temperature_grads(quadrature.size()) + , old_temperature_laplacians(quadrature.size()) + , old_old_temperature_laplacians(quadrature.size()) {} template - TemperatureRHS::TemperatureRHS(const TemperatureRHS &scratch) : - temperature_fe_values(scratch.temperature_fe_values.get_mapping(), - scratch.temperature_fe_values.get_fe(), - scratch.temperature_fe_values.get_quadrature(), - scratch.temperature_fe_values.get_update_flags()), - stokes_fe_values(scratch.stokes_fe_values.get_mapping(), - scratch.stokes_fe_values.get_fe(), - scratch.stokes_fe_values.get_quadrature(), - scratch.stokes_fe_values.get_update_flags()), - phi_T(scratch.phi_T), - grad_phi_T(scratch.grad_phi_T), - - old_velocity_values(scratch.old_velocity_values), - old_old_velocity_values(scratch.old_old_velocity_values), - old_strain_rates(scratch.old_strain_rates), - old_old_strain_rates(scratch.old_old_strain_rates), - - old_temperature_values(scratch.old_temperature_values), - old_old_temperature_values(scratch.old_old_temperature_values), - old_temperature_grads(scratch.old_temperature_grads), - old_old_temperature_grads(scratch.old_old_temperature_grads), - old_temperature_laplacians(scratch.old_temperature_laplacians), - old_old_temperature_laplacians(scratch.old_old_temperature_laplacians) + TemperatureRHS::TemperatureRHS(const TemperatureRHS &scratch) + : temperature_fe_values( + scratch.temperature_fe_values.get_mapping(), + scratch.temperature_fe_values.get_fe(), + scratch.temperature_fe_values.get_quadrature(), + scratch.temperature_fe_values.get_update_flags()) + , stokes_fe_values(scratch.stokes_fe_values.get_mapping(), + scratch.stokes_fe_values.get_fe(), + scratch.stokes_fe_values.get_quadrature(), + scratch.stokes_fe_values.get_update_flags()) + , phi_T(scratch.phi_T) + , grad_phi_T(scratch.grad_phi_T) + , + + old_velocity_values(scratch.old_velocity_values) + , old_old_velocity_values(scratch.old_old_velocity_values) + , old_strain_rates(scratch.old_strain_rates) + , old_old_strain_rates(scratch.old_old_strain_rates) + , + + old_temperature_values(scratch.old_temperature_values) + , old_old_temperature_values(scratch.old_old_temperature_values) + , old_temperature_grads(scratch.old_temperature_grads) + , old_old_temperature_grads(scratch.old_old_temperature_grads) + , old_temperature_laplacians(scratch.old_temperature_laplacians) + , old_old_temperature_laplacians(scratch.old_old_temperature_laplacians) {} } // namespace Scratch @@ -625,16 +635,16 @@ namespace Step32 template StokesPreconditioner::StokesPreconditioner( - const FiniteElement &stokes_fe) : - local_matrix(stokes_fe.dofs_per_cell, stokes_fe.dofs_per_cell), - local_dof_indices(stokes_fe.dofs_per_cell) + const FiniteElement &stokes_fe) + : local_matrix(stokes_fe.dofs_per_cell, stokes_fe.dofs_per_cell) + , local_dof_indices(stokes_fe.dofs_per_cell) {} template StokesPreconditioner::StokesPreconditioner( - const StokesPreconditioner &data) : - local_matrix(data.local_matrix), - local_dof_indices(data.local_dof_indices) + const StokesPreconditioner &data) + : local_matrix(data.local_matrix) + , local_dof_indices(data.local_dof_indices) {} @@ -649,15 +659,15 @@ namespace Step32 }; template - StokesSystem::StokesSystem(const FiniteElement &stokes_fe) : - StokesPreconditioner(stokes_fe), - local_rhs(stokes_fe.dofs_per_cell) + StokesSystem::StokesSystem(const FiniteElement &stokes_fe) + : StokesPreconditioner(stokes_fe) + , local_rhs(stokes_fe.dofs_per_cell) {} template - StokesSystem::StokesSystem(const StokesSystem &data) : - StokesPreconditioner(data), - local_rhs(data.local_rhs) + StokesSystem::StokesSystem(const StokesSystem &data) + : StokesPreconditioner(data) + , local_rhs(data.local_rhs) {} @@ -675,19 +685,19 @@ namespace Step32 template TemperatureMatrix::TemperatureMatrix( - const FiniteElement &temperature_fe) : - local_mass_matrix(temperature_fe.dofs_per_cell, - temperature_fe.dofs_per_cell), - local_stiffness_matrix(temperature_fe.dofs_per_cell, - temperature_fe.dofs_per_cell), - local_dof_indices(temperature_fe.dofs_per_cell) + const FiniteElement &temperature_fe) + : local_mass_matrix(temperature_fe.dofs_per_cell, + temperature_fe.dofs_per_cell) + , local_stiffness_matrix(temperature_fe.dofs_per_cell, + temperature_fe.dofs_per_cell) + , local_dof_indices(temperature_fe.dofs_per_cell) {} template - TemperatureMatrix::TemperatureMatrix(const TemperatureMatrix &data) : - local_mass_matrix(data.local_mass_matrix), - local_stiffness_matrix(data.local_stiffness_matrix), - local_dof_indices(data.local_dof_indices) + TemperatureMatrix::TemperatureMatrix(const TemperatureMatrix &data) + : local_mass_matrix(data.local_mass_matrix) + , local_stiffness_matrix(data.local_stiffness_matrix) + , local_dof_indices(data.local_dof_indices) {} @@ -705,18 +715,18 @@ namespace Step32 template TemperatureRHS::TemperatureRHS( - const FiniteElement &temperature_fe) : - local_rhs(temperature_fe.dofs_per_cell), - local_dof_indices(temperature_fe.dofs_per_cell), - matrix_for_bc(temperature_fe.dofs_per_cell, - temperature_fe.dofs_per_cell) + const FiniteElement &temperature_fe) + : local_rhs(temperature_fe.dofs_per_cell) + , local_dof_indices(temperature_fe.dofs_per_cell) + , matrix_for_bc(temperature_fe.dofs_per_cell, + temperature_fe.dofs_per_cell) {} template - TemperatureRHS::TemperatureRHS(const TemperatureRHS &data) : - local_rhs(data.local_rhs), - local_dof_indices(data.local_dof_indices), - matrix_for_bc(data.matrix_for_bc) + TemperatureRHS::TemperatureRHS(const TemperatureRHS &data) + : local_rhs(data.local_rhs) + , local_dof_indices(data.local_dof_indices) + , matrix_for_bc(data.matrix_for_bc) {} } // namespace CopyData } // namespace Assembly @@ -1000,17 +1010,17 @@ namespace Step32 // the parameters. template BoussinesqFlowProblem::Parameters::Parameters( - const std::string ¶meter_filename) : - end_time(1e8), - initial_global_refinement(2), - initial_adaptive_refinement(2), - adaptive_refinement_interval(10), - stabilization_alpha(2), - stabilization_c_R(0.11), - stabilization_beta(0.078), - stokes_velocity_degree(2), - use_locally_conservative_discretization(true), - temperature_degree(2) + const std::string ¶meter_filename) + : end_time(1e8) + , initial_global_refinement(2) + , initial_adaptive_refinement(2) + , adaptive_refinement_interval(10) + , stabilization_alpha(2) + , stabilization_c_R(0.11) + , stabilization_beta(0.078) + , stokes_velocity_degree(2) + , use_locally_conservative_discretization(true) + , temperature_degree(2) { ParameterHandler prm; BoussinesqFlowProblem::Parameters::declare_parameters(prm); @@ -1191,18 +1201,22 @@ namespace Step32 // manually also request intermediate summaries every so many time steps in // the run() function below. template - BoussinesqFlowProblem::BoussinesqFlowProblem(Parameters ¶meters_) : - parameters(parameters_), - pcout(std::cout, (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)), + BoussinesqFlowProblem::BoussinesqFlowProblem(Parameters ¶meters_) + : parameters(parameters_) + , pcout(std::cout, (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)) + , triangulation(MPI_COMM_WORLD, typename Triangulation::MeshSmoothing( Triangulation::smoothing_on_refinement | - Triangulation::smoothing_on_coarsening)), + Triangulation::smoothing_on_coarsening)) + , - global_Omega_diameter(0.), + global_Omega_diameter(0.) + , - mapping(4), + mapping(4) + , stokes_fe(FE_Q(parameters.stokes_velocity_degree), dim, @@ -1211,20 +1225,24 @@ namespace Step32 FE_DGP(parameters.stokes_velocity_degree - 1)) : static_cast &>( FE_Q(parameters.stokes_velocity_degree - 1))), - 1), + 1) + , - stokes_dof_handler(triangulation), + stokes_dof_handler(triangulation) + , - temperature_fe(parameters.temperature_degree), - temperature_dof_handler(triangulation), + temperature_fe(parameters.temperature_degree) + , temperature_dof_handler(triangulation) + , - time_step(0), - old_time_step(0), - timestep_number(0), - rebuild_stokes_matrix(true), - rebuild_stokes_preconditioner(true), - rebuild_temperature_matrices(true), - rebuild_temperature_preconditioner(true), + time_step(0) + , old_time_step(0) + , timestep_number(0) + , rebuild_stokes_matrix(true) + , rebuild_stokes_preconditioner(true) + , rebuild_temperature_matrices(true) + , rebuild_temperature_preconditioner(true) + , computing_timer(MPI_COMM_WORLD, pcout, @@ -1273,8 +1291,10 @@ namespace Step32 parameters.stokes_velocity_degree); const unsigned int n_q_points = quadrature_formula.size(); - FEValues fe_values( - mapping, stokes_fe, quadrature_formula, update_values); + FEValues fe_values(mapping, + stokes_fe, + quadrature_formula, + update_values); std::vector> velocity_values(n_q_points); const FEValuesExtractors::Vector velocities(0); @@ -1317,8 +1337,10 @@ namespace Step32 parameters.stokes_velocity_degree); const unsigned int n_q_points = quadrature_formula.size(); - FEValues fe_values( - mapping, stokes_fe, quadrature_formula, update_values); + FEValues fe_values(mapping, + stokes_fe, + quadrature_formula, + update_values); std::vector> velocity_values(n_q_points); const FEValuesExtractors::Vector velocities(0); @@ -1379,8 +1401,9 @@ namespace Step32 const QGauss quadrature_formula(parameters.temperature_degree + 1); const unsigned int n_q_points = quadrature_formula.size(); - FEValues fe_values( - temperature_fe, quadrature_formula, update_values | update_JxW_values); + FEValues fe_values(temperature_fe, + quadrature_formula, + update_values | update_JxW_values); std::vector old_temperature_values(n_q_points); std::vector old_old_temperature_values(n_q_points); @@ -1476,8 +1499,10 @@ namespace Step32 parameters.temperature_degree); const unsigned int n_q_points = quadrature_formula.size(); - FEValues fe_values( - mapping, temperature_fe, quadrature_formula, update_values); + FEValues fe_values(mapping, + temperature_fe, + quadrature_formula, + update_values); std::vector old_temperature_values(n_q_points); std::vector old_old_temperature_values(n_q_points); @@ -1735,8 +1760,10 @@ namespace Step32 } } - temperature_constraints.distribute_local_to_global( - cell_vector, local_dof_indices, rhs, matrix_for_bc); + temperature_constraints.distribute_local_to_global(cell_vector, + local_dof_indices, + rhs, + matrix_for_bc); } rhs.compress(VectorOperation::add); @@ -1860,13 +1887,13 @@ namespace Step32 else coupling[c][d] = DoFTools::none; - DoFTools::make_sparsity_pattern( - stokes_dof_handler, - coupling, - sp, - stokes_constraints, - false, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(stokes_dof_handler, + coupling, + sp, + stokes_constraints, + false, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); sp.compress(); stokes_matrix.reinit(sp); @@ -1897,13 +1924,13 @@ namespace Step32 else coupling[c][d] = DoFTools::none; - DoFTools::make_sparsity_pattern( - stokes_dof_handler, - coupling, - sp, - stokes_constraints, - false, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(stokes_dof_handler, + coupling, + sp, + stokes_constraints, + false, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); sp.compress(); stokes_preconditioner_matrix.reinit(sp); @@ -1924,12 +1951,12 @@ namespace Step32 temperature_partitioner, temperature_relevant_partitioner, MPI_COMM_WORLD); - DoFTools::make_sparsity_pattern( - temperature_dof_handler, - sp, - temperature_constraints, - false, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(temperature_dof_handler, + sp, + temperature_constraints, + false, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); sp.compress(); temperature_matrix.reinit(sp); @@ -1999,8 +2026,9 @@ namespace Step32 temperature_dof_handler.distribute_dofs(temperature_fe); std::vector stokes_dofs_per_block(2); - DoFTools::count_dofs_per_block( - stokes_dof_handler, stokes_dofs_per_block, stokes_sub_blocks); + DoFTools::count_dofs_per_block(stokes_dof_handler, + stokes_dofs_per_block, + stokes_sub_blocks); const unsigned int n_u = stokes_dofs_per_block[0], n_p = stokes_dofs_per_block[1], @@ -2116,8 +2144,10 @@ namespace Step32 setup_temperature_matrices(temperature_partitioning, temperature_relevant_partitioning); - stokes_rhs.reinit( - stokes_partitioning, stokes_relevant_partitioning, MPI_COMM_WORLD, true); + stokes_rhs.reinit(stokes_partitioning, + stokes_relevant_partitioning, + MPI_COMM_WORLD, + true); stokes_solution.reinit(stokes_relevant_partitioning, MPI_COMM_WORLD); old_stokes_solution.reinit(stokes_solution); @@ -2215,8 +2245,9 @@ namespace Step32 void BoussinesqFlowProblem::copy_local_to_global_stokes_preconditioner( const Assembly::CopyData::StokesPreconditioner &data) { - stokes_constraints.distribute_local_to_global( - data.local_matrix, data.local_dof_indices, stokes_preconditioner_matrix); + stokes_constraints.distribute_local_to_global(data.local_matrix, + data.local_dof_indices, + stokes_preconditioner_matrix); } @@ -2294,11 +2325,12 @@ namespace Step32 &BoussinesqFlowProblem::copy_local_to_global_stokes_preconditioner, this, std::placeholders::_1), - Assembly::Scratch::StokesPreconditioner( - stokes_fe, - quadrature_formula, - mapping, - update_JxW_values | update_values | update_gradients), + Assembly::Scratch::StokesPreconditioner(stokes_fe, + quadrature_formula, + mapping, + update_JxW_values | + update_values | + update_gradients), Assembly::CopyData::StokesPreconditioner(stokes_fe)); stokes_preconditioner_matrix.compress(VectorOperation::add); @@ -2325,10 +2357,10 @@ namespace Step32 std::vector> constant_modes; FEValuesExtractors::Vector velocity_components(0); - DoFTools::extract_constant_modes( - stokes_dof_handler, - stokes_fe.component_mask(velocity_components), - constant_modes); + DoFTools::extract_constant_modes(stokes_dof_handler, + stokes_fe.component_mask( + velocity_components), + constant_modes); Mp_preconditioner = std::make_shared(); @@ -2445,8 +2477,9 @@ namespace Step32 stokes_matrix, stokes_rhs); else - stokes_constraints.distribute_local_to_global( - data.local_rhs, data.local_dof_indices, stokes_rhs); + stokes_constraints.distribute_local_to_global(data.local_rhs, + data.local_dof_indices, + stokes_rhs); } @@ -2554,8 +2587,9 @@ namespace Step32 void BoussinesqFlowProblem::copy_local_to_global_temperature_matrix( const Assembly::CopyData::TemperatureMatrix &data) { - temperature_constraints.distribute_local_to_global( - data.local_mass_matrix, data.local_dof_indices, temperature_mass_matrix); + temperature_constraints.distribute_local_to_global(data.local_mass_matrix, + data.local_dof_indices, + temperature_mass_matrix); temperature_constraints.distribute_local_to_global( data.local_stiffness_matrix, data.local_dof_indices, @@ -2593,8 +2627,9 @@ namespace Step32 &BoussinesqFlowProblem::copy_local_to_global_temperature_matrix, this, std::placeholders::_1), - Assembly::Scratch::TemperatureMatrix( - temperature_fe, mapping, quadrature_formula), + Assembly::Scratch::TemperatureMatrix(temperature_fe, + mapping, + quadrature_formula), Assembly::CopyData::TemperatureMatrix(temperature_fe)); temperature_mass_matrix.compress(VectorOperation::add); @@ -3084,10 +3119,12 @@ namespace Step32 i < distributed_temperature_solution.local_range().second; ++i) { - temperature[0] = std::min( - temperature[0], distributed_temperature_solution(i)); - temperature[1] = std::max( - temperature[1], distributed_temperature_solution(i)); + temperature[0] = + std::min(temperature[0], + distributed_temperature_solution(i)); + temperature[1] = + std::max(temperature[1], + distributed_temperature_solution(i)); } temperature[0] *= -1.0; @@ -3141,9 +3178,9 @@ namespace Step32 template BoussinesqFlowProblem::Postprocessor::Postprocessor( const unsigned int partition, - const double minimal_pressure) : - partition(partition), - minimal_pressure(minimal_pressure) + const double minimal_pressure) + : partition(partition) + , minimal_pressure(minimal_pressure) {} @@ -3357,9 +3394,9 @@ namespace Step32 MPI_COMM_WORLD); locally_relevant_joint_solution = joint_solution; - Postprocessor postprocessor( - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD), - stokes_solution.block(1).min()); + Postprocessor postprocessor(Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD), + stokes_solution.block(1).min()); DataOut data_out; data_out.attach_dof_handler(joint_dof_handler); diff --git a/examples/step-33/step-33.cc b/examples/step-33/step-33.cc index b17660df0c..3cc345a8a9 100644 --- a/examples/step-33/step-33.cc +++ b/examples/step-33/step-33.cc @@ -452,8 +452,10 @@ namespace Step33 const QMidpoint quadrature_formula; const UpdateFlags update_flags = update_gradients; - FEValues fe_v( - mapping, dof_handler.get_fe(), quadrature_formula, update_flags); + FEValues fe_v(mapping, + dof_handler.get_fe(), + quadrature_formula, + update_flags); std::vector>> dU( 1, std::vector>(n_components)); @@ -542,8 +544,8 @@ namespace Step33 template EulerEquations::Postprocessor::Postprocessor( - const bool do_schlieren_plot) : - do_schlieren_plot(do_schlieren_plot) + const bool do_schlieren_plot) + : do_schlieren_plot(do_schlieren_plot) {} @@ -766,12 +768,18 @@ namespace Step33 Patterns::Selection("gmres|direct"), "The kind of solver for the linear system. " "Choices are ."); - prm.declare_entry( - "residual", "1e-10", Patterns::Double(), "Linear solver residual"); - prm.declare_entry( - "max iters", "300", Patterns::Integer(), "Maximum solver iterations"); - prm.declare_entry( - "ilut fill", "2", Patterns::Double(), "Ilut preconditioner fill"); + prm.declare_entry("residual", + "1e-10", + Patterns::Double(), + "Linear solver residual"); + prm.declare_entry("max iters", + "300", + Patterns::Integer(), + "Maximum solver iterations"); + prm.declare_entry("ilut fill", + "2", + Patterns::Double(), + "Ilut preconditioner fill"); prm.declare_entry("ilut absolute tolerance", "1e-9", Patterns::Double(), @@ -919,8 +927,10 @@ namespace Step33 Patterns::Selection("constant|mesh"), "Whether to use a constant stabilization parameter or " "a mesh-dependent one"); - prm.declare_entry( - "stab value", "1", Patterns::Double(), "alpha stabilization"); + prm.declare_entry("stab value", + "1", + Patterns::Double(), + "alpha stabilization"); } prm.leave_subsection(); } @@ -970,8 +980,10 @@ namespace Step33 "true", Patterns::Bool(), "Whether or not to produce schlieren plots"); - prm.declare_entry( - "step", "-1", Patterns::Double(), "Output once per this period"); + prm.declare_entry("step", + "-1", + Patterns::Double(), + "Output once per this period"); } prm.leave_subsection(); } @@ -1075,8 +1087,8 @@ namespace Step33 template - AllParameters::BoundaryConditions::BoundaryConditions() : - values(EulerEquations::n_components) + AllParameters::BoundaryConditions::BoundaryConditions() + : values(EulerEquations::n_components) { for (unsigned int c = 0; c < EulerEquations::n_components; ++c) kind[c] = EulerEquations::no_penetration_boundary; @@ -1084,21 +1096,23 @@ namespace Step33 template - AllParameters::AllParameters() : - diffusion_power(0.), - time_step(1.), - final_time(1.), - theta(.5), - is_stationary(true), - initial_conditions(EulerEquations::n_components) + AllParameters::AllParameters() + : diffusion_power(0.) + , time_step(1.) + , final_time(1.) + , theta(.5) + , is_stationary(true) + , initial_conditions(EulerEquations::n_components) {} template void AllParameters::declare_parameters(ParameterHandler &prm) { - prm.declare_entry( - "mesh", "grid.inp", Patterns::Anything(), "intput file name"); + prm.declare_entry("mesh", + "grid.inp", + Patterns::Anything(), + "intput file name"); prm.declare_entry("diffusion power", "2.0", @@ -1107,10 +1121,14 @@ namespace Step33 prm.enter_subsection("time stepping"); { - prm.declare_entry( - "time step", "0.1", Patterns::Double(0), "simulation time step"); - prm.declare_entry( - "final time", "10.0", Patterns::Double(0), "simulation end time"); + prm.declare_entry("time step", + "0.1", + Patterns::Double(0), + "simulation time step"); + prm.declare_entry("final time", + "10.0", + Patterns::Double(0), + "simulation end time"); prm.declare_entry("theta scheme value", "0.5", Patterns::Double(0, 1), @@ -1134,11 +1152,11 @@ namespace Step33 for (unsigned int di = 0; di < EulerEquations::n_components; ++di) { - prm.declare_entry( - "w_" + Utilities::int_to_string(di), - "outflow", - Patterns::Selection("inflow|outflow|pressure"), - ""); + prm.declare_entry("w_" + Utilities::int_to_string(di), + "outflow", + Patterns::Selection( + "inflow|outflow|pressure"), + ""); prm.declare_entry("w_" + Utilities::int_to_string(di) + " value", @@ -1356,13 +1374,13 @@ namespace Step33 // There is nothing much to say about the constructor. Essentially, it reads // the input file and fills the parameter object with the parsed values: template - ConservationLaw::ConservationLaw(const char *input_filename) : - mapping(), - fe(FE_Q(1), EulerEquations::n_components), - dof_handler(triangulation), - quadrature(2), - face_quadrature(2), - verbose_cout(std::cout, false) + ConservationLaw::ConservationLaw(const char *input_filename) + : mapping() + , fe(FE_Q(1), EulerEquations::n_components) + , dof_handler(triangulation) + , quadrature(2) + , face_quadrature(2) + , verbose_cout(std::cout, false) { ParameterHandler prm; Parameters::AllParameters::declare_parameters(prm); @@ -1430,15 +1448,23 @@ namespace Step33 update_normal_vectors, neighbor_face_update_flags = update_values; - FEValues fe_v(mapping, fe, quadrature, update_flags); - FEFaceValues fe_v_face( - mapping, fe, face_quadrature, face_update_flags); - FESubfaceValues fe_v_subface( - mapping, fe, face_quadrature, face_update_flags); - FEFaceValues fe_v_face_neighbor( - mapping, fe, face_quadrature, neighbor_face_update_flags); - FESubfaceValues fe_v_subface_neighbor( - mapping, fe, face_quadrature, neighbor_face_update_flags); + FEValues fe_v(mapping, fe, quadrature, update_flags); + FEFaceValues fe_v_face(mapping, + fe, + face_quadrature, + face_update_flags); + FESubfaceValues fe_v_subface(mapping, + fe, + face_quadrature, + face_update_flags); + FEFaceValues fe_v_face_neighbor(mapping, + fe, + face_quadrature, + neighbor_face_update_flags); + FESubfaceValues fe_v_subface_neighbor(mapping, + fe, + face_quadrature, + neighbor_face_update_flags); // Then loop over all cells, initialize the FEValues object for the // current cell and call the function that assembles the problem on this @@ -1574,8 +1600,9 @@ namespace Step33 ExcInternalError()); fe_v_face.reinit(cell, face_no); - fe_v_subface_neighbor.reinit( - neighbor, neighbor_face_no, neighbor_subface_no); + fe_v_subface_neighbor.reinit(neighbor, + neighbor_face_no, + neighbor_subface_no); assemble_face_term(face_no, fe_v_face, @@ -1665,8 +1692,9 @@ namespace Step33 Table<3, Sacado::Fad::DFad> grad_W( n_q_points, EulerEquations::n_components, dim); - Table<3, double> grad_W_old( - n_q_points, EulerEquations::n_components, dim); + Table<3, double> grad_W_old(n_q_points, + EulerEquations::n_components, + dim); std::vector residual_derivatives(dofs_per_cell); @@ -2077,8 +2105,9 @@ namespace Step33 { for (unsigned int k = 0; k < dofs_per_cell; ++k) residual_derivatives[k] = R_i.fastAccessDx(dofs_per_cell + k); - system_matrix.add( - dof_indices[i], dof_indices_neighbor, residual_derivatives); + system_matrix.add(dof_indices[i], + dof_indices_neighbor, + residual_derivatives); } right_hand_side(dof_indices[i]) -= R_i.val(); @@ -2203,8 +2232,10 @@ namespace Step33 void ConservationLaw::compute_refinement_indicators( Vector &refinement_indicators) const { - EulerEquations::compute_refinement_indicators( - dof_handler, mapping, predictor, refinement_indicators); + EulerEquations::compute_refinement_indicators(dof_handler, + mapping, + predictor, + refinement_indicators); } @@ -2357,8 +2388,9 @@ namespace Step33 setup_system(); - VectorTools::interpolate( - dof_handler, parameters.initial_conditions, old_solution); + VectorTools::interpolate(dof_handler, + parameters.initial_conditions, + old_solution); current_solution = old_solution; predictor = old_solution; @@ -2372,8 +2404,9 @@ namespace Step33 setup_system(); - VectorTools::interpolate( - dof_handler, parameters.initial_conditions, old_solution); + VectorTools::interpolate(dof_handler, + parameters.initial_conditions, + old_solution); current_solution = old_solution; predictor = old_solution; } diff --git a/examples/step-34/step-34.cc b/examples/step-34/step-34.cc index d43c6867e0..30a89f590b 100644 --- a/examples/step-34/step-34.cc +++ b/examples/step-34/step-34.cc @@ -315,16 +315,16 @@ namespace Step34 // knowledge of the number of components. template BEMProblem::BEMProblem(const unsigned int fe_degree, - const unsigned int mapping_degree) : - fe(fe_degree), - dh(tria), - mapping(mapping_degree, true), - wind(dim), - singular_quadrature_order(5), - n_cycles(4), - external_refinement(5), - run_in_this_dimension(true), - extend_solution(true) + const unsigned int mapping_degree) + : fe(fe_degree) + , dh(tria) + , mapping(mapping_degree, true) + , wind(dim) + , singular_quadrature_order(5) + , n_cycles(4) + , external_refinement(5) + , run_in_this_dimension(true) + , extend_solution(true) {} @@ -339,8 +339,9 @@ namespace Step34 prm.declare_entry("Number of cycles", "4", Patterns::Integer()); prm.declare_entry("External refinement", "5", Patterns::Integer()); - prm.declare_entry( - "Extend solution on the -2,2 box", "true", Patterns::Bool()); + prm.declare_entry("Extend solution on the -2,2 box", + "true", + Patterns::Bool()); prm.declare_entry("Run 2d simulation", "true", Patterns::Bool()); prm.declare_entry("Run 3d simulation", "true", Patterns::Bool()); @@ -428,9 +429,9 @@ namespace Step34 prm.enter_subsection("Quadrature rules"); { - quadrature = - std::shared_ptr>(new QuadratureSelector( - prm.get("Quadrature type"), prm.get_integer("Quadrature order"))); + quadrature = std::shared_ptr>( + new QuadratureSelector(prm.get("Quadrature type"), + prm.get_integer("Quadrature order"))); singular_quadrature_order = prm.get_integer("Singular quadrature order"); } prm.leave_subsection(); @@ -585,8 +586,9 @@ namespace Step34 // We construct a vector of support points which will be used in the local // integrations: std::vector> support_points(dh.n_dofs()); - DoFTools::map_dofs_to_support_points( - mapping, dh, support_points); + DoFTools::map_dofs_to_support_points(mapping, + dh, + support_points); // After doing so, we can start the integration loop over all cells, where @@ -771,8 +773,10 @@ namespace Step34 difference_per_cell, QGauss<(dim - 1)>(2 * fe.degree + 1), VectorTools::L2_norm); - const double L2_error = VectorTools::compute_global_error( - tria, difference_per_cell, VectorTools::L2_norm); + const double L2_error = + VectorTools::compute_global_error(tria, + difference_per_cell, + VectorTools::L2_norm); // The error in the alpha vector can be computed directly using the // Vector::linfty_norm() function, since on each node, the value should be @@ -872,8 +876,9 @@ namespace Step34 static std::vector> quadratures; if (quadratures.size() == 0) for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) - quadratures.emplace_back( - singular_quadrature_order, fe.get_unit_support_points()[i], true); + quadratures.emplace_back(singular_quadrature_order, + fe.get_unit_support_points()[i], + true); return quadratures[index]; } @@ -948,8 +953,9 @@ namespace Step34 std::vector> local_wind(n_q_points, Vector(dim)); std::vector> external_support_points(external_dh.n_dofs()); - DoFTools::map_dofs_to_support_points( - StaticMappingQ1::mapping, external_dh, external_support_points); + DoFTools::map_dofs_to_support_points(StaticMappingQ1::mapping, + external_dh, + external_support_points); for (cell = dh.begin_active(); cell != endc; ++cell) { diff --git a/examples/step-35/step-35.cc b/examples/step-35/step-35.cc index 4c64b019a9..5725de37c1 100644 --- a/examples/step-35/step-35.cc +++ b/examples/step-35/step-35.cc @@ -116,22 +116,22 @@ namespace Step35 // In the constructor of this class we declare all the parameters. The // details of how this works have been discussed elsewhere, for example in // step-19 and step-29. - Data_Storage::Data_Storage() : - form(METHOD_ROTATIONAL), - initial_time(0.), - final_time(1.), - Reynolds(1.), - dt(5e-4), - n_global_refines(0), - pressure_degree(1), - vel_max_iterations(1000), - vel_Krylov_size(30), - vel_off_diagonals(60), - vel_update_prec(15), - vel_eps(1e-12), - vel_diag_strength(0.01), - verbose(true), - output_interval(15) + Data_Storage::Data_Storage() + : form(METHOD_ROTATIONAL) + , initial_time(0.) + , final_time(1.) + , Reynolds(1.) + , dt(5e-4) + , n_global_refines(0) + , pressure_degree(1) + , vel_max_iterations(1000) + , vel_Krylov_size(30) + , vel_off_diagonals(60) + , vel_update_prec(15) + , vel_eps(1e-12) + , vel_diag_strength(0.01) + , verbose(true) + , output_interval(15) { prm.declare_entry("Method_Form", "rotational", @@ -148,15 +148,19 @@ namespace Step35 "1.", Patterns::Double(0.), " The final time of the simulation. "); - prm.declare_entry( - "Reynolds", "1.", Patterns::Double(0.), " The Reynolds number. "); + prm.declare_entry("Reynolds", + "1.", + Patterns::Double(0.), + " The Reynolds number. "); } prm.leave_subsection(); prm.enter_subsection("Time step data"); { - prm.declare_entry( - "dt", "5e-4", Patterns::Double(0.), " The time step size. "); + prm.declare_entry("dt", + "5e-4", + Patterns::Double(0.), + " The time step size. "); } prm.leave_subsection(); @@ -180,8 +184,10 @@ namespace Step35 "1000", Patterns::Integer(1, 1000), " The maximal number of iterations GMRES must make. "); - prm.declare_entry( - "eps", "1e-12", Patterns::Double(0.), " The stopping criterion. "); + prm.declare_entry("eps", + "1e-12", + Patterns::Double(0.), + " The stopping criterion. "); prm.declare_entry("Krylov_size", "30", Patterns::Integer(1), @@ -295,9 +301,9 @@ namespace Step35 template MultiComponentFunction::MultiComponentFunction( - const double initial_time) : - Function(1, initial_time), - comp(0) + const double initial_time) + : Function(1, initial_time) + , comp(0) {} @@ -327,8 +333,8 @@ namespace Step35 template - Velocity::Velocity(const double initial_time) : - MultiComponentFunction(initial_time) + Velocity::Velocity(const double initial_time) + : MultiComponentFunction(initial_time) {} @@ -375,8 +381,8 @@ namespace Step35 }; template - Pressure::Pressure(const double initial_time) : - Function(1, initial_time) + Pressure::Pressure(const double initial_time) + : Function(1, initial_time) {} @@ -545,13 +551,13 @@ namespace Step35 InitGradPerTaskData(const unsigned int dd, const unsigned int vdpc, - const unsigned int pdpc) : - d(dd), - vel_dpc(vdpc), - pres_dpc(pdpc), - local_grad(vdpc, pdpc), - vel_local_dof_indices(vdpc), - pres_local_dof_indices(pdpc) + const unsigned int pdpc) + : d(dd) + , vel_dpc(vdpc) + , pres_dpc(pdpc) + , local_grad(vdpc, pdpc) + , vel_local_dof_indices(vdpc) + , pres_local_dof_indices(pdpc) {} }; @@ -564,19 +570,19 @@ namespace Step35 const FE_Q & fe_p, const QGauss &quad, const UpdateFlags flags_v, - const UpdateFlags flags_p) : - nqp(quad.size()), - fe_val_vel(fe_v, quad, flags_v), - fe_val_pres(fe_p, quad, flags_p) + const UpdateFlags flags_p) + : nqp(quad.size()) + , fe_val_vel(fe_v, quad, flags_v) + , fe_val_pres(fe_p, quad, flags_p) {} - InitGradScratchData(const InitGradScratchData &data) : - nqp(data.nqp), - fe_val_vel(data.fe_val_vel.get_fe(), - data.fe_val_vel.get_quadrature(), - data.fe_val_vel.get_update_flags()), - fe_val_pres(data.fe_val_pres.get_fe(), - data.fe_val_pres.get_quadrature(), - data.fe_val_pres.get_update_flags()) + InitGradScratchData(const InitGradScratchData &data) + : nqp(data.nqp) + , fe_val_vel(data.fe_val_vel.get_fe(), + data.fe_val_vel.get_quadrature(), + data.fe_val_vel.get_update_flags()) + , fe_val_pres(data.fe_val_pres.get_fe(), + data.fe_val_pres.get_quadrature(), + data.fe_val_pres.get_update_flags()) {} }; @@ -594,9 +600,9 @@ namespace Step35 { FullMatrix local_advection; std::vector local_dof_indices; - AdvectionPerTaskData(const unsigned int dpc) : - local_advection(dpc, dpc), - local_dof_indices(dpc) + AdvectionPerTaskData(const unsigned int dpc) + : local_advection(dpc, dpc) + , local_dof_indices(dpc) {} }; @@ -610,24 +616,24 @@ namespace Step35 FEValues fe_val; AdvectionScratchData(const FE_Q & fe, const QGauss &quad, - const UpdateFlags flags) : - nqp(quad.size()), - dpc(fe.dofs_per_cell), - u_star_local(nqp), - grad_u_star(nqp), - u_star_tmp(nqp), - fe_val(fe, quad, flags) + const UpdateFlags flags) + : nqp(quad.size()) + , dpc(fe.dofs_per_cell) + , u_star_local(nqp) + , grad_u_star(nqp) + , u_star_tmp(nqp) + , fe_val(fe, quad, flags) {} - AdvectionScratchData(const AdvectionScratchData &data) : - nqp(data.nqp), - dpc(data.dpc), - u_star_local(nqp), - grad_u_star(nqp), - u_star_tmp(nqp), - fe_val(data.fe_val.get_fe(), - data.fe_val.get_quadrature(), - data.fe_val.get_update_flags()) + AdvectionScratchData(const AdvectionScratchData &data) + : nqp(data.nqp) + , dpc(data.dpc) + , u_star_local(nqp) + , grad_u_star(nqp) + , u_star_tmp(nqp) + , fe_val(data.fe_val.get_fe(), + data.fe_val.get_quadrature(), + data.fe_val.get_update_flags()) {} }; @@ -658,26 +664,26 @@ namespace Step35 // triangulation and load the initial data. template NavierStokesProjection::NavierStokesProjection( - const RunTimeParameters::Data_Storage &data) : - type(data.form), - deg(data.pressure_degree), - dt(data.dt), - t_0(data.initial_time), - T(data.final_time), - Re(data.Reynolds), - vel_exact(data.initial_time), - fe_velocity(deg + 1), - fe_pressure(deg), - dof_handler_velocity(triangulation), - dof_handler_pressure(triangulation), - quadrature_pressure(deg + 1), - quadrature_velocity(deg + 2), - vel_max_its(data.vel_max_iterations), - vel_Krylov_size(data.vel_Krylov_size), - vel_off_diagonals(data.vel_off_diagonals), - vel_update_prec(data.vel_update_prec), - vel_eps(data.vel_eps), - vel_diag_strength(data.vel_diag_strength) + const RunTimeParameters::Data_Storage &data) + : type(data.form) + , deg(data.pressure_degree) + , dt(data.dt) + , t_0(data.initial_time) + , T(data.final_time) + , Re(data.Reynolds) + , vel_exact(data.initial_time) + , fe_velocity(deg + 1) + , fe_pressure(deg) + , dof_handler_velocity(triangulation) + , dof_handler_pressure(triangulation) + , quadrature_pressure(deg + 1) + , quadrature_velocity(deg + 2) + , vel_max_its(data.vel_max_iterations) + , vel_Krylov_size(data.vel_Krylov_size) + , vel_off_diagonals(data.vel_off_diagonals) + , vel_update_prec(data.vel_update_prec) + , vel_eps(data.vel_eps) + , vel_diag_strength(data.vel_diag_strength) { if (deg < 1) std::cout @@ -772,11 +778,13 @@ namespace Step35 { vel_exact.set_time(t_0); vel_exact.set_component(d); - VectorTools::interpolate( - dof_handler_velocity, Functions::ZeroFunction(), u_n_minus_1[d]); + VectorTools::interpolate(dof_handler_velocity, + Functions::ZeroFunction(), + u_n_minus_1[d]); vel_exact.advance_time(dt); - VectorTools::interpolate( - dof_handler_velocity, Functions::ZeroFunction(), u_n[d]); + VectorTools::interpolate(dof_handler_velocity, + Functions::ZeroFunction(), + u_n[d]); } } @@ -811,10 +819,12 @@ namespace Step35 vel_Laplace.reinit(sparsity_pattern_velocity); vel_Advection.reinit(sparsity_pattern_velocity); - MatrixCreator::create_mass_matrix( - dof_handler_velocity, quadrature_velocity, vel_Mass); - MatrixCreator::create_laplace_matrix( - dof_handler_velocity, quadrature_velocity, vel_Laplace); + MatrixCreator::create_mass_matrix(dof_handler_velocity, + quadrature_velocity, + vel_Mass); + MatrixCreator::create_laplace_matrix(dof_handler_velocity, + quadrature_velocity, + vel_Laplace); } // The initialization of the matrices that act on the pressure space is @@ -833,10 +843,12 @@ namespace Step35 pres_iterative.reinit(sparsity_pattern_pressure); pres_Mass.reinit(sparsity_pattern_pressure); - MatrixCreator::create_laplace_matrix( - dof_handler_pressure, quadrature_pressure, pres_Laplace); - MatrixCreator::create_mass_matrix( - dof_handler_pressure, quadrature_pressure, pres_Mass); + MatrixCreator::create_laplace_matrix(dof_handler_pressure, + quadrature_pressure, + pres_Laplace); + MatrixCreator::create_mass_matrix(dof_handler_pressure, + quadrature_pressure, + pres_Mass); } @@ -853,13 +865,15 @@ namespace Step35 { DynamicSparsityPattern dsp(dof_handler_velocity.n_dofs(), dof_handler_pressure.n_dofs()); - DoFTools::make_sparsity_pattern( - dof_handler_velocity, dof_handler_pressure, dsp); + DoFTools::make_sparsity_pattern(dof_handler_velocity, + dof_handler_pressure, + dsp); sparsity_pattern_pres_vel.copy_from(dsp); } - InitGradPerTaskData per_task_data( - 0, fe_velocity.dofs_per_cell, fe_pressure.dofs_per_cell); + InitGradPerTaskData per_task_data(0, + fe_velocity.dofs_per_cell, + fe_pressure.dofs_per_cell); InitGradScratchData scratch_data(fe_velocity, fe_pressure, quadrature_velocity, @@ -1064,8 +1078,10 @@ namespace Step35 Assert(false, ExcNotImplemented()); } } - MatrixTools::apply_boundary_values( - boundary_values, vel_it_matrix[d], u_n[d], force[d]); + MatrixTools::apply_boundary_values(boundary_values, + vel_it_matrix[d], + u_n[d], + force[d]); } @@ -1193,8 +1209,10 @@ namespace Step35 static std::map bval; if (reinit_prec) - VectorTools::interpolate_boundary_values( - dof_handler_pressure, 3, Functions::ZeroFunction(), bval); + VectorTools::interpolate_boundary_values(dof_handler_pressure, + 3, + Functions::ZeroFunction(), + bval); MatrixTools::apply_boundary_values(bval, pres_iterative, phi_n, pres_tmp); diff --git a/examples/step-36/step-36.cc b/examples/step-36/step-36.cc index 0cda4133ad..8f607d5451 100644 --- a/examples/step-36/step-36.cc +++ b/examples/step-36/step-36.cc @@ -118,9 +118,9 @@ namespace Step36 // their values from the input file whose name is specified as an argument // to this function: template - EigenvalueProblem::EigenvalueProblem(const std::string &prm_file) : - fe(1), - dof_handler(triangulation) + EigenvalueProblem::EigenvalueProblem(const std::string &prm_file) + : fe(1) + , dof_handler(triangulation) { // TODO investigate why the minimum number of refinement steps required to // obtain the correct eigenvalue degeneracies is 6 @@ -293,10 +293,12 @@ namespace Step36 // into the global objects and take care of zero boundary constraints: cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_stiffness_matrix, local_dof_indices, stiffness_matrix); - constraints.distribute_local_to_global( - cell_mass_matrix, local_dof_indices, mass_matrix); + constraints.distribute_local_to_global(cell_stiffness_matrix, + local_dof_indices, + stiffness_matrix); + constraints.distribute_local_to_global(cell_mass_matrix, + local_dof_indices, + mass_matrix); } // At the end of the function, we tell PETSc that the matrices have now @@ -479,9 +481,9 @@ int main(int argc, char **argv) // This program can only be run in serial. Otherwise, throw an exception. - AssertThrow( - Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD) == 1, - ExcMessage("This program can only be run in serial, use ./step-36")); + AssertThrow(Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD) == 1, + ExcMessage( + "This program can only be run in serial, use ./step-36")); EigenvalueProblem<2> problem("step-36.prm"); problem.run(); diff --git a/examples/step-37/step-37.cc b/examples/step-37/step-37.cc index 553bebe2ad..006096c392 100644 --- a/examples/step-37/step-37.cc +++ b/examples/step-37/step-37.cc @@ -91,7 +91,8 @@ namespace Step37 class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double value(const Point & p, @@ -283,8 +284,9 @@ namespace Step37 // class that asserts that this class cannot go out of scope while still in // use in e.g. a preconditioner. template - LaplaceOperator::LaplaceOperator() : - MatrixFreeOperators::Base>() + LaplaceOperator::LaplaceOperator() + : MatrixFreeOperators::Base>() {} @@ -570,8 +572,10 @@ namespace Step37 this->inverse_diagonal_entries->get_vector(); this->data->initialize_dof_vector(inverse_diagonal); unsigned int dummy = 0; - this->data->cell_loop( - &LaplaceOperator::local_compute_diagonal, this, inverse_diagonal, dummy); + this->data->cell_loop(&LaplaceOperator::local_compute_diagonal, + this, + inverse_diagonal, + dummy); this->set_constrained_entries_to_one(inverse_diagonal); @@ -743,19 +747,23 @@ namespace Step37 // convergence of the geometric multigrid routines. For the distributed // grid, we also need to specifically enable the multigrid hierarchy. template - LaplaceProblem::LaplaceProblem() : + LaplaceProblem::LaplaceProblem() + : #ifdef DEAL_II_WITH_P4EST triangulation( MPI_COMM_WORLD, Triangulation::limit_level_difference_at_vertices, - parallel::distributed::Triangulation::construct_multigrid_hierarchy), + parallel::distributed::Triangulation::construct_multigrid_hierarchy) + , #else - triangulation(Triangulation::limit_level_difference_at_vertices), + triangulation(Triangulation::limit_level_difference_at_vertices) + , #endif - fe(degree_finite_element), - dof_handler(triangulation), - setup_time(0.), - pcout(std::cout, Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0), + fe(degree_finite_element) + , dof_handler(triangulation) + , setup_time(0.) + , pcout(std::cout, Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) + , // The LaplaceProblem class holds an additional output stream that // collects detailed timings about the setup phase. This stream, called // time_details, is disabled by default through the @p false argument @@ -818,8 +826,10 @@ namespace Step37 constraints.clear(); constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); setup_time += time.wall_time(); time_details << "Distribute DoFs & B.C. (CPU/wall) " << time.cpu_time() @@ -834,8 +844,10 @@ namespace Step37 (update_gradients | update_JxW_values | update_quadrature_points); std::shared_ptr> system_mf_storage( new MatrixFree()); - system_mf_storage->reinit( - dof_handler, constraints, QGauss<1>(fe.degree + 1), additional_data); + system_mf_storage->reinit(dof_handler, + constraints, + QGauss<1>(fe.degree + 1), + additional_data); system_matrix.initialize(system_mf_storage); } @@ -870,8 +882,9 @@ namespace Step37 for (unsigned int level = 0; level < nlevels; ++level) { IndexSet relevant_dofs; - DoFTools::extract_locally_relevant_level_dofs( - dof_handler, level, relevant_dofs); + DoFTools::extract_locally_relevant_level_dofs(dof_handler, + level, + relevant_dofs); ConstraintMatrix level_constraints; level_constraints.reinit(relevant_dofs); level_constraints.add_lines( @@ -891,8 +904,9 @@ namespace Step37 QGauss<1>(fe.degree + 1), additional_data); - mg_matrices[level].initialize( - mg_mf_storage_level, mg_constrained_dofs, level); + mg_matrices[level].initialize(mg_mf_storage_level, + mg_constrained_dofs, + level); mg_matrices[level].evaluate_coefficient(Coefficient()); } setup_time += time.wall_time(); diff --git a/examples/step-38/step-38.cc b/examples/step-38/step-38.cc index 2111e554ad..441e10ec62 100644 --- a/examples/step-38/step-38.cc +++ b/examples/step-38/step-38.cc @@ -139,7 +139,8 @@ namespace Step38 class Solution : public Function { public: - Solution() : Function() + Solution() + : Function() {} virtual double value(const Point & p, @@ -199,7 +200,8 @@ namespace Step38 class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double value(const Point & p, @@ -256,10 +258,10 @@ namespace Step38 // DoF handler to the triangulation: template LaplaceBeltramiProblem::LaplaceBeltramiProblem( - const unsigned degree) : - fe(degree), - dof_handler(triangulation), - mapping(degree) + const unsigned degree) + : fe(degree) + , dof_handler(triangulation) + , mapping(degree) {} @@ -313,8 +315,9 @@ namespace Step38 std::set boundary_ids; boundary_ids.insert(0); - GridGenerator::extract_boundary_mesh( - volume_mesh, triangulation, boundary_ids); + GridGenerator::extract_boundary_mesh(volume_mesh, + triangulation, + boundary_ids); } triangulation.set_all_manifold_ids(0); triangulation.set_manifold(0, SphericalManifold()); @@ -404,8 +407,9 @@ namespace Step38 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -505,8 +509,9 @@ namespace Step38 QGauss(2 * fe.degree + 1), VectorTools::H1_norm); - double h1_error = VectorTools::compute_global_error( - triangulation, difference_per_cell, VectorTools::H1_norm); + double h1_error = VectorTools::compute_global_error(triangulation, + difference_per_cell, + VectorTools::H1_norm); std::cout << "H1 error = " << h1_error << std::endl; } diff --git a/examples/step-39/step-39.cc b/examples/step-39/step-39.cc index e6fe82a8e8..e16bee4156 100644 --- a/examples/step-39/step-39.cc +++ b/examples/step-39/step-39.cc @@ -505,12 +505,12 @@ namespace Step39 // FiniteElement is provided as a parameter to allow flexibility. template InteriorPenaltyProblem::InteriorPenaltyProblem( - const FiniteElement &fe) : - triangulation(Triangulation::limit_level_difference_at_vertices), - mapping(), - fe(fe), - dof_handler(triangulation), - estimates(1) + const FiniteElement &fe) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , mapping() + , fe(fe) + , dof_handler(triangulation) + , estimates(1) { GridGenerator::hyper_cube_slit(triangulation, -1, 1); } @@ -796,8 +796,9 @@ namespace Step39 MeshWorker::IntegrationInfoBox 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 + 1, n_gauss_points); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points + 1, + n_gauss_points); // but now we need to notify the info box of the finite element function we // want to evaluate in the quadrature points. First, we create an AnyData @@ -869,8 +870,9 @@ namespace Step39 MeshWorker::IntegrationInfoBox 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 + 1, n_gauss_points); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points + 1, + n_gauss_points); AnyData solution_data; solution_data.add *>(&solution, "solution"); diff --git a/examples/step-4/step-4.cc b/examples/step-4/step-4.cc index 10c220502b..d2f07ce163 100644 --- a/examples/step-4/step-4.cc +++ b/examples/step-4/step-4.cc @@ -134,7 +134,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double value(const Point & p, @@ -147,7 +148,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double value(const Point & p, @@ -232,7 +234,9 @@ double BoundaryValues::value(const Point &p, // and associates the DoFHandler to the triangulation just as in the previous // example program, step-3: template -Step4::Step4() : fe(1), dof_handler(triangulation) +Step4::Step4() + : fe(1) + , dof_handler(triangulation) {} @@ -397,8 +401,9 @@ void Step4::assemble_system() 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -411,10 +416,14 @@ void Step4::assemble_system() // object of the class which describes the boundary values we would like to // use (i.e. the BoundaryValues class declared above): std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/examples/step-40/step-40.cc b/examples/step-40/step-40.cc index 8b463427b1..98794c8e70 100644 --- a/examples/step-40/step-40.cc +++ b/examples/step-40/step-40.cc @@ -200,19 +200,20 @@ namespace Step40 // use to determine how much compute time the different parts of the program // take: template - LaplaceProblem::LaplaceProblem() : - mpi_communicator(MPI_COMM_WORLD), - triangulation(mpi_communicator, - typename Triangulation::MeshSmoothing( - Triangulation::smoothing_on_refinement | - Triangulation::smoothing_on_coarsening)), - dof_handler(triangulation), - fe(2), - pcout(std::cout, (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)), - computing_timer(mpi_communicator, - pcout, - TimerOutput::summary, - TimerOutput::wall_times) + LaplaceProblem::LaplaceProblem() + : mpi_communicator(MPI_COMM_WORLD) + , triangulation(mpi_communicator, + typename Triangulation::MeshSmoothing( + Triangulation::smoothing_on_refinement | + Triangulation::smoothing_on_coarsening)) + , dof_handler(triangulation) + , fe(2) + , pcout(std::cout, + (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)) + , computing_timer(mpi_communicator, + pcout, + TimerOutput::summary, + TimerOutput::wall_times) {} @@ -268,8 +269,9 @@ namespace Step40 // locally owned cells (of course the linear solvers will read from it, // but they do not care about the geometric location of degrees of // freedom). - locally_relevant_solution.reinit( - locally_owned_dofs, locally_relevant_dofs, mpi_communicator); + locally_relevant_solution.reinit(locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); system_rhs.reinit(locally_owned_dofs, mpi_communicator); // The next step is to compute hanging node and boundary value @@ -293,8 +295,10 @@ namespace Step40 constraints.clear(); constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); // The last part of this function deals with initializing the matrix with @@ -328,8 +332,10 @@ namespace Step40 mpi_communicator, locally_relevant_dofs); - system_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, dsp, mpi_communicator); + system_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + dsp, + mpi_communicator); } diff --git a/examples/step-41/step-41.cc b/examples/step-41/step-41.cc index 96f6e9167b..9f1a684563 100644 --- a/examples/step-41/step-41.cc +++ b/examples/step-41/step-41.cc @@ -122,7 +122,8 @@ namespace Step41 class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double value(const Point & p, @@ -145,7 +146,8 @@ namespace Step41 class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double value(const Point & p, @@ -170,7 +172,8 @@ namespace Step41 class Obstacle : public Function { public: - Obstacle() : Function() + Obstacle() + : Function() {} virtual double value(const Point & p, @@ -204,7 +207,9 @@ namespace Step41 // To everyone who has taken a look at the first few tutorial programs, the // constructor is completely obvious: template - ObstacleProblem::ObstacleProblem() : fe(1), dof_handler(triangulation) + ObstacleProblem::ObstacleProblem() + : fe(1) + , dof_handler(triangulation) {} @@ -242,8 +247,10 @@ namespace Step41 << std::endl << std::endl; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); DynamicSparsityPattern dsp(dof_handler.n_dofs()); @@ -368,8 +375,9 @@ namespace Step41 Assert(fe.degree == 1, ExcNotImplemented()); const QTrapez quadrature_formula; - FEValues fe_values( - fe, quadrature_formula, update_values | update_JxW_values); + FEValues fe_values(fe, + quadrature_formula, + update_values | update_JxW_values); const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); @@ -394,8 +402,9 @@ namespace Step41 cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, mass_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + mass_matrix); } } @@ -528,8 +537,10 @@ namespace Step41 // In a final step, we add to the set of constraints on DoFs we have so // far from the active set those that result from Dirichlet boundary // values, and close the constraints object: - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); } @@ -659,9 +670,9 @@ int main(int argc, char *argv[]) argc, argv, numbers::invalid_unsigned_int); // This program can only be run in serial. Otherwise, throw an exception. - AssertThrow( - Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD) == 1, - ExcMessage("This program can only be run in serial, use ./step-41")); + AssertThrow(Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD) == 1, + ExcMessage( + "This program can only be run in serial, use ./step-41")); ObstacleProblem<2> obstacle_problem; obstacle_problem.run(); diff --git a/examples/step-42/step-42.cc b/examples/step-42/step-42.cc index c2a4d335f2..9ceafbe03e 100644 --- a/examples/step-42/step-42.cc +++ b/examples/step-42/step-42.cc @@ -151,19 +151,19 @@ namespace Step42 ConstitutiveLaw::ConstitutiveLaw(double E, double nu, double sigma_0, - double gamma) : - kappa(E / (3 * (1 - 2 * nu))), - mu(E / (2 * (1 + nu))), - sigma_0(sigma_0), - gamma(gamma), - stress_strain_tensor_kappa(kappa * - outer_product(unit_symmetric_tensor(), - unit_symmetric_tensor())), - stress_strain_tensor_mu( - 2 * mu * - (identity_tensor() - outer_product(unit_symmetric_tensor(), - unit_symmetric_tensor()) / - 3.0)) + double gamma) + : kappa(E / (3 * (1 - 2 * nu))) + , mu(E / (2 * (1 + nu))) + , sigma_0(sigma_0) + , gamma(gamma) + , stress_strain_tensor_kappa(kappa * + outer_product(unit_symmetric_tensor(), + unit_symmetric_tensor())) + , stress_strain_tensor_mu( + 2 * mu * + (identity_tensor() - outer_product(unit_symmetric_tensor(), + unit_symmetric_tensor()) / + 3.0)) {} @@ -286,7 +286,8 @@ namespace Step42 }; template - BoundaryForce::BoundaryForce() : Function(dim) + BoundaryForce::BoundaryForce() + : Function(dim) {} @@ -322,7 +323,8 @@ namespace Step42 template - BoundaryValues::BoundaryValues() : Function(dim) + BoundaryValues::BoundaryValues() + : Function(dim) {} @@ -371,9 +373,9 @@ namespace Step42 template - SphereObstacle::SphereObstacle(const double z_surface) : - Function(dim), - z_surface(z_surface) + SphereObstacle::SphereObstacle(const double z_surface) + : Function(dim) + , z_surface(z_surface) {} @@ -452,16 +454,17 @@ namespace Step42 // The constructor of this class reads in the data that describes // the obstacle from the given file name. template - BitmapFile::BitmapFile(const std::string &name) : - obstacle_data(0), - hx(0), - hy(0), - nx(0), - ny(0) + BitmapFile::BitmapFile(const std::string &name) + : obstacle_data(0) + , hx(0) + , hy(0) + , nx(0) + , ny(0) { std::ifstream f(name); - AssertThrow( - f, ExcMessage(std::string("Can't read from file <") + name + ">!")); + AssertThrow(f, + ExcMessage(std::string("Can't read from file <") + name + + ">!")); std::string temp; f >> temp >> nx >> ny; @@ -548,10 +551,10 @@ namespace Step42 template ChineseObstacle::ChineseObstacle(const std::string &filename, - const double z_surface) : - Function(dim), - input_obstacle(filename), - z_surface(z_surface) + const double z_surface) + : Function(dim) + , input_obstacle(filename) + , z_surface(z_surface) {} @@ -816,40 +819,45 @@ namespace Step42 // creating such a directory if necessary. template PlasticityContactProblem::PlasticityContactProblem( - const ParameterHandler &prm) : - mpi_communicator(MPI_COMM_WORLD), - pcout(std::cout, (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)), - computing_timer(MPI_COMM_WORLD, - pcout, - TimerOutput::never, - TimerOutput::wall_times), + const ParameterHandler &prm) + : mpi_communicator(MPI_COMM_WORLD) + , pcout(std::cout, + (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)) + , computing_timer(MPI_COMM_WORLD, + pcout, + TimerOutput::never, + TimerOutput::wall_times) + , n_initial_global_refinements( - prm.get_integer("number of initial refinements")), - triangulation(mpi_communicator), - fe_degree(prm.get_integer("polynomial degree")), - fe(FE_Q(QGaussLobatto<1>(fe_degree + 1)), dim), - dof_handler(triangulation), - - e_modulus(200000), - nu(0.3), - gamma(0.01), - sigma_0(400.0), - constitutive_law(e_modulus, nu, sigma_0, gamma), - - base_mesh(prm.get("base mesh")), - obstacle(prm.get("obstacle") == "read from file" ? - static_cast *>( - new EquationData::ChineseObstacle( - "obstacle.pbm", - (base_mesh == "box" ? 1.0 : 0.5))) : - static_cast *>( - new EquationData::SphereObstacle( - base_mesh == "box" ? 1.0 : 0.5))), - - transfer_solution(prm.get_bool("transfer solution")), - n_refinement_cycles(prm.get_integer("number of cycles")), - current_refinement_cycle(0) + prm.get_integer("number of initial refinements")) + , triangulation(mpi_communicator) + , fe_degree(prm.get_integer("polynomial degree")) + , fe(FE_Q(QGaussLobatto<1>(fe_degree + 1)), dim) + , dof_handler(triangulation) + , + + e_modulus(200000) + , nu(0.3) + , gamma(0.01) + , sigma_0(400.0) + , constitutive_law(e_modulus, nu, sigma_0, gamma) + , + + base_mesh(prm.get("base mesh")) + , obstacle(prm.get("obstacle") == "read from file" ? + static_cast *>( + new EquationData::ChineseObstacle( + "obstacle.pbm", + (base_mesh == "box" ? 1.0 : 0.5))) : + static_cast *>( + new EquationData::SphereObstacle( + base_mesh == "box" ? 1.0 : 0.5))) + , + + transfer_solution(prm.get_bool("transfer solution")) + , n_refinement_cycles(prm.get_integer("number of cycles")) + , current_refinement_cycle(0) { std::string strat = prm.get("refinement strategy"); @@ -1040,12 +1048,12 @@ namespace Step42 TrilinosWrappers::SparsityPattern sp(locally_owned_dofs, mpi_communicator); - DoFTools::make_sparsity_pattern( - dof_handler, - sp, - constraints_dirichlet_and_hanging_nodes, - false, - Utilities::MPI::this_mpi_process(mpi_communicator)); + DoFTools::make_sparsity_pattern(dof_handler, + sp, + constraints_dirichlet_and_hanging_nodes, + false, + Utilities::MPI::this_mpi_process( + mpi_communicator)); sp.compress(); newton_matrix.reinit(sp); @@ -1147,8 +1155,9 @@ namespace Step42 { QGaussLobatto face_quadrature_formula(fe.degree + 1); - FEFaceValues fe_values_face( - fe, face_quadrature_formula, update_values | update_JxW_values); + FEFaceValues fe_values_face(fe, + face_quadrature_formula, + update_values | update_JxW_values); const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int n_face_q_points = face_quadrature_formula.size(); @@ -1244,8 +1253,9 @@ namespace Step42 // looping over quadrature points is equivalent to looping over shape // functions defined on a face. With this, the code looks as follows: Quadrature face_quadrature(fe.get_unit_face_support_points()); - FEFaceValues fe_values_face( - fe, face_quadrature, update_quadrature_points); + FEFaceValues fe_values_face(fe, + face_quadrature, + update_quadrature_points); const unsigned int dofs_per_face = fe.dofs_per_face; const unsigned int n_face_q_points = face_quadrature.size(); @@ -1666,8 +1676,9 @@ namespace Step42 TimerOutput::Scope t(computing_timer, "Solve: setup preconditioner"); std::vector> constant_modes; - DoFTools::extract_constant_modes( - dof_handler, ComponentMask(), constant_modes); + DoFTools::extract_constant_modes(dof_handler, + ComponentMask(), + constant_modes); TrilinosWrappers::PreconditionAMG::AdditionalData additional_data; additional_data.constant_modes = constant_modes; @@ -1693,8 +1704,10 @@ namespace Step42 SolverControl solver_control(newton_matrix.m(), solver_tolerance); SolverBicgstab solver(solver_control); - solver.solve( - newton_matrix, distributed_solution, newton_rhs, preconditioner); + solver.solve(newton_matrix, + distributed_solution, + newton_rhs, + preconditioner); pcout << " Error: " << solver_control.initial_value() << " -> " << solver_control.last_value() << " in " @@ -2133,8 +2146,9 @@ namespace Step42 double contact_force = 0.0; QGauss face_quadrature_formula(fe.degree + 1); - FEFaceValues fe_values_face( - fe, face_quadrature_formula, update_values | update_JxW_values); + FEFaceValues fe_values_face(fe, + face_quadrature_formula, + update_values | update_JxW_values); const unsigned int n_face_q_points = face_quadrature_formula.size(); diff --git a/examples/step-43/step-43.cc b/examples/step-43/step-43.cc index 77b836dbeb..39b06eaabe 100644 --- a/examples/step-43/step-43.cc +++ b/examples/step-43/step-43.cc @@ -87,7 +87,8 @@ namespace Step43 class PressureRightHandSide : public Function { public: - PressureRightHandSide() : Function(1) + PressureRightHandSide() + : Function(1) {} virtual double value(const Point & p, @@ -109,7 +110,8 @@ namespace Step43 class PressureBoundaryValues : public Function { public: - PressureBoundaryValues() : Function(1) + PressureBoundaryValues() + : Function(1) {} virtual double value(const Point & p, @@ -130,7 +132,8 @@ namespace Step43 class SaturationBoundaryValues : public Function { public: - SaturationBoundaryValues() : Function(1) + SaturationBoundaryValues() + : Function(1) {} virtual double value(const Point & p, @@ -155,7 +158,8 @@ namespace Step43 class SaturationInitialValues : public Function { public: - SaturationInitialValues() : Function(1) + SaturationInitialValues() + : Function(1) {} virtual double value(const Point & p, @@ -194,7 +198,8 @@ namespace Step43 class KInverse : public TensorFunction<2, dim> { public: - KInverse() : TensorFunction<2, dim>() + KInverse() + : TensorFunction<2, dim>() {} virtual void value_list(const std::vector> &points, @@ -234,7 +239,8 @@ namespace Step43 class KInverse : public TensorFunction<2, dim> { public: - KInverse() : TensorFunction<2, dim>() + KInverse() + : TensorFunction<2, dim>() {} virtual void @@ -370,9 +376,9 @@ namespace Step43 template InverseMatrix::InverseMatrix( const MatrixType & m, - const PreconditionerType &preconditioner) : - matrix(&m), - preconditioner(preconditioner) + const PreconditionerType &preconditioner) + : matrix(&m) + , preconditioner(preconditioner) {} @@ -430,11 +436,11 @@ namespace Step43 const TrilinosWrappers::BlockSparseMatrix &S, const InverseMatrix &Mpinv, - const PreconditionerTypeA & Apreconditioner) : - darcy_matrix(&S), - m_inverse(&Mpinv), - a_preconditioner(Apreconditioner), - tmp(complete_index_set(darcy_matrix->block(1, 1).m())) + const PreconditionerTypeA & Apreconditioner) + : darcy_matrix(&S) + , m_inverse(&Mpinv) + , a_preconditioner(Apreconditioner) + , tmp(complete_index_set(darcy_matrix->block(1, 1).m())) {} @@ -614,32 +620,38 @@ namespace Step43 // stepping variables related to operator splitting as well as the option // for matrix assembly and preconditioning: template - TwoPhaseFlowProblem::TwoPhaseFlowProblem(const unsigned int degree) : - triangulation(Triangulation::maximum_smoothing), - global_Omega_diameter(std::numeric_limits::quiet_NaN()), - degree(degree), - darcy_degree(degree), - darcy_fe(FE_Q(darcy_degree + 1), dim, FE_Q(darcy_degree), 1), - darcy_dof_handler(triangulation), - - saturation_degree(degree + 1), - saturation_fe(saturation_degree), - saturation_dof_handler(triangulation), - - saturation_refinement_threshold(0.5), - - time(0), - end_time(10), - - current_macro_time_step(0), - old_macro_time_step(0), - - time_step(0), - old_time_step(0), - timestep_number(0), - viscosity(0.2), - porosity(1.0), - AOS_threshold(3.0), + TwoPhaseFlowProblem::TwoPhaseFlowProblem(const unsigned int degree) + : triangulation(Triangulation::maximum_smoothing) + , global_Omega_diameter(std::numeric_limits::quiet_NaN()) + , degree(degree) + , darcy_degree(degree) + , darcy_fe(FE_Q(darcy_degree + 1), dim, FE_Q(darcy_degree), 1) + , darcy_dof_handler(triangulation) + , + + saturation_degree(degree + 1) + , saturation_fe(saturation_degree) + , saturation_dof_handler(triangulation) + , + + saturation_refinement_threshold(0.5) + , + + time(0) + , end_time(10) + , + + current_macro_time_step(0) + , old_macro_time_step(0) + , + + time_step(0) + , old_time_step(0) + , timestep_number(0) + , viscosity(0.2) + , porosity(1.0) + , AOS_threshold(3.0) + , rebuild_saturation_matrix(true) {} @@ -704,18 +716,19 @@ namespace Step43 DoFTools::make_hanging_node_constraints(darcy_dof_handler, darcy_preconditioner_constraints); - DoFTools::make_zero_boundary_constraints( - darcy_dof_handler, - darcy_preconditioner_constraints, - darcy_fe.component_mask(pressure)); + DoFTools::make_zero_boundary_constraints(darcy_dof_handler, + darcy_preconditioner_constraints, + darcy_fe.component_mask( + pressure)); darcy_preconditioner_constraints.close(); } std::vector darcy_dofs_per_block(2); - DoFTools::count_dofs_per_block( - darcy_dof_handler, darcy_dofs_per_block, darcy_block_component); + DoFTools::count_dofs_per_block(darcy_dof_handler, + darcy_dofs_per_block, + darcy_block_component); const unsigned int n_u = darcy_dofs_per_block[0], n_p = darcy_dofs_per_block[1], n_s = saturation_dof_handler.n_dofs(); @@ -788,8 +801,10 @@ namespace Step43 DynamicSparsityPattern dsp(n_s, n_s); - DoFTools::make_sparsity_pattern( - saturation_dof_handler, dsp, saturation_constraints, false); + DoFTools::make_sparsity_pattern(saturation_dof_handler, + dsp, + saturation_constraints, + false); saturation_matrix.reinit(dsp); @@ -878,8 +893,9 @@ namespace Step43 update_JxW_values | update_values | update_gradients | update_quadrature_points); - FEValues saturation_fe_values( - saturation_fe, quadrature_formula, update_values); + FEValues saturation_fe_values(saturation_fe, + quadrature_formula, + update_values); const unsigned int dofs_per_cell = darcy_fe.dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); @@ -1017,14 +1033,16 @@ namespace Step43 update_quadrature_points | update_JxW_values); - FEValues saturation_fe_values( - saturation_fe, quadrature_formula, update_values); + FEValues saturation_fe_values(saturation_fe, + quadrature_formula, + update_values); - FEFaceValues darcy_fe_face_values( - darcy_fe, - face_quadrature_formula, - update_values | update_normal_vectors | update_quadrature_points | - update_JxW_values); + FEFaceValues darcy_fe_face_values(darcy_fe, + face_quadrature_formula, + update_values | + update_normal_vectors | + update_quadrature_points | + update_JxW_values); const unsigned int dofs_per_cell = darcy_fe.dofs_per_cell; @@ -1217,8 +1235,9 @@ namespace Step43 { QGauss quadrature_formula(saturation_degree + 2); - FEValues saturation_fe_values( - saturation_fe, quadrature_formula, update_values | update_JxW_values); + FEValues saturation_fe_values(saturation_fe, + quadrature_formula, + update_values | update_JxW_values); const unsigned int dofs_per_cell = saturation_fe.dofs_per_cell; @@ -1251,8 +1270,9 @@ namespace Step43 } cell->get_dof_indices(local_dof_indices); - saturation_constraints.distribute_local_to_global( - local_matrix, local_dof_indices, saturation_matrix); + saturation_constraints.distribute_local_to_global(local_matrix, + local_dof_indices, + saturation_matrix); } } @@ -1293,13 +1313,15 @@ namespace Step43 update_quadrature_points | update_JxW_values); FEValues darcy_fe_values(darcy_fe, quadrature_formula, update_values); - FEFaceValues saturation_fe_face_values( - saturation_fe, - face_quadrature_formula, - update_values | update_normal_vectors | update_quadrature_points | - update_JxW_values); - FEFaceValues darcy_fe_face_values( - darcy_fe, face_quadrature_formula, update_values); + FEFaceValues saturation_fe_face_values(saturation_fe, + face_quadrature_formula, + update_values | + update_normal_vectors | + update_quadrature_points | + update_JxW_values); + FEFaceValues darcy_fe_face_values(darcy_fe, + face_quadrature_formula, + update_values); FEFaceValues saturation_fe_face_values_neighbor( saturation_fe, face_quadrature_formula, update_values); @@ -1421,8 +1443,9 @@ namespace Step43 saturation_fe_values.JxW(q); } - saturation_constraints.distribute_local_to_global( - local_rhs, local_dof_indices, saturation_rhs); + saturation_constraints.distribute_local_to_global(local_rhs, + local_dof_indices, + saturation_rhs); } @@ -1481,8 +1504,9 @@ namespace Step43 saturation_fe_face_values.shape_value(i, q) * saturation_fe_face_values.JxW(q); } - saturation_constraints.distribute_local_to_global( - local_rhs, local_dof_indices, saturation_rhs); + saturation_constraints.distribute_local_to_global(local_rhs, + local_dof_indices, + saturation_rhs); } @@ -1626,8 +1650,10 @@ namespace Step43 TrilinosWrappers::PreconditionIC preconditioner; preconditioner.initialize(saturation_matrix); - cg.solve( - saturation_matrix, saturation_solution, saturation_rhs, preconditioner); + cg.solve(saturation_matrix, + saturation_solution, + saturation_rhs, + preconditioner); saturation_constraints.distribute(saturation_solution); project_back_saturation(); @@ -1655,9 +1681,10 @@ namespace Step43 { Vector refinement_indicators(triangulation.n_active_cells()); { - const QMidpoint quadrature_formula; - FEValues fe_values( - saturation_fe, quadrature_formula, update_gradients); + const QMidpoint quadrature_formula; + FEValues fe_values(saturation_fe, + quadrature_formula, + update_gradients); std::vector> grad_saturation(1); TrilinosWrappers::MPI::Vector extrapolated_saturation_solution( @@ -1911,10 +1938,10 @@ namespace Step43 for (unsigned int q = 0; q < n_q_points; ++q) { - const double mobility_reciprocal_difference = - std::fabs(mobility_inverse(present_saturation[q], viscosity) - - mobility_inverse( - old_saturation_after_solving_pressure[q], viscosity)); + const double mobility_reciprocal_difference = std::fabs( + mobility_inverse(present_saturation[q], viscosity) - + mobility_inverse(old_saturation_after_solving_pressure[q], + viscosity)); max_local_mobility_reciprocal_difference = std::max(max_local_mobility_reciprocal_difference, @@ -1973,8 +2000,9 @@ namespace Step43 const unsigned int n_q_points = quadrature_formula.size(); FEValues darcy_fe_values(darcy_fe, quadrature_formula, update_values); - FEValues saturation_fe_values( - saturation_fe, quadrature_formula, update_values); + FEValues saturation_fe_values(saturation_fe, + quadrature_formula, + update_values); std::vector> darcy_solution_values(n_q_points, Vector(dim + 1)); @@ -2161,9 +2189,10 @@ namespace Step43 std::pow(global_Omega_diameter, alpha - 2.); return (beta * - (max_velocity_times_dF_dS)*std::min( - cell_diameter, - std::pow(cell_diameter, alpha) * max_residual / global_scaling)); + (max_velocity_times_dF_dS)*std::min(cell_diameter, + std::pow(cell_diameter, alpha) * + max_residual / + global_scaling)); } @@ -2257,9 +2286,9 @@ int main(int argc, char *argv[]) argc, argv, numbers::invalid_unsigned_int); // This program can only be run in serial. Otherwise, throw an exception. - AssertThrow( - Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD) == 1, - ExcMessage("This program can only be run in serial, use ./step-43")); + AssertThrow(Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD) == 1, + ExcMessage( + "This program can only be run in serial, use ./step-43")); TwoPhaseFlowProblem<2> two_phase_flow_problem(1); two_phase_flow_problem.run(); diff --git a/examples/step-44/step-44.cc b/examples/step-44/step-44.cc index 68dee4f6d9..648ba82827 100644 --- a/examples/step-44/step-44.cc +++ b/examples/step-44/step-44.cc @@ -215,8 +215,10 @@ namespace Step44 Patterns::Double(-1.0, 0.5), "Poisson's ratio"); - prm.declare_entry( - "Shear modulus", "80.194e6", Patterns::Double(), "Shear modulus"); + prm.declare_entry("Shear modulus", + "80.194e6", + Patterns::Double(), + "Shear modulus"); } prm.leave_subsection(); } @@ -370,8 +372,10 @@ namespace Step44 { prm.declare_entry("End time", "1", Patterns::Double(), "End time"); - prm.declare_entry( - "Time step size", "0.1", Patterns::Double(), "Time step size"); + prm.declare_entry("Time step size", + "0.1", + Patterns::Double(), + "Time step size"); } prm.leave_subsection(); } @@ -442,11 +446,11 @@ namespace Step44 class Time { public: - Time(const double time_end, const double delta_t) : - timestep(0), - time_current(0.0), - time_end(time_end), - delta_t(delta_t) + Time(const double time_end, const double delta_t) + : timestep(0) + , time_current(0.0) + , time_end(time_end) + , delta_t(delta_t) {} virtual ~Time() @@ -515,14 +519,13 @@ namespace Step44 class Material_Compressible_Neo_Hook_Three_Field { public: - Material_Compressible_Neo_Hook_Three_Field(const double mu, - const double nu) : - kappa((2.0 * mu * (1.0 + nu)) / (3.0 * (1.0 - 2.0 * nu))), - c_1(mu / 2.0), - det_F(1.0), - p_tilde(0.0), - J_tilde(1.0), - b_bar(Physics::Elasticity::StandardTensors::I) + Material_Compressible_Neo_Hook_Three_Field(const double mu, const double nu) + : kappa((2.0 * mu * (1.0 + nu)) / (3.0 * (1.0 - 2.0 * nu))) + , c_1(mu / 2.0) + , det_F(1.0) + , p_tilde(0.0) + , J_tilde(1.0) + , b_bar(Physics::Elasticity::StandardTensors::I) { Assert(kappa > 0, ExcInternalError()); } @@ -682,12 +685,12 @@ namespace Step44 class PointHistory { public: - PointHistory() : - F_inv(Physics::Elasticity::StandardTensors::I), - tau(SymmetricTensor<2, dim>()), - d2Psi_vol_dJ2(0.0), - dPsi_vol_dJ(0.0), - Jc(SymmetricTensor<4, dim>()) + PointHistory() + : F_inv(Physics::Elasticity::StandardTensors::I) + , tau(SymmetricTensor<2, dim>()) + , d2Psi_vol_dJ2(0.0) + , dPsi_vol_dJ(0.0) + , Jc(SymmetricTensor<4, dim>()) {} virtual ~PointHistory() @@ -988,7 +991,11 @@ namespace Step44 // normalization factors. struct Errors { - Errors() : norm(1.0), u(1.0), p(1.0), J(1.0) + Errors() + : norm(1.0) + , u(1.0) + , p(1.0) + , J(1.0) {} void reset() @@ -1039,13 +1046,14 @@ namespace Step44 // We initialize the Solid class using data extracted from the parameter file. template - Solid::Solid(const std::string &input_file) : - parameters(input_file), - vol_reference(0.), - triangulation(Triangulation::maximum_smoothing), - time(parameters.end_time, parameters.delta_t), - timer(std::cout, TimerOutput::summary, TimerOutput::wall_times), - degree(parameters.poly_degree), + Solid::Solid(const std::string &input_file) + : parameters(input_file) + , vol_reference(0.) + , triangulation(Triangulation::maximum_smoothing) + , time(parameters.end_time, parameters.delta_t) + , timer(std::cout, TimerOutput::summary, TimerOutput::wall_times) + , degree(parameters.poly_degree) + , // The Finite Element System is composed of dim continuous displacement // DOFs, and discontinuous pressure and dilatation DOFs. In an attempt to // satisfy the Babuska-Brezzi or LBB stability conditions (see Hughes @@ -1059,17 +1067,18 @@ namespace Step44 FE_DGPMonomial(parameters.poly_degree - 1), 1, // pressure FE_DGPMonomial(parameters.poly_degree - 1), - 1), // dilatation - dof_handler_ref(triangulation), - dofs_per_cell(fe.dofs_per_cell), - u_fe(first_u_component), - p_fe(p_component), - J_fe(J_component), - dofs_per_block(n_blocks), - qf_cell(parameters.quad_order), - qf_face(parameters.quad_order), - n_q_points(qf_cell.size()), - n_q_points_f(qf_face.size()) + 1) + , // dilatation + dof_handler_ref(triangulation) + , dofs_per_cell(fe.dofs_per_cell) + , u_fe(first_u_component) + , p_fe(p_component) + , J_fe(J_component) + , dofs_per_block(n_blocks) + , qf_cell(parameters.quad_order) + , qf_face(parameters.quad_order) + , n_q_points(qf_cell.size()) + , n_q_points_f(qf_face.size()) { Assert(dim == 2 || dim == 3, ExcMessage("This problem only works in 2 or 3 space dimensions.")); @@ -1175,9 +1184,9 @@ namespace Step44 FullMatrix cell_matrix; std::vector local_dof_indices; - PerTaskData_K(const unsigned int dofs_per_cell) : - cell_matrix(dofs_per_cell, dofs_per_cell), - local_dof_indices(dofs_per_cell) + PerTaskData_K(const unsigned int dofs_per_cell) + : cell_matrix(dofs_per_cell, dofs_per_cell) + , local_dof_indices(dofs_per_cell) {} void reset() @@ -1202,22 +1211,23 @@ namespace Step44 ScratchData_K(const FiniteElement &fe_cell, const QGauss & qf_cell, - const UpdateFlags uf_cell) : - fe_values_ref(fe_cell, qf_cell, uf_cell), - Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)), - grad_Nx(qf_cell.size(), - std::vector>(fe_cell.dofs_per_cell)), - symm_grad_Nx(qf_cell.size(), - std::vector>(fe_cell.dofs_per_cell)) + const UpdateFlags uf_cell) + : fe_values_ref(fe_cell, qf_cell, uf_cell) + , Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)) + , grad_Nx(qf_cell.size(), + std::vector>(fe_cell.dofs_per_cell)) + , symm_grad_Nx(qf_cell.size(), + std::vector>( + fe_cell.dofs_per_cell)) {} - ScratchData_K(const ScratchData_K &rhs) : - fe_values_ref(rhs.fe_values_ref.get_fe(), - rhs.fe_values_ref.get_quadrature(), - rhs.fe_values_ref.get_update_flags()), - Nx(rhs.Nx), - grad_Nx(rhs.grad_Nx), - symm_grad_Nx(rhs.symm_grad_Nx) + ScratchData_K(const ScratchData_K &rhs) + : fe_values_ref(rhs.fe_values_ref.get_fe(), + rhs.fe_values_ref.get_quadrature(), + rhs.fe_values_ref.get_update_flags()) + , Nx(rhs.Nx) + , grad_Nx(rhs.grad_Nx) + , symm_grad_Nx(rhs.symm_grad_Nx) {} void reset() @@ -1250,9 +1260,9 @@ namespace Step44 Vector cell_rhs; std::vector local_dof_indices; - PerTaskData_RHS(const unsigned int dofs_per_cell) : - cell_rhs(dofs_per_cell), - local_dof_indices(dofs_per_cell) + PerTaskData_RHS(const unsigned int dofs_per_cell) + : cell_rhs(dofs_per_cell) + , local_dof_indices(dofs_per_cell) {} void reset() @@ -1275,23 +1285,24 @@ namespace Step44 const QGauss & qf_cell, const UpdateFlags uf_cell, const QGauss & qf_face, - const UpdateFlags uf_face) : - fe_values_ref(fe_cell, qf_cell, uf_cell), - fe_face_values_ref(fe_cell, qf_face, uf_face), - Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)), - symm_grad_Nx(qf_cell.size(), - std::vector>(fe_cell.dofs_per_cell)) + const UpdateFlags uf_face) + : fe_values_ref(fe_cell, qf_cell, uf_cell) + , fe_face_values_ref(fe_cell, qf_face, uf_face) + , Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)) + , symm_grad_Nx(qf_cell.size(), + std::vector>( + fe_cell.dofs_per_cell)) {} - ScratchData_RHS(const ScratchData_RHS &rhs) : - fe_values_ref(rhs.fe_values_ref.get_fe(), - rhs.fe_values_ref.get_quadrature(), - rhs.fe_values_ref.get_update_flags()), - fe_face_values_ref(rhs.fe_face_values_ref.get_fe(), - rhs.fe_face_values_ref.get_quadrature(), - rhs.fe_face_values_ref.get_update_flags()), - Nx(rhs.Nx), - symm_grad_Nx(rhs.symm_grad_Nx) + ScratchData_RHS(const ScratchData_RHS &rhs) + : fe_values_ref(rhs.fe_values_ref.get_fe(), + rhs.fe_values_ref.get_quadrature(), + rhs.fe_values_ref.get_update_flags()) + , fe_face_values_ref(rhs.fe_face_values_ref.get_fe(), + rhs.fe_face_values_ref.get_quadrature(), + rhs.fe_face_values_ref.get_update_flags()) + , Nx(rhs.Nx) + , symm_grad_Nx(rhs.symm_grad_Nx) {} void reset() @@ -1341,18 +1352,18 @@ namespace Step44 PerTaskData_SC(const unsigned int dofs_per_cell, const unsigned int n_u, const unsigned int n_p, - const unsigned int n_J) : - cell_matrix(dofs_per_cell, dofs_per_cell), - local_dof_indices(dofs_per_cell), - k_orig(dofs_per_cell, dofs_per_cell), - k_pu(n_p, n_u), - k_pJ(n_p, n_J), - k_JJ(n_J, n_J), - k_pJ_inv(n_p, n_J), - k_bbar(n_u, n_u), - A(n_J, n_u), - B(n_J, n_u), - C(n_p, n_u) + const unsigned int n_J) + : cell_matrix(dofs_per_cell, dofs_per_cell) + , local_dof_indices(dofs_per_cell) + , k_orig(dofs_per_cell, dofs_per_cell) + , k_pu(n_p, n_u) + , k_pJ(n_p, n_J) + , k_JJ(n_J, n_J) + , k_pJ_inv(n_p, n_J) + , k_bbar(n_u, n_u) + , A(n_J, n_u) + , B(n_J, n_u) + , C(n_p, n_u) {} void reset() @@ -1413,22 +1424,22 @@ namespace Step44 ScratchData_UQPH(const FiniteElement & fe_cell, const QGauss & qf_cell, const UpdateFlags uf_cell, - const BlockVector &solution_total) : - solution_total(solution_total), - solution_grads_u_total(qf_cell.size()), - solution_values_p_total(qf_cell.size()), - solution_values_J_total(qf_cell.size()), - fe_values_ref(fe_cell, qf_cell, uf_cell) + const BlockVector &solution_total) + : solution_total(solution_total) + , solution_grads_u_total(qf_cell.size()) + , solution_values_p_total(qf_cell.size()) + , solution_values_J_total(qf_cell.size()) + , fe_values_ref(fe_cell, qf_cell, uf_cell) {} - ScratchData_UQPH(const ScratchData_UQPH &rhs) : - solution_total(rhs.solution_total), - solution_grads_u_total(rhs.solution_grads_u_total), - solution_values_p_total(rhs.solution_values_p_total), - solution_values_J_total(rhs.solution_values_J_total), - fe_values_ref(rhs.fe_values_ref.get_fe(), - rhs.fe_values_ref.get_quadrature(), - rhs.fe_values_ref.get_update_flags()) + ScratchData_UQPH(const ScratchData_UQPH &rhs) + : solution_total(rhs.solution_total) + , solution_grads_u_total(rhs.solution_grads_u_total) + , solution_values_p_total(rhs.solution_values_p_total) + , solution_values_J_total(rhs.solution_values_J_total) + , fe_values_ref(rhs.fe_values_ref.get_fe(), + rhs.fe_values_ref.get_quadrature(), + rhs.fe_values_ref.get_update_flags()) {} void reset() @@ -1520,8 +1531,9 @@ namespace Step44 dof_handler_ref.distribute_dofs(fe); DoFRenumbering::Cuthill_McKee(dof_handler_ref); DoFRenumbering::component_wise(dof_handler_ref, block_component); - DoFTools::count_dofs_per_block( - dof_handler_ref, dofs_per_block, block_component); + DoFTools::count_dofs_per_block(dof_handler_ref, + dofs_per_block, + block_component); std::cout << "Triangulation:" << "\n\t Number of active cells: " @@ -1650,8 +1662,9 @@ namespace Step44 { std::cout << " Setting up quadrature point data..." << std::endl; - quadrature_point_history.initialize( - triangulation.begin_active(), triangulation.end(), n_q_points); + quadrature_point_history.initialize(triangulation.begin_active(), + triangulation.end(), + n_q_points); // Next we setup the initial quadrature point data. // Note that when the quadrature point data is retrieved, @@ -2779,19 +2792,23 @@ namespace Step44 // extract $\mathsf{\mathbf{k}}$ // for the dofs associated with // the current element - data.k_orig.extract_submatrix_from( - tangent_matrix, data.local_dof_indices, data.local_dof_indices); + data.k_orig.extract_submatrix_from(tangent_matrix, + data.local_dof_indices, + data.local_dof_indices); // and next the local matrices for // $\mathsf{\mathbf{k}}_{ \widetilde{p} u}$ // $\mathsf{\mathbf{k}}_{ \widetilde{p} \widetilde{J}}$ // and // $\mathsf{\mathbf{k}}_{ \widetilde{J} \widetilde{J}}$: - data.k_pu.extract_submatrix_from( - data.k_orig, element_indices_p, element_indices_u); - data.k_pJ.extract_submatrix_from( - data.k_orig, element_indices_p, element_indices_J); - data.k_JJ.extract_submatrix_from( - data.k_orig, element_indices_J, element_indices_J); + data.k_pu.extract_submatrix_from(data.k_orig, + element_indices_p, + element_indices_u); + data.k_pJ.extract_submatrix_from(data.k_orig, + element_indices_p, + element_indices_J); + data.k_JJ.extract_submatrix_from(data.k_orig, + element_indices_J, + element_indices_J); // To get the inverse of $\mathsf{\mathbf{k}}_{\widetilde{p} // \widetilde{J}}$, we invert it directly. This operation is relatively @@ -2837,8 +2854,9 @@ namespace Step44 // \mathsf{\mathbf{k}}_{\widetilde{p} u} // $ data.k_pu.Tmmult(data.k_bbar, data.C); - data.k_bbar.scatter_matrix_to( - element_indices_u, element_indices_u, data.cell_matrix); + data.k_bbar.scatter_matrix_to(element_indices_u, + element_indices_u, + data.cell_matrix); // Next we place // $\mathsf{\mathbf{k}}^{-1}_{ \widetilde{p} \widetilde{J}}$ @@ -2848,8 +2866,9 @@ namespace Step44 // that we need to remove the // contribution that already exists there. data.k_pJ_inv.add(-1.0, data.k_pJ); - data.k_pJ_inv.scatter_matrix_to( - element_indices_p, element_indices_J, data.cell_matrix); + data.k_pJ_inv.scatter_matrix_to(element_indices_p, + element_indices_J, + data.cell_matrix); } // @sect4{Solid::solve_linear_system} @@ -3304,8 +3323,10 @@ namespace Step44 SolverSelector> solver_K_con_inv; solver_K_con_inv.select("cg"); solver_K_con_inv.set_control(solver_control_K_con_inv); - const auto K_uu_con_inv = inverse_operator( - K_uu_con, solver_K_con_inv, preconditioner_K_con_inv); + const auto K_uu_con_inv = + inverse_operator(K_uu_con, + solver_K_con_inv, + preconditioner_K_con_inv); // Now we are in a position to solve for the displacement field. // We can nest the linear operations, and the result is immediately diff --git a/examples/step-45/step-45.cc b/examples/step-45/step-45.cc index 9157bea022..a971228999 100644 --- a/examples/step-45/step-45.cc +++ b/examples/step-45/step-45.cc @@ -115,7 +115,8 @@ namespace Step45 class BoundaryValues : public Function { public: - BoundaryValues() : Function(dim + 1) + BoundaryValues() + : Function(dim + 1) {} virtual double value(const Point & p, @@ -151,7 +152,8 @@ namespace Step45 class RightHandSide : public Function { public: - RightHandSide() : Function(dim + 1) + RightHandSide() + : Function(dim + 1) {} virtual double value(const Point & p, @@ -212,11 +214,11 @@ namespace Step45 const MatrixType & m, const PreconditionerType &preconditioner, const IndexSet & locally_owned, - const MPI_Comm & mpi_communicator) : - matrix(&m), - preconditioner(&preconditioner), - mpi_communicator(&mpi_communicator), - tmp(locally_owned, mpi_communicator) + const MPI_Comm & mpi_communicator) + : matrix(&m) + , preconditioner(&preconditioner) + , mpi_communicator(&mpi_communicator) + , tmp(locally_owned, mpi_communicator) {} @@ -266,11 +268,11 @@ namespace Step45 const InverseMatrix & A_inverse, const IndexSet &owned_vel, - const MPI_Comm &mpi_communicator) : - system_matrix(&system_matrix), - A_inverse(&A_inverse), - tmp1(owned_vel, mpi_communicator), - tmp2(tmp1) + const MPI_Comm &mpi_communicator) + : system_matrix(&system_matrix) + , A_inverse(&A_inverse) + , tmp1(owned_vel, mpi_communicator) + , tmp2(tmp1) {} @@ -288,14 +290,14 @@ namespace Step45 template - StokesProblem::StokesProblem(const unsigned int degree) : - degree(degree), - mpi_communicator(MPI_COMM_WORLD), - triangulation(mpi_communicator), - fe(FE_Q(degree + 1), dim, FE_Q(degree), 1), - dof_handler(triangulation), - pcout(std::cout, Utilities::MPI::this_mpi_process(mpi_communicator) == 0), - mapping(degree + 1) + StokesProblem::StokesProblem(const unsigned int degree) + : degree(degree) + , mpi_communicator(MPI_COMM_WORLD) + , triangulation(mpi_communicator) + , fe(FE_Q(degree + 1), dim, FE_Q(degree), 1) + , dof_handler(triangulation) + , pcout(std::cout, Utilities::MPI::this_mpi_process(mpi_communicator) == 0) + , mapping(degree + 1) {} // @endcond // @@ -364,8 +366,9 @@ namespace Step45 DoFRenumbering::component_wise(dof_handler, block_component); std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block( - dof_handler, dofs_per_block, block_component); + DoFTools::count_dofs_per_block(dof_handler, + dofs_per_block, + block_component); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; { @@ -487,12 +490,12 @@ namespace Step45 relevant_partitioning, mpi_communicator); - DoFTools::make_sparsity_pattern( - dof_handler, - bsp, - constraints, - false, - Utilities::MPI::this_mpi_process(mpi_communicator)); + DoFTools::make_sparsity_pattern(dof_handler, + bsp, + constraints, + false, + Utilities::MPI::this_mpi_process( + mpi_communicator)); bsp.compress(); @@ -500,8 +503,9 @@ namespace Step45 } system_rhs.reinit(owned_partitioning, mpi_communicator); - solution.reinit( - owned_partitioning, relevant_partitioning, mpi_communicator); + solution.reinit(owned_partitioning, + relevant_partitioning, + mpi_communicator); } // The rest of the program is then again identical to step-22. We will omit diff --git a/examples/step-46/step-46.cc b/examples/step-46/step-46.cc index e4253fdfa8..945239a67d 100644 --- a/examples/step-46/step-46.cc +++ b/examples/step-46/step-46.cc @@ -160,7 +160,8 @@ namespace Step46 class StokesBoundaryValues : public Function { public: - StokesBoundaryValues() : Function(dim + 1 + dim) + StokesBoundaryValues() + : Function(dim + 1 + dim) {} virtual double value(const Point & p, @@ -207,7 +208,8 @@ namespace Step46 class RightHandSide : public Function { public: - RightHandSide() : Function(dim + 1) + RightHandSide() + : Function(dim + 1) {} virtual double value(const Point & p, @@ -252,26 +254,26 @@ namespace Step46 template FluidStructureProblem::FluidStructureProblem( const unsigned int stokes_degree, - const unsigned int elasticity_degree) : - stokes_degree(stokes_degree), - elasticity_degree(elasticity_degree), - triangulation(Triangulation::maximum_smoothing), - stokes_fe(FE_Q(stokes_degree + 1), - dim, - FE_Q(stokes_degree), - 1, - FE_Nothing(), - dim), - elasticity_fe(FE_Nothing(), - dim, - FE_Nothing(), - 1, - FE_Q(elasticity_degree), - dim), - dof_handler(triangulation), - viscosity(2), - lambda(1), - mu(1) + const unsigned int elasticity_degree) + : stokes_degree(stokes_degree) + , elasticity_degree(elasticity_degree) + , triangulation(Triangulation::maximum_smoothing) + , stokes_fe(FE_Q(stokes_degree + 1), + dim, + FE_Q(stokes_degree), + 1, + FE_Nothing(), + dim) + , elasticity_fe(FE_Nothing(), + dim, + FE_Nothing(), + 1, + FE_Q(elasticity_degree), + dim) + , dof_handler(triangulation) + , viscosity(2) + , lambda(1) + , mu(1) { fe_collection.push_back(stokes_fe); fe_collection.push_back(elasticity_fe); @@ -384,12 +386,12 @@ namespace Step46 DoFTools::make_hanging_node_constraints(dof_handler, constraints); const FEValuesExtractors::Vector velocities(0); - VectorTools::interpolate_boundary_values( - dof_handler, - 1, - StokesBoundaryValues(), - constraints, - fe_collection.component_mask(velocities)); + VectorTools::interpolate_boundary_values(dof_handler, + 1, + StokesBoundaryValues(), + constraints, + fe_collection.component_mask( + velocities)); const FEValuesExtractors::Vector displacements(dim + 1); VectorTools::interpolate_boundary_values( @@ -477,8 +479,10 @@ namespace Step46 face_coupling[c][d] = DoFTools::always; } - DoFTools::make_flux_sparsity_pattern( - dof_handler, dsp, cell_coupling, face_coupling); + DoFTools::make_flux_sparsity_pattern(dof_handler, + dsp, + cell_coupling, + face_coupling); constraints.condense(dsp); sparsity_pattern.copy_from(dsp); } @@ -521,18 +525,22 @@ namespace Step46 const QGauss common_face_quadrature( std::max(stokes_degree + 2, elasticity_degree + 2)); - FEFaceValues stokes_fe_face_values( - stokes_fe, - common_face_quadrature, - update_JxW_values | update_normal_vectors | update_gradients); - FEFaceValues elasticity_fe_face_values( - elasticity_fe, common_face_quadrature, update_values); - FESubfaceValues stokes_fe_subface_values( - stokes_fe, - common_face_quadrature, - update_JxW_values | update_normal_vectors | update_gradients); - FESubfaceValues elasticity_fe_subface_values( - elasticity_fe, common_face_quadrature, update_values); + FEFaceValues stokes_fe_face_values(stokes_fe, + common_face_quadrature, + update_JxW_values | + update_normal_vectors | + update_gradients); + FEFaceValues elasticity_fe_face_values(elasticity_fe, + common_face_quadrature, + update_values); + FESubfaceValues stokes_fe_subface_values(stokes_fe, + common_face_quadrature, + update_JxW_values | + update_normal_vectors | + update_gradients); + FESubfaceValues elasticity_fe_subface_values(elasticity_fe, + common_face_quadrature, + update_values); // ...to objects that are needed to describe the local contributions to // the global linear system... @@ -941,22 +949,22 @@ namespace Step46 face_q_collection.push_back(elasticity_face_quadrature); const FEValuesExtractors::Vector velocities(0); - KellyErrorEstimator::estimate( - dof_handler, - face_q_collection, - typename FunctionMap::type(), - solution, - stokes_estimated_error_per_cell, - fe_collection.component_mask(velocities)); + KellyErrorEstimator::estimate(dof_handler, + face_q_collection, + typename FunctionMap::type(), + solution, + stokes_estimated_error_per_cell, + fe_collection.component_mask( + velocities)); const FEValuesExtractors::Vector displacements(dim + 1); - KellyErrorEstimator::estimate( - dof_handler, - face_q_collection, - typename FunctionMap::type(), - solution, - elasticity_estimated_error_per_cell, - fe_collection.component_mask(displacements)); + KellyErrorEstimator::estimate(dof_handler, + face_q_collection, + typename FunctionMap::type(), + solution, + elasticity_estimated_error_per_cell, + fe_collection.component_mask( + displacements)); // We then normalize error estimates by dividing by their norm and scale // the fluid error indicators by a factor of 4 as discussed in the @@ -1023,8 +1031,10 @@ namespace Step46 estimated_error_per_cell(cell->active_cell_index()) = 0; } - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.0); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.0); triangulation.execute_coarsening_and_refinement(); } diff --git a/examples/step-48/step-48.cc b/examples/step-48/step-48.cc index 48b44f6daa..a98762c434 100644 --- a/examples/step-48/step-48.cc +++ b/examples/step-48/step-48.cc @@ -117,9 +117,9 @@ namespace Step48 template SineGordonOperation::SineGordonOperation( const MatrixFree &data_in, - const double time_step) : - data(data_in), - delta_t_sqr(make_vectorized_array(time_step * time_step)) + const double time_step) + : data(data_in) + , delta_t_sqr(make_vectorized_array(time_step * time_step)) { VectorizedArray one = make_vectorized_array(1.); @@ -235,8 +235,10 @@ namespace Step48 const std::vector *> &src) const { dst = 0; - data.cell_loop( - &SineGordonOperation::local_apply, this, dst, src); + data.cell_loop(&SineGordonOperation::local_apply, + this, + dst, + src); dst.scale(inv_mass_matrix); } @@ -250,8 +252,8 @@ namespace Step48 class ExactSolution : public Function { public: - ExactSolution(const unsigned int n_components = 1, const double time = 0.) : - Function(n_components, time) + ExactSolution(const unsigned int n_components = 1, const double time = 0.) + : Function(n_components, time) {} virtual double value(const Point & p, const unsigned int component = 0) const override; @@ -332,19 +334,21 @@ namespace Step48 // conditioning versus equidistant points. To make things more explicit, we // choose to state the selection of the nodal points nonetheless. template - SineGordonProblem::SineGordonProblem() : - pcout(std::cout, Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0), + SineGordonProblem::SineGordonProblem() + : pcout(std::cout, Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) + , #ifdef DEAL_II_WITH_P4EST - triangulation(MPI_COMM_WORLD), + triangulation(MPI_COMM_WORLD) + , #endif - fe(QGaussLobatto<1>(fe_degree + 1)), - dof_handler(triangulation), - n_global_refinements(10 - 2 * dim), - time(-10), - time_step(10.), - final_time(10), - cfl_number(.1 / fe_degree), - output_timestep_skip(200) + fe(QGaussLobatto<1>(fe_degree + 1)) + , dof_handler(triangulation) + , n_global_refinements(10 - 2 * dim) + , time(-10) + , time_step(10.) + , final_time(10) + , cfl_number(.1 / fe_degree) + , output_timestep_skip(200) {} //@sect4{SineGordonProblem::make_grid_and_dofs} @@ -420,8 +424,10 @@ namespace Step48 additional_data.tasks_parallel_scheme = MatrixFree::AdditionalData::partition_partition; - matrix_free_data.reinit( - dof_handler, constraints, quadrature, additional_data); + matrix_free_data.reinit(dof_handler, + constraints, + quadrature, + additional_data); matrix_free_data.initialize_dof_vector(solution); old_solution.reinit(solution); @@ -467,8 +473,10 @@ namespace Step48 norm_per_cell, QGauss(fe_degree + 1), VectorTools::L2_norm); - const double solution_norm = VectorTools::compute_global_error( - triangulation, norm_per_cell, VectorTools::L2_norm); + const double solution_norm = + VectorTools::compute_global_error(triangulation, + norm_per_cell, + VectorTools::L2_norm); pcout << " Time:" << std::setw(8) << std::setprecision(3) << time << ", solution norm: " << std::setprecision(5) << std::setw(7) @@ -546,10 +554,12 @@ namespace Step48 // the two starting solutions in a std::vector of pointers field // and to set up an instance of the SineGordonOperation class // based on the finite element degree specified at the top of this file. - VectorTools::interpolate( - dof_handler, ExactSolution(1, time), solution); - VectorTools::interpolate( - dof_handler, ExactSolution(1, time - time_step), old_solution); + VectorTools::interpolate(dof_handler, + ExactSolution(1, time), + solution); + VectorTools::interpolate(dof_handler, + ExactSolution(1, time - time_step), + old_solution); output_results(0); std::vector *> diff --git a/examples/step-49/step-49.cc b/examples/step-49/step-49.cc index bb75fdc8ea..a40312e76b 100644 --- a/examples/step-49/step-49.cc +++ b/examples/step-49/step-49.cc @@ -134,8 +134,10 @@ void grid_2() std::vector repetitions(2); repetitions[0] = 3; repetitions[1] = 2; - GridGenerator::subdivided_hyper_rectangle( - tria2, repetitions, Point<2>(1.0, -1.0), Point<2>(4.0, 1.0)); + GridGenerator::subdivided_hyper_rectangle(tria2, + repetitions, + Point<2>(1.0, -1.0), + Point<2>(4.0, 1.0)); Triangulation<2> triangulation; GridGenerator::merge_triangulations(tria1, tria2, triangulation); @@ -242,8 +244,10 @@ void grid_5() std::vector repetitions(2); repetitions[0] = 14; repetitions[1] = 2; - GridGenerator::subdivided_hyper_rectangle( - triangulation, repetitions, Point<2>(0.0, 0.0), Point<2>(10.0, 1.0)); + GridGenerator::subdivided_hyper_rectangle(triangulation, + repetitions, + Point<2>(0.0, 0.0), + Point<2>(10.0, 1.0)); GridTools::transform( [](const Point<2> &in) -> Point<2> { @@ -284,8 +288,10 @@ void grid_6() Triangulation<2> triangulation; std::vector repetitions(2); repetitions[0] = repetitions[1] = 40; - GridGenerator::subdivided_hyper_rectangle( - triangulation, repetitions, Point<2>(0.0, 0.0), Point<2>(1.0, 1.0)); + GridGenerator::subdivided_hyper_rectangle(triangulation, + repetitions, + Point<2>(0.0, 0.0), + Point<2>(1.0, 1.0)); GridTools::transform(Grid6Func(), triangulation); print_mesh_info(triangulation, "grid-6.eps"); @@ -305,8 +311,10 @@ void grid_7() Triangulation<2> triangulation; std::vector repetitions(2); repetitions[0] = repetitions[1] = 16; - GridGenerator::subdivided_hyper_rectangle( - triangulation, repetitions, Point<2>(0.0, 0.0), Point<2>(1.0, 1.0)); + GridGenerator::subdivided_hyper_rectangle(triangulation, + repetitions, + Point<2>(0.0, 0.0), + Point<2>(1.0, 1.0)); GridTools::distort_random(0.3, triangulation, true); print_mesh_info(triangulation, "grid-7.eps"); diff --git a/examples/step-5/step-5.cc b/examples/step-5/step-5.cc index b1f7961cb1..1e939eb357 100644 --- a/examples/step-5/step-5.cc +++ b/examples/step-5/step-5.cc @@ -118,7 +118,9 @@ double coefficient(const Point &p) // This function is as before. template -Step5::Step5() : fe(1), dof_handler(triangulation) +Step5::Step5() + : fe(1) + , dof_handler(triangulation) {} @@ -214,8 +216,9 @@ void Step5::assemble_system() 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -223,10 +226,14 @@ void Step5::assemble_system() // With the matrix so built, we use zero boundary values again: std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/examples/step-50/step-50.cc b/examples/step-50/step-50.cc index abcc73d70b..c1dcc3a79a 100644 --- a/examples/step-50/step-50.cc +++ b/examples/step-50/step-50.cc @@ -157,7 +157,8 @@ namespace Step50 class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double value(const Point & p, @@ -227,15 +228,15 @@ namespace Step50 // flag to the constructor of the // triangulation class. template - LaplaceProblem::LaplaceProblem(const unsigned int degree) : - pcout(std::cout, (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)), - triangulation( - MPI_COMM_WORLD, - Triangulation::limit_level_difference_at_vertices, - parallel::distributed::Triangulation::construct_multigrid_hierarchy), - fe(degree), - mg_dof_handler(triangulation), - degree(degree) + LaplaceProblem::LaplaceProblem(const unsigned int degree) + : pcout(std::cout, (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)) + , triangulation(MPI_COMM_WORLD, + Triangulation::limit_level_difference_at_vertices, + parallel::distributed::Triangulation< + dim>::construct_multigrid_hierarchy) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) {} @@ -285,15 +286,18 @@ namespace Step50 Functions::ConstantFunction homogeneous_dirichlet_bc(1.0); dirichlet_boundary_ids.insert(0); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - VectorTools::interpolate_boundary_values( - mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); DynamicSparsityPattern dsp(mg_dof_handler.n_dofs(), mg_dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(mg_dof_handler, dsp, constraints); - system_matrix.reinit( - mg_dof_handler.locally_owned_dofs(), dsp, MPI_COMM_WORLD, true); + system_matrix.reinit(mg_dof_handler.locally_owned_dofs(), + dsp, + MPI_COMM_WORLD, + true); // The multigrid constraints have to be @@ -534,8 +538,9 @@ namespace Step50 ++level) { IndexSet dofset; - DoFTools::extract_locally_relevant_level_dofs( - mg_dof_handler, level, dofset); + DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler, + level, + dofset); boundary_constraints[level].reinit(dofset); boundary_constraints[level].add_lines( mg_constrained_dofs.get_refinement_edge_indices(level)); @@ -837,12 +842,12 @@ namespace Step50 temp_solution.reinit(locally_relevant_set, MPI_COMM_WORLD); temp_solution = solution; - KellyErrorEstimator::estimate( - static_cast &>(mg_dof_handler), - QGauss(degree + 1), - typename FunctionMap::type(), - temp_solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate(static_cast &>( + mg_dof_handler), + QGauss(degree + 1), + typename FunctionMap::type(), + temp_solution, + estimated_error_per_cell); parallel::distributed::GridRefinement::refine_and_coarsen_fixed_fraction( triangulation, estimated_error_per_cell, 0.3, 0.0); diff --git a/examples/step-51/step-51.cc b/examples/step-51/step-51.cc index 70b396e147..80fe60211d 100644 --- a/examples/step-51/step-51.cc +++ b/examples/step-51/step-51.cc @@ -106,18 +106,14 @@ namespace Step51 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)}; + 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)}; 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)}; + 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)}; template <> const Point<3> @@ -134,7 +130,8 @@ namespace Step51 class Solution : public Function, protected SolutionBase { public: - Solution() : Function() + Solution() + : Function() {} virtual double value(const Point & p, @@ -194,7 +191,8 @@ namespace Step51 class SolutionAndGradient : public Function, protected SolutionBase { public: - SolutionAndGradient() : Function(dim) + SolutionAndGradient() + : Function(dim) {} virtual void vector_value(const Point &p, @@ -222,7 +220,8 @@ namespace Step51 class ConvectionVelocity : public TensorFunction<1, dim> { public: - ConvectionVelocity() : TensorFunction<1, dim>() + ConvectionVelocity() + : TensorFunction<1, dim>() {} virtual Tensor<1, dim> value(const Point &p) const override; @@ -265,7 +264,8 @@ namespace Step51 class RightHandSide : public Function, protected SolutionBase { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double value(const Point & p, @@ -413,15 +413,14 @@ namespace Step51 // elements for the local DG part, including the gradient/flux part and the // scalar part. template - HDG::HDG(const unsigned int degree, - const RefinementMode refinement_mode) : - fe_local(FE_DGQ(degree), dim, FE_DGQ(degree), 1), - dof_handler_local(triangulation), - fe(degree), - dof_handler(triangulation), - fe_u_post(degree + 1), - dof_handler_u_post(triangulation), - refinement_mode(refinement_mode) + HDG::HDG(const unsigned int degree, const RefinementMode refinement_mode) + : fe_local(FE_DGQ(degree), dim, FE_DGQ(degree), 1) + , dof_handler_local(triangulation) + , fe(degree) + , dof_handler(triangulation) + , fe_u_post(degree + 1) + , dof_handler_u_post(triangulation) + , refinement_mode(refinement_mode) {} @@ -497,11 +496,11 @@ namespace Step51 bool trace_reconstruct; - PerTaskData(const unsigned int n_dofs, const bool trace_reconstruct) : - cell_matrix(n_dofs, n_dofs), - cell_vector(n_dofs), - dof_indices(n_dofs), - trace_reconstruct(trace_reconstruct) + PerTaskData(const unsigned int n_dofs, const bool trace_reconstruct) + : cell_matrix(n_dofs, n_dofs) + , cell_vector(n_dofs) + , dof_indices(n_dofs) + , trace_reconstruct(trace_reconstruct) {} }; @@ -554,24 +553,26 @@ namespace Step51 const QGauss & face_quadrature_formula, const UpdateFlags local_flags, const UpdateFlags local_face_flags, - const UpdateFlags flags) : - fe_values_local(fe_local, quadrature_formula, local_flags), - fe_face_values_local(fe_local, face_quadrature_formula, local_face_flags), - fe_face_values(fe, face_quadrature_formula, flags), - ll_matrix(fe_local.dofs_per_cell, fe_local.dofs_per_cell), - lf_matrix(fe_local.dofs_per_cell, fe.dofs_per_cell), - fl_matrix(fe.dofs_per_cell, fe_local.dofs_per_cell), - tmp_matrix(fe.dofs_per_cell, fe_local.dofs_per_cell), - l_rhs(fe_local.dofs_per_cell), - tmp_rhs(fe_local.dofs_per_cell), - q_phi(fe_local.dofs_per_cell), - q_phi_div(fe_local.dofs_per_cell), - u_phi(fe_local.dofs_per_cell), - u_phi_grad(fe_local.dofs_per_cell), - tr_phi(fe.dofs_per_cell), - trace_values(face_quadrature_formula.size()), - fe_local_support_on_face(GeometryInfo::faces_per_cell), - fe_support_on_face(GeometryInfo::faces_per_cell) + const UpdateFlags flags) + : fe_values_local(fe_local, quadrature_formula, local_flags) + , fe_face_values_local(fe_local, + face_quadrature_formula, + local_face_flags) + , fe_face_values(fe, face_quadrature_formula, flags) + , ll_matrix(fe_local.dofs_per_cell, fe_local.dofs_per_cell) + , lf_matrix(fe_local.dofs_per_cell, fe.dofs_per_cell) + , fl_matrix(fe.dofs_per_cell, fe_local.dofs_per_cell) + , tmp_matrix(fe.dofs_per_cell, fe_local.dofs_per_cell) + , l_rhs(fe_local.dofs_per_cell) + , tmp_rhs(fe_local.dofs_per_cell) + , q_phi(fe_local.dofs_per_cell) + , q_phi_div(fe_local.dofs_per_cell) + , u_phi(fe_local.dofs_per_cell) + , u_phi_grad(fe_local.dofs_per_cell) + , tr_phi(fe.dofs_per_cell) + , trace_values(face_quadrature_formula.size()) + , fe_local_support_on_face(GeometryInfo::faces_per_cell) + , fe_support_on_face(GeometryInfo::faces_per_cell) { for (unsigned int face = 0; face < GeometryInfo::faces_per_cell; ++face) @@ -590,30 +591,30 @@ namespace Step51 } } - ScratchData(const ScratchData &sd) : - fe_values_local(sd.fe_values_local.get_fe(), - sd.fe_values_local.get_quadrature(), - sd.fe_values_local.get_update_flags()), - fe_face_values_local(sd.fe_face_values_local.get_fe(), - sd.fe_face_values_local.get_quadrature(), - sd.fe_face_values_local.get_update_flags()), - fe_face_values(sd.fe_face_values.get_fe(), - sd.fe_face_values.get_quadrature(), - sd.fe_face_values.get_update_flags()), - ll_matrix(sd.ll_matrix), - lf_matrix(sd.lf_matrix), - fl_matrix(sd.fl_matrix), - tmp_matrix(sd.tmp_matrix), - l_rhs(sd.l_rhs), - tmp_rhs(sd.tmp_rhs), - q_phi(sd.q_phi), - q_phi_div(sd.q_phi_div), - u_phi(sd.u_phi), - u_phi_grad(sd.u_phi_grad), - tr_phi(sd.tr_phi), - trace_values(sd.trace_values), - fe_local_support_on_face(sd.fe_local_support_on_face), - fe_support_on_face(sd.fe_support_on_face) + ScratchData(const ScratchData &sd) + : fe_values_local(sd.fe_values_local.get_fe(), + sd.fe_values_local.get_quadrature(), + sd.fe_values_local.get_update_flags()) + , fe_face_values_local(sd.fe_face_values_local.get_fe(), + sd.fe_face_values_local.get_quadrature(), + sd.fe_face_values_local.get_update_flags()) + , fe_face_values(sd.fe_face_values.get_fe(), + sd.fe_face_values.get_quadrature(), + sd.fe_face_values.get_update_flags()) + , ll_matrix(sd.ll_matrix) + , lf_matrix(sd.lf_matrix) + , fl_matrix(sd.fl_matrix) + , tmp_matrix(sd.tmp_matrix) + , l_rhs(sd.l_rhs) + , tmp_rhs(sd.tmp_rhs) + , q_phi(sd.q_phi) + , q_phi_div(sd.q_phi_div) + , u_phi(sd.u_phi) + , u_phi_grad(sd.u_phi_grad) + , tr_phi(sd.tr_phi) + , trace_values(sd.trace_values) + , fe_local_support_on_face(sd.fe_local_support_on_face) + , fe_support_on_face(sd.fe_support_on_face) {} }; @@ -640,28 +641,28 @@ namespace Step51 const FiniteElement &fe_local, const QGauss & quadrature_formula, const UpdateFlags local_flags, - const UpdateFlags flags) : - fe_values_local(fe_local, quadrature_formula, local_flags), - fe_values(fe, quadrature_formula, flags), - u_values(quadrature_formula.size()), - u_gradients(quadrature_formula.size()), - cell_matrix(fe.dofs_per_cell, fe.dofs_per_cell), - cell_rhs(fe.dofs_per_cell), - cell_sol(fe.dofs_per_cell) + const UpdateFlags flags) + : fe_values_local(fe_local, quadrature_formula, local_flags) + , fe_values(fe, quadrature_formula, flags) + , u_values(quadrature_formula.size()) + , u_gradients(quadrature_formula.size()) + , cell_matrix(fe.dofs_per_cell, fe.dofs_per_cell) + , cell_rhs(fe.dofs_per_cell) + , cell_sol(fe.dofs_per_cell) {} - PostProcessScratchData(const PostProcessScratchData &sd) : - fe_values_local(sd.fe_values_local.get_fe(), - sd.fe_values_local.get_quadrature(), - sd.fe_values_local.get_update_flags()), - fe_values(sd.fe_values.get_fe(), - sd.fe_values.get_quadrature(), - sd.fe_values.get_update_flags()), - u_values(sd.u_values), - u_gradients(sd.u_gradients), - cell_matrix(sd.cell_matrix), - cell_rhs(sd.cell_rhs), - cell_sol(sd.cell_sol) + PostProcessScratchData(const PostProcessScratchData &sd) + : fe_values_local(sd.fe_values_local.get_fe(), + sd.fe_values_local.get_quadrature(), + sd.fe_values_local.get_update_flags()) + , fe_values(sd.fe_values.get_fe(), + sd.fe_values.get_quadrature(), + sd.fe_values.get_update_flags()) + , u_values(sd.u_values) + , u_gradients(sd.u_gradients) + , cell_matrix(sd.cell_matrix) + , cell_rhs(sd.cell_rhs) + , cell_sol(sd.cell_sol) {} }; @@ -719,8 +720,10 @@ namespace Step51 PerTaskData & task_data) { // Construct iterator for dof_handler_local for FEValues reinit function. - typename DoFHandler::active_cell_iterator loc_cell( - &triangulation, cell->level(), cell->index(), &dof_handler_local); + typename DoFHandler::active_cell_iterator loc_cell(&triangulation, + cell->level(), + cell->index(), + &dof_handler_local); const unsigned int n_q_points = scratch.fe_values_local.get_quadrature().size(); @@ -956,8 +959,9 @@ namespace Step51 { scratch.fl_matrix.mmult(scratch.tmp_matrix, scratch.ll_matrix); scratch.tmp_matrix.vmult_add(task_data.cell_vector, scratch.l_rhs); - scratch.tmp_matrix.mmult( - task_data.cell_matrix, scratch.lf_matrix, true); + scratch.tmp_matrix.mmult(task_data.cell_matrix, + scratch.lf_matrix, + true); cell->get_dof_indices(task_data.dof_indices); } // For (2), we are simply solving (ll_matrix).(solution_local) = (l_rhs). @@ -1073,8 +1077,10 @@ namespace Step51 QGauss(fe.degree + 2), VectorTools::L2_norm, &value_select); - const double L2_error = VectorTools::compute_global_error( - triangulation, difference_per_cell, VectorTools::L2_norm); + const double L2_error = + VectorTools::compute_global_error(triangulation, + difference_per_cell, + VectorTools::L2_norm); ComponentSelectFunction gradient_select( std::pair(0, dim), dim + 1); @@ -1085,8 +1091,10 @@ namespace Step51 QGauss(fe.degree + 2), VectorTools::L2_norm, &gradient_select); - const double grad_error = VectorTools::compute_global_error( - triangulation, difference_per_cell, VectorTools::L2_norm); + const double grad_error = + VectorTools::compute_global_error(triangulation, + difference_per_cell, + VectorTools::L2_norm); VectorTools::integrate_difference(dof_handler_u_post, solution_u_post, @@ -1094,8 +1102,10 @@ namespace Step51 difference_per_cell, QGauss(fe.degree + 3), VectorTools::L2_norm); - const double post_error = VectorTools::compute_global_error( - triangulation, difference_per_cell, VectorTools::L2_norm); + const double post_error = + VectorTools::compute_global_error(triangulation, + difference_per_cell, + VectorTools::L2_norm); convergence_table.add_value("cells", triangulation.n_active_cells()); convergence_table.add_value("dofs", dof_handler.n_dofs()); @@ -1131,8 +1141,10 @@ namespace Step51 PostProcessScratchData & scratch, unsigned int &) { - typename DoFHandler::active_cell_iterator loc_cell( - &triangulation, cell->level(), cell->index(), &dof_handler_local); + typename DoFHandler::active_cell_iterator loc_cell(&triangulation, + cell->level(), + cell->index(), + &dof_handler_local); scratch.fe_values_local.reinit(loc_cell); scratch.fe_values.reinit(cell); @@ -1236,8 +1248,10 @@ namespace Step51 dim + 1, DataComponentInterpretation::component_is_part_of_vector); component_interpretation[dim] = DataComponentInterpretation::component_is_scalar; - data_out.add_data_vector( - dof_handler_local, solution_local, names, component_interpretation); + data_out.add_data_vector(dof_handler_local, + solution_local, + names, + component_interpretation); // The second data item we add is the post-processed solution. // In this case, it is a single scalar variable belonging to @@ -1245,8 +1259,10 @@ namespace Step51 std::vector post_name(1, "u_post"); std::vector post_comp_type(1, DataComponentInterpretation::component_is_scalar); - data_out.add_data_vector( - dof_handler_u_post, solution_u_post, post_name, post_comp_type); + data_out.add_data_vector(dof_handler_u_post, + solution_u_post, + post_name, + post_comp_type); data_out.build_patches(fe.degree); data_out.write_vtk(output); @@ -1265,8 +1281,10 @@ namespace Step51 std::vector face_component_type(1, DataComponentInterpretation::component_is_scalar); - data_out_face.add_data_vector( - dof_handler, solution, face_name, face_component_type); + data_out_face.add_data_vector(dof_handler, + solution, + face_name, + face_component_type); data_out_face.build_patches(fe.degree); data_out_face.write_vtk(face_output); @@ -1298,8 +1316,10 @@ namespace Step51 case global_refinement: { triangulation.clear(); - GridGenerator::subdivided_hyper_cube( - triangulation, 2 + (cycle % 2), -1, 1); + GridGenerator::subdivided_hyper_cube(triangulation, + 2 + (cycle % 2), + -1, + 1); triangulation.refine_global(3 - dim + cycle / 2); break; } @@ -1311,13 +1331,13 @@ namespace Step51 FEValuesExtractors::Scalar scalar(dim); typename FunctionMap::type neumann_boundary; - KellyErrorEstimator::estimate( - dof_handler_local, - QGauss(3), - neumann_boundary, - solution_local, - estimated_error_per_cell, - fe_local.component_mask(scalar)); + KellyErrorEstimator::estimate(dof_handler_local, + QGauss(3), + neumann_boundary, + solution_local, + estimated_error_per_cell, + fe_local.component_mask( + scalar)); GridRefinement::refine_and_coarsen_fixed_number( triangulation, estimated_error_per_cell, 0.3, 0.); diff --git a/examples/step-52/step-52.cc b/examples/step-52/step-52.cc index 327373fefd..9f6e5c2bde 100644 --- a/examples/step-52/step-52.cc +++ b/examples/step-52/step-52.cc @@ -147,12 +147,12 @@ namespace Step52 // We choose quadratic finite elements and we initialize the parameters. - Diffusion::Diffusion() : - fe_degree(2), - diffusion_coefficient(1. / 30.), - absorption_cross_section(1.), - fe(fe_degree), - dof_handler(triangulation) + Diffusion::Diffusion() + : fe_degree(2) + , diffusion_coefficient(1. / 30.) + , absorption_cross_section(1.) + , fe(fe_degree) + , dof_handler(triangulation) {} @@ -164,8 +164,10 @@ namespace Step52 { dof_handler.distribute_dofs(fe); - VectorTools::interpolate_boundary_values( - dof_handler, 1, Functions::ZeroFunction<2>(), constraint_matrix); + VectorTools::interpolate_boundary_values(dof_handler, + 1, + Functions::ZeroFunction<2>(), + constraint_matrix); constraint_matrix.close(); DynamicSparsityPattern dsp(dof_handler.n_dofs()); @@ -240,10 +242,12 @@ namespace Step52 cell->get_dof_indices(local_dof_indices); - constraint_matrix.distribute_local_to_global( - cell_matrix, local_dof_indices, system_matrix); - constraint_matrix.distribute_local_to_global( - cell_mass_matrix, local_dof_indices, mass_matrix); + constraint_matrix.distribute_local_to_global(cell_matrix, + local_dof_indices, + system_matrix); + constraint_matrix.distribute_local_to_global(cell_mass_matrix, + local_dof_indices, + mass_matrix); } inverse_mass_matrix.initialize(mass_matrix); @@ -325,8 +329,9 @@ namespace Step52 cell->get_dof_indices(local_dof_indices); - constraint_matrix.distribute_local_to_global( - cell_source, local_dof_indices, tmp); + constraint_matrix.distribute_local_to_global(cell_source, + local_dof_indices, + tmp); } Vector value(dof_handler.n_dofs()); @@ -655,13 +660,17 @@ namespace Step52 const double final_time = 10.; std::cout << "Explicit methods:" << std::endl; - explicit_method( - TimeStepping::FORWARD_EULER, n_time_steps, initial_time, final_time); + explicit_method(TimeStepping::FORWARD_EULER, + n_time_steps, + initial_time, + final_time); std::cout << "Forward Euler: error=" << solution.l2_norm() << std::endl; - explicit_method( - TimeStepping::RK_THIRD_ORDER, n_time_steps, initial_time, final_time); + explicit_method(TimeStepping::RK_THIRD_ORDER, + n_time_steps, + initial_time, + final_time); std::cout << "Third order Runge-Kutta: error=" << solution.l2_norm() << std::endl; @@ -675,55 +684,73 @@ namespace Step52 std::cout << "Implicit methods:" << std::endl; - implicit_method( - TimeStepping::BACKWARD_EULER, n_time_steps, initial_time, final_time); + implicit_method(TimeStepping::BACKWARD_EULER, + n_time_steps, + initial_time, + final_time); std::cout << "Backward Euler: error=" << solution.l2_norm() << std::endl; - implicit_method( - TimeStepping::IMPLICIT_MIDPOINT, n_time_steps, initial_time, final_time); + implicit_method(TimeStepping::IMPLICIT_MIDPOINT, + n_time_steps, + initial_time, + final_time); std::cout << "Implicit Midpoint: error=" << solution.l2_norm() << std::endl; - implicit_method( - TimeStepping::CRANK_NICOLSON, n_time_steps, initial_time, final_time); + implicit_method(TimeStepping::CRANK_NICOLSON, + n_time_steps, + initial_time, + final_time); std::cout << "Crank-Nicolson: error=" << solution.l2_norm() << std::endl; - implicit_method( - TimeStepping::SDIRK_TWO_STAGES, n_time_steps, initial_time, final_time); + implicit_method(TimeStepping::SDIRK_TWO_STAGES, + n_time_steps, + initial_time, + final_time); std::cout << "SDIRK: error=" << solution.l2_norm() << std::endl; std::cout << std::endl; std::cout << "Embedded explicit methods:" << std::endl; - n_steps = embedded_explicit_method( - TimeStepping::HEUN_EULER, n_time_steps, initial_time, final_time); + n_steps = embedded_explicit_method(TimeStepping::HEUN_EULER, + n_time_steps, + initial_time, + final_time); std::cout << "Heun-Euler: error=" << solution.l2_norm() << std::endl; std::cout << " steps performed=" << n_steps << std::endl; - n_steps = embedded_explicit_method( - TimeStepping::BOGACKI_SHAMPINE, n_time_steps, initial_time, final_time); + n_steps = embedded_explicit_method(TimeStepping::BOGACKI_SHAMPINE, + n_time_steps, + initial_time, + final_time); std::cout << "Bogacki-Shampine: error=" << solution.l2_norm() << std::endl; std::cout << " steps performed=" << n_steps << std::endl; - n_steps = embedded_explicit_method( - TimeStepping::DOPRI, n_time_steps, initial_time, final_time); + n_steps = embedded_explicit_method(TimeStepping::DOPRI, + n_time_steps, + initial_time, + final_time); std::cout << "Dopri: error=" << solution.l2_norm() << std::endl; std::cout << " steps performed=" << n_steps << std::endl; - n_steps = embedded_explicit_method( - TimeStepping::FEHLBERG, n_time_steps, initial_time, final_time); + n_steps = embedded_explicit_method(TimeStepping::FEHLBERG, + n_time_steps, + initial_time, + final_time); std::cout << "Fehlberg: error=" << solution.l2_norm() << std::endl; std::cout << " steps performed=" << n_steps << std::endl; - n_steps = embedded_explicit_method( - TimeStepping::CASH_KARP, n_time_steps, initial_time, final_time); + n_steps = embedded_explicit_method(TimeStepping::CASH_KARP, + n_time_steps, + initial_time, + final_time); std::cout << "Cash-Karp: error=" << solution.l2_norm() << std::endl; std::cout << " steps performed=" << n_steps << std::endl; diff --git a/examples/step-53/step-53.cc b/examples/step-53/step-53.cc index 1cf4148abd..f60c0755e1 100644 --- a/examples/step-53/step-53.cc +++ b/examples/step-53/step-53.cc @@ -111,10 +111,10 @@ namespace Step53 // member functions we call here are static because (i) they do not // access any member variables of the class, and (ii) because they are // called at a time when the object is not initialized fully anyway. - AfricaTopography::AfricaTopography() : - topography_data(get_endpoints(), - n_intervals(), - Table<2, double>(380, 220, get_data().begin())) + AfricaTopography::AfricaTopography() + : topography_data(get_endpoints(), + n_intervals(), + Table<2, double>(380, 220, get_data().begin())) {} @@ -285,14 +285,15 @@ namespace Step53 Point<3> AfricaGeometry::pull_back_wgs84(const Point<3> &x) const { - const double b = std::sqrt(R * R * (1 - ellipticity * ellipticity)); - const double ep = std::sqrt((R * R - b * b) / (b * b)); - const double p = std::sqrt(x(0) * x(0) + x(1) * x(1)); - const double th = std::atan2(R * x(2), b * p); - const double phi = std::atan2(x(1), x(0)); - const double theta = std::atan2( - x(2) + ep * ep * b * std::pow(std::sin(th), 3), - (p - (ellipticity * ellipticity * R * std::pow(std::cos(th), 3)))); + const double b = std::sqrt(R * R * (1 - ellipticity * ellipticity)); + const double ep = std::sqrt((R * R - b * b) / (b * b)); + const double p = std::sqrt(x(0) * x(0) + x(1) * x(1)); + const double th = std::atan2(R * x(2), b * p); + const double phi = std::atan2(x(1), x(0)); + const double theta = + std::atan2(x(2) + ep * ep * b * std::pow(std::sin(th), 3), + (p - + (ellipticity * ellipticity * R * std::pow(std::cos(th), 3)))); const double R_bar = R / (std::sqrt(1 - ellipticity * ellipticity * std::sin(theta) * std::sin(theta))); diff --git a/examples/step-54/step-54.cc b/examples/step-54/step-54.cc index f668052915..4fab36bfb3 100644 --- a/examples/step-54/step-54.cc +++ b/examples/step-54/step-54.cc @@ -116,11 +116,11 @@ namespace Step54 const std::string & initial_mesh_filename, const std::string & cad_file_name, const std::string & output_filename, - const ProjectionType surface_projection_kind) : - initial_mesh_filename(initial_mesh_filename), - cad_file_name(cad_file_name), - output_filename(output_filename), - surface_projection_kind(surface_projection_kind) + const ProjectionType surface_projection_kind) + : initial_mesh_filename(initial_mesh_filename) + , cad_file_name(cad_file_name) + , output_filename(output_filename) + , surface_projection_kind(surface_projection_kind) {} TriangulationOnCAD::~TriangulationOnCAD() @@ -296,8 +296,9 @@ namespace Step54 case DirectionalProjection: { OpenCASCADE::DirectionalProjectionBoundary<2, 3> - directional_projector( - bow_surface, Point<3>(0.0, 1.0, 0.0), tolerance); + directional_projector(bow_surface, + Point<3>(0.0, 1.0, 0.0), + tolerance); tria.set_manifold(1, directional_projector); break; diff --git a/examples/step-55/step-55.cc b/examples/step-55/step-55.cc index ee71e365ea..6b4aecf036 100644 --- a/examples/step-55/step-55.cc +++ b/examples/step-55/step-55.cc @@ -117,9 +117,9 @@ namespace Step55 template InverseMatrix::InverseMatrix( const Matrix & m, - const Preconditioner &preconditioner) : - matrix(&m), - preconditioner(preconditioner) + const Preconditioner &preconditioner) + : matrix(&m) + , preconditioner(preconditioner) {} @@ -165,9 +165,9 @@ namespace Step55 template BlockDiagonalPreconditioner:: BlockDiagonalPreconditioner(const PreconditionerA &preconditioner_A, - const PreconditionerS &preconditioner_S) : - preconditioner_A(preconditioner_A), - preconditioner_S(preconditioner_S) + const PreconditionerS &preconditioner_S) + : preconditioner_A(preconditioner_A) + , preconditioner_S(preconditioner_S) {} @@ -191,7 +191,8 @@ namespace Step55 class RightHandSide : public Function { public: - RightHandSide() : Function(dim + 1) + RightHandSide() + : Function(dim + 1) {} virtual void vector_value(const Point &p, @@ -227,7 +228,8 @@ namespace Step55 class ExactSolution : public Function { public: - ExactSolution() : Function(dim + 1) + ExactSolution() + : Function(dim + 1) {} virtual void vector_value(const Point &p, @@ -314,21 +316,22 @@ namespace Step55 template - StokesProblem::StokesProblem(unsigned int velocity_degree) : - velocity_degree(velocity_degree), - viscosity(0.1), - mpi_communicator(MPI_COMM_WORLD), - fe(FE_Q(velocity_degree), dim, FE_Q(velocity_degree - 1), 1), - triangulation(mpi_communicator, - typename Triangulation::MeshSmoothing( - Triangulation::smoothing_on_refinement | - Triangulation::smoothing_on_coarsening)), - dof_handler(triangulation), - pcout(std::cout, (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)), - computing_timer(mpi_communicator, - pcout, - TimerOutput::summary, - TimerOutput::wall_times) + StokesProblem::StokesProblem(unsigned int velocity_degree) + : velocity_degree(velocity_degree) + , viscosity(0.1) + , mpi_communicator(MPI_COMM_WORLD) + , fe(FE_Q(velocity_degree), dim, FE_Q(velocity_degree - 1), 1) + , triangulation(mpi_communicator, + typename Triangulation::MeshSmoothing( + Triangulation::smoothing_on_refinement | + Triangulation::smoothing_on_coarsening)) + , dof_handler(triangulation) + , pcout(std::cout, + (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)) + , computing_timer(mpi_communicator, + pcout, + TimerOutput::summary, + TimerOutput::wall_times) {} @@ -361,8 +364,9 @@ namespace Step55 DoFRenumbering::component_wise(dof_handler, stokes_sub_blocks); std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block( - dof_handler, dofs_per_block, stokes_sub_blocks); + DoFTools::count_dofs_per_block(dof_handler, + dofs_per_block, + stokes_sub_blocks); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; @@ -466,8 +470,9 @@ namespace Step55 // Finally, we construct the block vectors with the right sizes. The // function call with two std::vector will create a ghosted // vector. - locally_relevant_solution.reinit( - owned_partitioning, relevant_partitioning, mpi_communicator); + locally_relevant_solution.reinit(owned_partitioning, + relevant_partitioning, + mpi_communicator); system_rhs.reinit(owned_partitioning, mpi_communicator); } @@ -562,8 +567,9 @@ namespace Step55 system_matrix, system_rhs); - constraints.distribute_local_to_global( - cell_matrix2, local_dof_indices, preconditioner_matrix); + constraints.distribute_local_to_global(cell_matrix2, + local_dof_indices, + preconditioner_matrix); } system_matrix.compress(VectorOperation::add); @@ -641,8 +647,10 @@ namespace Step55 constraints.set_zero(distributed_solution); - solver.solve( - system_matrix, distributed_solution, system_rhs, preconditioner); + solver.solve(system_matrix, + distributed_solution, + system_rhs, + preconditioner); pcout << " Solved in " << solver_control.last_step() << " iterations." << std::endl; @@ -715,8 +723,10 @@ namespace Step55 VectorTools::L2_norm, &velocity_mask); - const double error_u_l2 = VectorTools::compute_global_error( - triangulation, cellwise_errors, VectorTools::L2_norm); + const double error_u_l2 = + VectorTools::compute_global_error(triangulation, + cellwise_errors, + VectorTools::L2_norm); VectorTools::integrate_difference(dof_handler, locally_relevant_solution, @@ -726,8 +736,10 @@ namespace Step55 VectorTools::L2_norm, &pressure_mask); - const double error_p_l2 = VectorTools::compute_global_error( - triangulation, cellwise_errors, VectorTools::L2_norm); + const double error_p_l2 = + VectorTools::compute_global_error(triangulation, + cellwise_errors, + VectorTools::L2_norm); pcout << "error: u_0: " << error_u_l2 << " p_0: " << error_p_l2 << std::endl; @@ -753,8 +765,9 @@ namespace Step55 interpolated.reinit(owned_partitioning, MPI_COMM_WORLD); VectorTools::interpolate(dof_handler, ExactSolution(), interpolated); - LA::MPI::BlockVector interpolated_relevant( - owned_partitioning, relevant_partitioning, MPI_COMM_WORLD); + LA::MPI::BlockVector interpolated_relevant(owned_partitioning, + relevant_partitioning, + MPI_COMM_WORLD); interpolated_relevant = interpolated; { std::vector solution_names(dim, "ref_u"); diff --git a/examples/step-56/step-56.cc b/examples/step-56/step-56.cc index d0577178a9..91c3485929 100644 --- a/examples/step-56/step-56.cc +++ b/examples/step-56/step-56.cc @@ -105,7 +105,8 @@ namespace Step56 class Solution : public Function { public: - Solution() : Function(dim + 1) + Solution() + : Function(dim + 1) {} virtual double value(const Point & p, const unsigned int component = 0) const override; @@ -233,7 +234,8 @@ namespace Step56 class RightHandSide : public Function { public: - RightHandSide() : Function(dim + 1) + RightHandSide() + : Function(dim + 1) {} virtual double value(const Point & p, @@ -339,14 +341,14 @@ namespace Step56 const SparseMatrix & schur_complement_matrix, const PreconditionerAType & preconditioner_A, const PreconditionerSType & preconditioner_S, - const bool do_solve_A) : - n_iterations_A(0), - n_iterations_S(0), - system_matrix(system_matrix), - schur_complement_matrix(schur_complement_matrix), - preconditioner_A(preconditioner_A), - preconditioner_S(preconditioner_S), - do_solve_A(do_solve_A) + const bool do_solve_A) + : n_iterations_A(0) + , n_iterations_S(0) + , system_matrix(system_matrix) + , schur_complement_matrix(schur_complement_matrix) + , preconditioner_A(preconditioner_A) + , preconditioner_S(preconditioner_S) + , do_solve_A(do_solve_A) {} @@ -365,8 +367,10 @@ namespace Step56 SolverCG<> cg(solver_control); dst.block(1) = 0.0; - cg.solve( - schur_complement_matrix, dst.block(1), src.block(1), preconditioner_S); + cg.solve(schur_complement_matrix, + dst.block(1), + src.block(1), + preconditioner_S); n_iterations_S += solver_control.last_step(); dst.block(1) *= -1.0; @@ -387,8 +391,10 @@ namespace Step56 SolverCG<> cg(solver_control); dst.block(0) = 0.0; - cg.solve( - system_matrix.block(0, 0), dst.block(0), utmp, preconditioner_A); + cg.solve(system_matrix.block(0, 0), + dst.block(0), + utmp, + preconditioner_A); n_iterations_A += solver_control.last_step(); } @@ -448,17 +454,19 @@ namespace Step56 template StokesProblem::StokesProblem(const unsigned int pressure_degree, - SolverType::type solver_type) : - pressure_degree(pressure_degree), - solver_type(solver_type), - triangulation(Triangulation::maximum_smoothing), + SolverType::type solver_type) + : pressure_degree(pressure_degree) + , solver_type(solver_type) + , triangulation(Triangulation::maximum_smoothing) + , // Finite element for the velocity only: - velocity_fe(FE_Q(pressure_degree + 1), dim), + velocity_fe(FE_Q(pressure_degree + 1), dim) + , // Finite element for the whole system: - fe(velocity_fe, 1, FE_Q(pressure_degree), 1), - dof_handler(triangulation), - velocity_dof_handler(triangulation), - computing_timer(std::cout, TimerOutput::never, TimerOutput::wall_times) + fe(velocity_fe, 1, FE_Q(pressure_degree), 1) + , dof_handler(triangulation) + , velocity_dof_handler(triangulation) + , computing_timer(std::cout, TimerOutput::never, TimerOutput::wall_times) {} @@ -548,8 +556,9 @@ namespace Step56 } std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block( - dof_handler, dofs_per_block, block_component); + DoFTools::count_dofs_per_block(dof_handler, + dofs_per_block, + block_component); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; { @@ -980,8 +989,10 @@ namespace Step56 VectorTools::L2_norm, &velocity_mask); - const double Velocity_L2_error = VectorTools::compute_global_error( - triangulation, difference_per_cell, VectorTools::L2_norm); + const double Velocity_L2_error = + VectorTools::compute_global_error(triangulation, + difference_per_cell, + VectorTools::L2_norm); VectorTools::integrate_difference(dof_handler, solution, @@ -991,8 +1002,10 @@ namespace Step56 VectorTools::L2_norm, &pressure_mask); - const double Pressure_L2_error = VectorTools::compute_global_error( - triangulation, difference_per_cell, VectorTools::L2_norm); + const double Pressure_L2_error = + VectorTools::compute_global_error(triangulation, + difference_per_cell, + VectorTools::L2_norm); VectorTools::integrate_difference(dof_handler, solution, @@ -1002,8 +1015,10 @@ namespace Step56 VectorTools::H1_norm, &velocity_mask); - const double Velocity_H1_error = VectorTools::compute_global_error( - triangulation, difference_per_cell, VectorTools::H1_norm); + const double Velocity_H1_error = + VectorTools::compute_global_error(triangulation, + difference_per_cell, + VectorTools::H1_norm); std::cout << std::endl << " Velocity L2 Error: " << Velocity_L2_error << std::endl diff --git a/examples/step-57/step-57.cc b/examples/step-57/step-57.cc index 742744dcc8..dd0f40b980 100644 --- a/examples/step-57/step-57.cc +++ b/examples/step-57/step-57.cc @@ -149,7 +149,8 @@ namespace Step57 class BoundaryValues : public Function { public: - BoundaryValues() : Function(dim + 1) + BoundaryValues() + : Function(dim + 1) {} virtual double value(const Point & p, const unsigned int component) const override; @@ -227,12 +228,12 @@ namespace Step57 double viscosity, const BlockSparseMatrix &S, const SparseMatrix & P, - const PreconditionerMp & Mppreconditioner) : - gamma(gamma), - viscosity(viscosity), - stokes_matrix(S), - pressure_mass_matrix(P), - mp_preconditioner(Mppreconditioner) + const PreconditionerMp & Mppreconditioner) + : gamma(gamma) + , viscosity(viscosity) + , stokes_matrix(S) + , pressure_mass_matrix(P) + , mp_preconditioner(Mppreconditioner) { A_inverse.initialize(stokes_matrix.block(0, 0)); } @@ -249,8 +250,10 @@ namespace Step57 SolverCG<> cg(solver_control); dst.block(1) = 0.0; - cg.solve( - pressure_mass_matrix, dst.block(1), src.block(1), mp_preconditioner); + cg.solve(pressure_mass_matrix, + dst.block(1), + src.block(1), + mp_preconditioner); dst.block(1) *= -(viscosity + gamma); } @@ -271,14 +274,13 @@ namespace Step57 // template - StationaryNavierStokes::StationaryNavierStokes( - const unsigned int degree) : - viscosity(1.0 / 7500.0), - gamma(1.0), - degree(degree), - triangulation(Triangulation::maximum_smoothing), - fe(FE_Q(degree + 1), dim, FE_Q(degree), 1), - dof_handler(triangulation) + StationaryNavierStokes::StationaryNavierStokes(const unsigned int degree) + : viscosity(1.0 / 7500.0) + , gamma(1.0) + , degree(degree) + , triangulation(Triangulation::maximum_smoothing) + , fe(FE_Q(degree + 1), dim, FE_Q(degree), 1) + , dof_handler(triangulation) {} // @sect4{StationaryNavierStokes::setup_dofs} @@ -303,8 +305,9 @@ namespace Step57 DoFRenumbering::component_wise(dof_handler, block_component); dofs_per_block.resize(2); - DoFTools::count_dofs_per_block( - dof_handler, dofs_per_block, block_component); + DoFTools::count_dofs_per_block(dof_handler, + dofs_per_block, + block_component); unsigned int dof_u = dofs_per_block[0]; unsigned int dof_p = dofs_per_block[1]; @@ -331,12 +334,12 @@ namespace Step57 zero_constraints.clear(); DoFTools::make_hanging_node_constraints(dof_handler, zero_constraints); - VectorTools::interpolate_boundary_values( - dof_handler, - 0, - Functions::ZeroFunction(dim + 1), - zero_constraints, - fe.component_mask(velocities)); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction( + dim + 1), + zero_constraints, + fe.component_mask(velocities)); } zero_constraints.close(); @@ -500,8 +503,9 @@ namespace Step57 } else { - constraints_used.distribute_local_to_global( - local_rhs, local_dof_indices, system_rhs); + constraints_used.distribute_local_to_global(local_rhs, + local_dof_indices, + system_rhs); } } @@ -549,8 +553,9 @@ namespace Step57 const ConstraintMatrix &constraints_used = initial_step ? nonzero_constraints : zero_constraints; - SolverControl solver_control( - system_matrix.m(), 1e-4 * system_rhs.l2_norm(), true); + SolverControl solver_control(system_matrix.m(), + 1e-4 * system_rhs.l2_norm(), + true); SolverFGMRES> gmres(solver_control); SparseILU pmass_preconditioner; @@ -590,8 +595,10 @@ namespace Step57 estimated_error_per_cell, fe.component_mask(velocity)); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.0); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.0); triangulation.prepare_coarsening_and_refinement(); SolutionTransfer> solution_transfer(dof_handler); diff --git a/examples/step-59/step-59.cc b/examples/step-59/step-59.cc index 0495a302ef..08e02cd0b6 100644 --- a/examples/step-59/step-59.cc +++ b/examples/step-59/step-59.cc @@ -98,7 +98,8 @@ namespace Step59 class Solution : public Function { public: - Solution() : Function() + Solution() + : Function() {} virtual double value(const Point &p, @@ -134,7 +135,8 @@ namespace Step59 class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double value(const Point &p, @@ -944,21 +946,25 @@ namespace Step59 template - LaplaceProblem::LaplaceProblem() : + LaplaceProblem::LaplaceProblem() + : #ifdef DEAL_II_WITH_P4EST triangulation( MPI_COMM_WORLD, Triangulation::limit_level_difference_at_vertices, - parallel::distributed::Triangulation::construct_multigrid_hierarchy), + parallel::distributed::Triangulation::construct_multigrid_hierarchy) + , #else - triangulation(Triangulation::limit_level_difference_at_vertices), + triangulation(Triangulation::limit_level_difference_at_vertices) + , #endif - fe(fe_degree), - dof_handler(triangulation), - setup_time(0.), - pcout(std::cout, Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0), - time_details(std::cout, - false && Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) + fe(fe_degree) + , dof_handler(triangulation) + , setup_time(0.) + , pcout(std::cout, Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) + , time_details(std::cout, + false && + Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) {} @@ -1014,8 +1020,10 @@ namespace Step59 update_quadrature_points); std::shared_ptr> system_mf_storage( new MatrixFree()); - system_mf_storage->reinit( - dof_handler, dummy, QGauss<1>(fe.degree + 1), additional_data); + system_mf_storage->reinit(dof_handler, + dummy, + QGauss<1>(fe.degree + 1), + additional_data); system_matrix.initialize(system_mf_storage); } @@ -1044,8 +1052,10 @@ namespace Step59 additional_data.level_mg_handler = level; std::shared_ptr> mg_mf_storage_level( new MatrixFree()); - mg_mf_storage_level->reinit( - dof_handler, dummy, QGauss<1>(fe.degree + 1), additional_data); + mg_mf_storage_level->reinit(dof_handler, + dummy, + QGauss<1>(fe.degree + 1), + additional_data); mg_matrices[level].initialize(mg_mf_storage_level); } @@ -1324,8 +1334,9 @@ namespace Step59 upper_right[0] = 2.5; for (unsigned int d = 1; d < dim; ++d) upper_right[d] = 2.8; - GridGenerator::hyper_rectangle( - triangulation, Point(), upper_right); + GridGenerator::hyper_rectangle(triangulation, + Point(), + upper_right); triangulation.begin_active()->face(0)->set_boundary_id(10); triangulation.begin_active()->face(1)->set_boundary_id(11); triangulation.begin_active()->face(2)->set_boundary_id(0); diff --git a/examples/step-6/step-6.cc b/examples/step-6/step-6.cc index 53ddd2778e..5aed7ce384 100644 --- a/examples/step-6/step-6.cc +++ b/examples/step-6/step-6.cc @@ -153,7 +153,9 @@ double coefficient(const Point &p) // constructor argument (which was 1 in all previous examples) by // the desired polynomial degree (here 2): template -Step6::Step6() : fe(2), dof_handler(triangulation) +Step6::Step6() + : fe(2) + , dof_handler(triangulation) {} @@ -263,8 +265,10 @@ void Step6::setup_system() // can add constraints to the ConstraintMatrix in either order: if two // constraints conflict then the constraint matrix either abort or throw an // exception via the Assert macro. - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); // After all constraints have been added, they need to be sorted and // rearranged to perform some actions more efficiently. This postprocessing @@ -516,8 +520,10 @@ void Step6::refine_grid() // 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); + 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 diff --git a/examples/step-60/step-60.cc b/examples/step-60/step-60.cc index 376861d7d5..2f58f8ebd4 100644 --- a/examples/step-60/step-60.cc +++ b/examples/step-60/step-60.cc @@ -507,9 +507,10 @@ namespace Step60 // `DistributedLagrangeProblem` for two different dimensions, without having // conflicts in the parameters for the two problems. template - DistributedLagrangeProblem::Parameters::Parameters() : - ParameterAcceptor("/Distributed Lagrange<" + Utilities::int_to_string(dim) + - "," + Utilities::int_to_string(spacedim) + ">/") + DistributedLagrangeProblem::Parameters::Parameters() + : ParameterAcceptor("/Distributed Lagrange<" + + Utilities::int_to_string(dim) + "," + + Utilities::int_to_string(spacedim) + ">/") { // The ParameterAcceptor::add_parameter() function does a few things: // @@ -573,12 +574,12 @@ namespace Step60 // `ParameterAcceptorProxy` objects, as explained earlier. template DistributedLagrangeProblem::DistributedLagrangeProblem( - const Parameters ¶meters) : - parameters(parameters), - embedded_configuration_function("Embedded configuration", spacedim), - embedded_value_function("Embedded value"), - schur_solver_control("Schur solver control"), - monitor(std::cout, TimerOutput::summary, TimerOutput::cpu_and_wall_times) + const Parameters ¶meters) + : parameters(parameters) + , embedded_configuration_function("Embedded configuration", spacedim) + , embedded_value_function("Embedded value") + , schur_solver_control("Schur solver control") + , monitor(std::cout, TimerOutput::summary, TimerOutput::cpu_and_wall_times) { // Here is a way to set default values for a ParameterAcceptor class // that was constructed using ParameterAcceptorProxy. @@ -753,8 +754,9 @@ namespace Step60 // This is precisely what the `embedded_mapping` is there for. std::vector> support_points(embedded_dh->n_dofs()); if (parameters.delta_refinement != 0) - DoFTools::map_dofs_to_support_points( - *embedded_mapping, *embedded_dh, support_points); + DoFTools::map_dofs_to_support_points(*embedded_mapping, + *embedded_dh, + support_points); // Once we have the support points of the embedded finite element space, we // would like to identify what cells of the embedding space contain what @@ -814,8 +816,9 @@ namespace Step60 // is not the case, we bail out with an exception. for (unsigned int i = 0; i < parameters.delta_refinement; ++i) { - const auto point_locations = GridTools::compute_point_locations( - *space_grid_tools_cache, support_points); + const auto point_locations = + GridTools::compute_point_locations(*space_grid_tools_cache, + support_points); const auto &cells = std::get<0>(point_locations); for (auto cell : cells) { @@ -843,12 +846,13 @@ namespace Step60 embedding_space_minimal_diameter << std::endl; - AssertThrow( - embedded_space_maximal_diameter < embedding_space_minimal_diameter, - ExcMessage("The embedding grid is too refined (or the embedded grid " - "is too coarse). Adjust the parameters so that the minimal " - "grid size of the embedding grid is larger " - "than the maximal grid size of the embedded grid.")); + AssertThrow(embedded_space_maximal_diameter < + embedding_space_minimal_diameter, + ExcMessage( + "The embedding grid is too refined (or the embedded grid " + "is too coarse). Adjust the parameters so that the minimal " + "grid size of the embedding grid is larger " + "than the maximal grid size of the embedded grid.")); // $\Omega$ has been refined and we can now set up its DoFs setup_embedding_dofs(); @@ -944,19 +948,19 @@ namespace Step60 TimerOutput::Scope timer_section(monitor, "Assemble system"); // Embedding stiffness matrix $K$, and the right hand side $G$. - MatrixTools::create_laplace_matrix( - *space_dh, - QGauss(2 * space_fe->degree + 1), - stiffness_matrix, - (const Function *)nullptr, - constraints); - - VectorTools::create_right_hand_side( - *embedded_mapping, - *embedded_dh, - QGauss(2 * embedded_fe->degree + 1), - embedded_value_function, - embedded_rhs); + MatrixTools::create_laplace_matrix(*space_dh, + QGauss(2 * space_fe->degree + + 1), + stiffness_matrix, + (const Function *)nullptr, + constraints); + + VectorTools::create_right_hand_side(*embedded_mapping, + *embedded_dh, + QGauss(2 * embedded_fe->degree + + 1), + embedded_value_function, + embedded_rhs); } { TimerOutput::Scope timer_section(monitor, "Assemble coupling system"); diff --git a/examples/step-7/step-7.cc b/examples/step-7/step-7.cc index ba20f6873b..ee0a7947b8 100644 --- a/examples/step-7/step-7.cc +++ b/examples/step-7/step-7.cc @@ -124,19 +124,15 @@ namespace Step7 // dim, but can immediately use the following definition: 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)}; + 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)}; // Likewise, we can provide an explicit specialization for // dim=2. We place the centers for the 2d case as follows: 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)}; + 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)}; // There remains to assign a value to the half-width of the exponentials. We // would like to use the same value for all dimensions. In this case, we @@ -185,7 +181,8 @@ namespace Step7 class Solution : public Function, protected SolutionBase { public: - Solution() : Function() + Solution() + : Function() {} virtual double value(const Point & p, @@ -284,7 +281,8 @@ namespace Step7 class RightHandSide : public Function, protected SolutionBase { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double value(const Point & p, @@ -480,12 +478,11 @@ namespace Step7 // arguments, and associate the DoF handler object with the triangulation // (which is empty at present, however). template - HelmholtzProblem::HelmholtzProblem( - const FiniteElement &fe, - const RefinementMode refinement_mode) : - dof_handler(triangulation), - fe(&fe), - refinement_mode(refinement_mode) + HelmholtzProblem::HelmholtzProblem(const FiniteElement &fe, + const RefinementMode refinement_mode) + : dof_handler(triangulation) + , fe(&fe) + , refinement_mode(refinement_mode) {} @@ -720,8 +717,9 @@ namespace Step7 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -741,10 +739,14 @@ namespace Step7 hanging_node_constraints.condense(system_rhs); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Solution(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Solution(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } @@ -874,8 +876,10 @@ namespace Step7 difference_per_cell, QGauss(3), VectorTools::L2_norm); - const double L2_error = VectorTools::compute_global_error( - triangulation, difference_per_cell, VectorTools::L2_norm); + const double L2_error = + VectorTools::compute_global_error(triangulation, + difference_per_cell, + VectorTools::L2_norm); // By same procedure we get the H1 semi-norm. We re-use the // difference_per_cell vector since it is no longer used @@ -890,8 +894,10 @@ namespace Step7 difference_per_cell, QGauss(3), VectorTools::H1_seminorm); - const double H1_error = VectorTools::compute_global_error( - triangulation, difference_per_cell, VectorTools::H1_seminorm); + const double H1_error = + VectorTools::compute_global_error(triangulation, + difference_per_cell, + VectorTools::H1_seminorm); // Finally, we compute the maximum norm. Of course, we can't actually // compute the true maximum, but only the maximum at the quadrature @@ -915,8 +921,10 @@ namespace Step7 difference_per_cell, q_iterated, VectorTools::Linfty_norm); - const double Linfty_error = VectorTools::compute_global_error( - triangulation, difference_per_cell, VectorTools::Linfty_norm); + const double Linfty_error = + VectorTools::compute_global_error(triangulation, + difference_per_cell, + VectorTools::Linfty_norm); // After all these errors have been computed, we finally write some // output. In addition, we add the important data to the TableHandler by diff --git a/examples/step-8/step-8.cc b/examples/step-8/step-8.cc index 4f195e00a5..684bd6ac1b 100644 --- a/examples/step-8/step-8.cc +++ b/examples/step-8/step-8.cc @@ -193,9 +193,9 @@ namespace Step8 // compose the system of, and how often it shall be repeated: template - ElasticProblem::ElasticProblem() : - dof_handler(triangulation), - fe(FE_Q(1), dim) + ElasticProblem::ElasticProblem() + : dof_handler(triangulation) + , fe(FE_Q(1), dim) {} // In fact, the FESystem class has several more constructors // which can perform more complex operations than just stacking together @@ -415,8 +415,9 @@ namespace Step8 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -436,10 +437,14 @@ namespace Step8 // need to pass dim as number of components to the zero // function as well. std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(dim), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(dim), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } @@ -488,8 +493,10 @@ namespace Step8 solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } diff --git a/examples/step-9/step-9.cc b/examples/step-9/step-9.cc index 2f69a7aebd..b6233a549b 100644 --- a/examples/step-9/step-9.cc +++ b/examples/step-9/step-9.cc @@ -196,7 +196,8 @@ namespace Step9 class AdvectionField : public TensorFunction<1, dim> { public: - AdvectionField() : TensorFunction<1, dim>() + AdvectionField() + : TensorFunction<1, dim>() {} virtual Tensor<1, dim> value(const Point &p) const override; @@ -288,7 +289,8 @@ namespace Step9 class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double value(const Point & p, @@ -358,7 +360,8 @@ namespace Step9 class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double value(const Point & p, @@ -516,7 +519,9 @@ namespace Step9 // the function setup_system follow the same pattern that was // used previously, so we need not comment on these three function: template - AdvectionProblem::AdvectionProblem() : dof_handler(triangulation), fe(1) + AdvectionProblem::AdvectionProblem() + : dof_handler(triangulation) + , fe(1) {} @@ -608,30 +613,30 @@ namespace Step9 // class: template AdvectionProblem::AssemblyScratchData::AssemblyScratchData( - const FiniteElement &fe) : - fe_values(fe, - QGauss(2), - update_values | update_gradients | update_quadrature_points | - update_JxW_values), - fe_face_values(fe, - QGauss(2), - update_values | update_quadrature_points | - update_JxW_values | update_normal_vectors) + const FiniteElement &fe) + : fe_values(fe, + QGauss(2), + update_values | update_gradients | update_quadrature_points | + update_JxW_values) + , fe_face_values(fe, + QGauss(2), + update_values | update_quadrature_points | + update_JxW_values | update_normal_vectors) {} template AdvectionProblem::AssemblyScratchData::AssemblyScratchData( - const AssemblyScratchData &scratch_data) : - fe_values(scratch_data.fe_values.get_fe(), - scratch_data.fe_values.get_quadrature(), - update_values | update_gradients | update_quadrature_points | - update_JxW_values), - fe_face_values(scratch_data.fe_face_values.get_fe(), - scratch_data.fe_face_values.get_quadrature(), - update_values | update_quadrature_points | - update_JxW_values | update_normal_vectors) + const AssemblyScratchData &scratch_data) + : fe_values(scratch_data.fe_values.get_fe(), + scratch_data.fe_values.get_quadrature(), + update_values | update_gradients | update_quadrature_points | + update_JxW_values) + , fe_face_values(scratch_data.fe_face_values.get_fe(), + scratch_data.fe_face_values.get_quadrature(), + update_values | update_quadrature_points | + update_JxW_values | update_normal_vectors) {} @@ -872,11 +877,14 @@ namespace Step9 { Vector estimated_error_per_cell(triangulation.n_active_cells()); - GradientEstimation::estimate( - dof_handler, solution, estimated_error_per_cell); + GradientEstimation::estimate(dof_handler, + solution, + estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.5, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.5, + 0.03); triangulation.execute_coarsening_and_refinement(); } @@ -951,23 +959,23 @@ namespace Step9 GradientEstimation::EstimateScratchData::EstimateScratchData( const FiniteElement &fe, const Vector & solution, - Vector & error_per_cell) : - fe_midpoint_value(fe, - QMidpoint(), - update_values | update_quadrature_points), - solution(solution), - error_per_cell(error_per_cell) + Vector & error_per_cell) + : fe_midpoint_value(fe, + QMidpoint(), + update_values | update_quadrature_points) + , solution(solution) + , error_per_cell(error_per_cell) {} template GradientEstimation::EstimateScratchData::EstimateScratchData( - const EstimateScratchData &scratch_data) : - fe_midpoint_value(scratch_data.fe_midpoint_value.get_fe(), - scratch_data.fe_midpoint_value.get_quadrature(), - update_values | update_quadrature_points), - solution(scratch_data.solution), - error_per_cell(scratch_data.error_per_cell) + const EstimateScratchData &scratch_data) + : fe_midpoint_value(scratch_data.fe_midpoint_value.get_fe(), + scratch_data.fe_midpoint_value.get_quadrature(), + update_values | update_quadrature_points) + , solution(scratch_data.solution) + , error_per_cell(scratch_data.error_per_cell) {} @@ -992,13 +1000,14 @@ namespace Step9 ExcInvalidVectorLength(error_per_cell.size(), dof_handler.get_triangulation().n_active_cells())); - WorkStream::run( - dof_handler.begin_active(), - dof_handler.end(), - &GradientEstimation::template estimate_cell, - std::function(), - EstimateScratchData(dof_handler.get_fe(), solution, error_per_cell), - EstimateCopyData()); + WorkStream::run(dof_handler.begin_active(), + dof_handler.end(), + &GradientEstimation::template estimate_cell, + std::function(), + EstimateScratchData(dof_handler.get_fe(), + solution, + error_per_cell), + EstimateCopyData()); } diff --git a/include/deal.II/algorithms/newton.templates.h b/include/deal.II/algorithms/newton.templates.h index da816e594c..4463984921 100644 --- a/include/deal.II/algorithms/newton.templates.h +++ b/include/deal.II/algorithms/newton.templates.h @@ -33,14 +33,14 @@ namespace Algorithms { template Newton::Newton(OperatorBase &residual, - OperatorBase &inverse_derivative) : - residual(&residual), - inverse_derivative(&inverse_derivative), - assemble_now(false), - n_stepsize_iterations(21), - assemble_threshold(0.), - debug_vectors(false), - debug(0) + OperatorBase &inverse_derivative) + : residual(&residual) + , inverse_derivative(&inverse_derivative) + , assemble_now(false) + , n_stepsize_iterations(21) + , assemble_threshold(0.) + , debug_vectors(false) + , debug(0) {} diff --git a/include/deal.II/algorithms/operator.templates.h b/include/deal.II/algorithms/operator.templates.h index 555c907245..5dc7e82740 100644 --- a/include/deal.II/algorithms/operator.templates.h +++ b/include/deal.II/algorithms/operator.templates.h @@ -28,9 +28,9 @@ DEAL_II_NAMESPACE_OPEN namespace Algorithms { template - OutputOperator::OutputOperator() : - step(numbers::invalid_unsigned_int), - os(nullptr) + OutputOperator::OutputOperator() + : step(numbers::invalid_unsigned_int) + , os(nullptr) {} template diff --git a/include/deal.II/algorithms/theta_timestepping.templates.h b/include/deal.II/algorithms/theta_timestepping.templates.h index ca65b1b5a3..0c15846f2b 100644 --- a/include/deal.II/algorithms/theta_timestepping.templates.h +++ b/include/deal.II/algorithms/theta_timestepping.templates.h @@ -30,11 +30,11 @@ namespace Algorithms { template ThetaTimestepping::ThetaTimestepping(OperatorBase &e, - OperatorBase &i) : - vtheta(0.5), - adaptive(false), - op_explicit(&e), - op_implicit(&i) + OperatorBase &i) + : vtheta(0.5) + , adaptive(false) + , op_explicit(&e) + , op_implicit(&i) { d_explicit.step = numbers::signaling_nan(); d_explicit.time = numbers::signaling_nan(); diff --git a/include/deal.II/base/aligned_vector.h b/include/deal.II/base/aligned_vector.h index bcf1cc6ff7..fc9583a558 100644 --- a/include/deal.II/base/aligned_vector.h +++ b/include/deal.II/base/aligned_vector.h @@ -377,9 +377,9 @@ namespace internal */ AlignedVectorCopy(const T *const source_begin, const T *const source_end, - T *const destination) : - source_(source_begin), - destination_(destination) + T *const destination) + : source_(source_begin) + , destination_(destination) { Assert(source_end >= source_begin, ExcInternalError()); Assert(source_end == source_begin || destination != nullptr, @@ -444,9 +444,9 @@ namespace internal */ AlignedVectorMove(T *const source_begin, T *const source_end, - T *const destination) : - source_(source_begin), - destination_(destination) + T *const destination) + : source_(source_begin) + , destination_(destination) { Assert(source_end >= source_begin, ExcInternalError()); Assert(source_end == source_begin || destination != nullptr, @@ -517,10 +517,10 @@ namespace internal */ AlignedVectorSet(const std::size_t size, const T & element, - T *const destination) : - element_(element), - destination_(destination), - trivial_element(false) + T *const destination) + : element_(element) + , destination_(destination) + , trivial_element(false) { if (size == 0) return; @@ -557,8 +557,9 @@ namespace internal // classes (they will never arrive here because they are // non-trivial). if (std::is_trivial::value == true && trivial_element) - std::memset( - (void *)(destination_ + begin), 0, (end - begin) * sizeof(T)); + std::memset((void *)(destination_ + begin), + 0, + (end - begin) * sizeof(T)); else copy_construct_or_assign( begin, end, std::integral_constant()); @@ -614,9 +615,8 @@ namespace internal * Constructor. Issues a parallel call if there are sufficiently many * elements, otherwise work in serial. */ - AlignedVectorDefaultInitialize(const std::size_t size, - T *const destination) : - destination_(destination) + AlignedVectorDefaultInitialize(const std::size_t size, T *const destination) + : destination_(destination) { if (size == 0) return; @@ -640,8 +640,9 @@ namespace internal // classes (they will never arrive here because they are // non-trivial). if (std::is_trivial::value == true) - std::memset( - (void *)(destination_ + begin), 0, (end - begin) * sizeof(T)); + std::memset((void *)(destination_ + begin), + 0, + (end - begin) * sizeof(T)); else default_construct_or_assign( begin, end, std::integral_constant()); @@ -678,19 +679,19 @@ namespace internal template -inline AlignedVector::AlignedVector() : - _data(nullptr), - _end_data(nullptr), - _end_allocated(nullptr) +inline AlignedVector::AlignedVector() + : _data(nullptr) + , _end_data(nullptr) + , _end_allocated(nullptr) {} template -inline AlignedVector::AlignedVector(const size_type size, const T &init) : - _data(nullptr), - _end_data(nullptr), - _end_allocated(nullptr) +inline AlignedVector::AlignedVector(const size_type size, const T &init) + : _data(nullptr) + , _end_data(nullptr) + , _end_allocated(nullptr) { if (size > 0) resize(size, init); @@ -707,10 +708,10 @@ inline AlignedVector::~AlignedVector() template -inline AlignedVector::AlignedVector(const AlignedVector &vec) : - _data(nullptr), - _end_data(nullptr), - _end_allocated(nullptr) +inline AlignedVector::AlignedVector(const AlignedVector &vec) + : _data(nullptr) + , _end_data(nullptr) + , _end_allocated(nullptr) { // copy the data from vec reserve(vec._end_data - vec._data); @@ -721,10 +722,10 @@ inline AlignedVector::AlignedVector(const AlignedVector &vec) : template -inline AlignedVector::AlignedVector(AlignedVector &&vec) noexcept : - _data(vec._data), - _end_data(vec._end_data), - _end_allocated(vec._end_allocated) +inline AlignedVector::AlignedVector(AlignedVector &&vec) noexcept + : _data(vec._data) + , _end_data(vec._end_data) + , _end_allocated(vec._end_allocated) { vec._data = nullptr; vec._end_data = nullptr; @@ -783,8 +784,9 @@ AlignedVector::resize_fast(const size_type size_in) // need to still set the values in case the class is non-trivial because // virtual classes etc. need to run their (default) constructor if (std::is_trivial::value == false && size_in > old_size) - dealii::internal::AlignedVectorDefaultInitialize( - size_in - old_size, _data + old_size); + dealii::internal::AlignedVectorDefaultInitialize(size_in - + old_size, + _data + old_size); } @@ -807,8 +809,9 @@ AlignedVector::resize(const size_type size_in) // finally set the desired init values if (size_in > old_size) - dealii::internal::AlignedVectorDefaultInitialize( - size_in - old_size, _data + old_size); + dealii::internal::AlignedVectorDefaultInitialize(size_in - + old_size, + _data + old_size); } @@ -831,8 +834,9 @@ AlignedVector::resize(const size_type size_in, const T &init) // finally set the desired init values if (size_in > old_size) - dealii::internal::AlignedVectorSet( - size_in - old_size, init, _data + old_size); + dealii::internal::AlignedVectorSet(size_in - old_size, + init, + _data + old_size); } @@ -857,8 +861,9 @@ AlignedVector::reserve(const size_type size_alloc) // allocate and align along 64-byte boundaries (this is enough for all // levels of vectorization currently supported by deal.II) T *new_data; - Utilities::System::posix_memalign( - (void **)&new_data, 64, size_actual_allocate); + Utilities::System::posix_memalign((void **)&new_data, + 64, + size_actual_allocate); // copy data in case there was some content before and release the old // memory with the function corresponding to the one used for allocating @@ -867,8 +872,9 @@ AlignedVector::reserve(const size_type size_alloc) _end_allocated = _data + new_size; if (_end_data != _data) { - dealii::internal::AlignedVectorMove( - new_data, new_data + old_size, _data); + dealii::internal::AlignedVectorMove(new_data, + new_data + old_size, + _data); free(new_data); } else diff --git a/include/deal.II/base/array_view.h b/include/deal.II/base/array_view.h index 25d77b2d40..1eccd86125 100644 --- a/include/deal.II/base/array_view.h +++ b/include/deal.II/base/array_view.h @@ -266,26 +266,26 @@ private: template inline ArrayView::ArrayView(value_type * starting_element, - const std::size_t n_elements) : - starting_element(starting_element), - n_elements(n_elements) + const std::size_t n_elements) + : starting_element(starting_element) + , n_elements(n_elements) {} template inline ArrayView::ArrayView( - const ArrayView::type> &view) : - starting_element(view.starting_element), - n_elements(view.n_elements) + const ArrayView::type> &view) + : starting_element(view.starting_element) + , n_elements(view.n_elements) {} template inline ArrayView::ArrayView( - const std::vector::type> &vector) : - // use delegating constructor + const std::vector::type> &vector) + : // use delegating constructor ArrayView(vector.data(), vector.size()) { // the following static_assert is not strictly necessary because, @@ -308,8 +308,8 @@ inline ArrayView::ArrayView( template inline ArrayView::ArrayView( - std::vector::type> &vector) : - // use delegating constructor + std::vector::type> &vector) + : // use delegating constructor ArrayView(vector.data(), vector.size()) {} @@ -493,9 +493,9 @@ make_array_view(const Iterator begin, const Iterator end) std::is_same::iterator_category, typename std::random_access_iterator_tag>::value, "The provided iterator should be a random access iterator."); - Assert( - begin <= end, - ExcMessage("The beginning of the array view should be before the end.")); + Assert(begin <= end, + ExcMessage( + "The beginning of the array view should be before the end.")); Assert(internal::ArrayViewHelper::is_contiguous(begin, end), ExcMessage("The provided range isn't contiguous in memory!")); // the reference type, not the value type, knows the constness of the iterator @@ -519,9 +519,9 @@ template ArrayView make_array_view(ElementType *const begin, ElementType *const end) { - Assert( - begin <= end, - ExcMessage("The beginning of the array view should be before the end.")); + Assert(begin <= end, + ExcMessage( + "The beginning of the array view should be before the end.")); return ArrayView(begin, end - begin); } diff --git a/include/deal.II/base/exceptions.h b/include/deal.II/base/exceptions.h index 223819ae3d..88d73270a9 100644 --- a/include/deal.II/base/exceptions.h +++ b/include/deal.II/base/exceptions.h @@ -196,22 +196,23 @@ private: * * @ingroup Exceptions */ -# define DeclExceptionMsg(Exception, defaulttext) \ - class Exception : public dealii::ExceptionBase \ - { \ - public: \ - Exception(const std::string &msg = defaulttext) : arg(msg) \ - {} \ - virtual ~Exception() noexcept \ - {} \ - virtual void \ - print_info(std::ostream &out) const override \ - { \ - out << " " << arg << std::endl; \ - } \ - \ - private: \ - const std::string arg; \ +# define DeclExceptionMsg(Exception, defaulttext) \ + class Exception : public dealii::ExceptionBase \ + { \ + public: \ + Exception(const std::string &msg = defaulttext) \ + : arg(msg) \ + {} \ + virtual ~Exception() noexcept \ + {} \ + virtual void \ + print_info(std::ostream &out) const override \ + { \ + out << " " << arg << std::endl; \ + } \ + \ + private: \ + const std::string arg; \ } /** @@ -224,7 +225,8 @@ private: class Exception1 : public dealii::ExceptionBase \ { \ public: \ - Exception1(type1 const &a1) : arg1(a1) \ + Exception1(type1 const &a1) \ + : arg1(a1) \ {} \ virtual ~Exception1() noexcept \ {} \ @@ -245,23 +247,25 @@ private: * * @ingroup Exceptions */ -# define DeclException2(Exception2, type1, type2, outsequence) \ - class Exception2 : public dealii::ExceptionBase \ - { \ - public: \ - Exception2(type1 const &a1, type2 const &a2) : arg1(a1), arg2(a2) \ - {} \ - virtual ~Exception2() noexcept \ - {} \ - virtual void \ - print_info(std::ostream &out) const override \ - { \ - out << " " outsequence << std::endl; \ - } \ - \ - private: \ - type1 const arg1; \ - type2 const arg2; \ +# define DeclException2(Exception2, type1, type2, outsequence) \ + class Exception2 : public dealii::ExceptionBase \ + { \ + public: \ + Exception2(type1 const &a1, type2 const &a2) \ + : arg1(a1) \ + , arg2(a2) \ + {} \ + virtual ~Exception2() noexcept \ + {} \ + virtual void \ + print_info(std::ostream &out) const override \ + { \ + out << " " outsequence << std::endl; \ + } \ + \ + private: \ + type1 const arg1; \ + type2 const arg2; \ } @@ -275,10 +279,10 @@ private: class Exception3 : public dealii::ExceptionBase \ { \ public: \ - Exception3(type1 const &a1, type2 const &a2, type3 const &a3) : \ - arg1(a1), \ - arg2(a2), \ - arg3(a3) \ + Exception3(type1 const &a1, type2 const &a2, type3 const &a3) \ + : arg1(a1) \ + , arg2(a2) \ + , arg3(a3) \ {} \ virtual ~Exception3() noexcept \ {} \ @@ -308,11 +312,11 @@ private: Exception4(type1 const &a1, \ type2 const &a2, \ type3 const &a3, \ - type4 const &a4) : \ - arg1(a1), \ - arg2(a2), \ - arg3(a3), \ - arg4(a4) \ + type4 const &a4) \ + : arg1(a1) \ + , arg2(a2) \ + , arg3(a3) \ + , arg4(a4) \ {} \ virtual ~Exception4() noexcept \ {} \ @@ -345,12 +349,12 @@ private: type2 const &a2, \ type3 const &a3, \ type4 const &a4, \ - type5 const &a5) : \ - arg1(a1), \ - arg2(a2), \ - arg3(a3), \ - arg4(a4), \ - arg5(a5) \ + type5 const &a5) \ + : arg1(a1) \ + , arg2(a2) \ + , arg3(a3) \ + , arg4(a4) \ + , arg5(a5) \ {} \ virtual ~Exception5() noexcept \ {} \ @@ -440,8 +444,10 @@ private: # define DeclException4(Exception4, type1, type2, type3, type4, outsequence) \ /** @ingroup Exceptions */ \ /** @dealiiExceptionMessage{outsequence} */ \ - static dealii::ExceptionBase &Exception4( \ - type1 arg1, type2 arg2, type3 arg3, type4 arg4) + static dealii::ExceptionBase &Exception4(type1 arg1, \ + type2 arg2, \ + type3 arg3, \ + type4 arg4) /** diff --git a/include/deal.II/base/function.templates.h b/include/deal.II/base/function.templates.h index 37e4b0712d..3dbbb7245c 100644 --- a/include/deal.II/base/function.templates.h +++ b/include/deal.II/base/function.templates.h @@ -34,9 +34,9 @@ const unsigned int Function::dimension; template Function::Function(const unsigned int n_components, - const RangeNumberType initial_time) : - FunctionTime(initial_time), - n_components(n_components) + const RangeNumberType initial_time) + : FunctionTime(initial_time) + , n_components(n_components) { // avoid the construction of function objects that don't return any // values. This doesn't make much sense in the first place, but will lead @@ -319,8 +319,8 @@ namespace Functions { template ZeroFunction::ZeroFunction( - const unsigned int n_components) : - ConstantFunction(RangeNumberType(), n_components) + const unsigned int n_components) + : ConstantFunction(RangeNumberType(), n_components) {} } // namespace Functions @@ -332,24 +332,24 @@ namespace Functions template ConstantFunction::ConstantFunction( const RangeNumberType value, - const unsigned int n_components) : - Function(n_components), - function_value_vector(n_components, value) + const unsigned int n_components) + : Function(n_components) + , function_value_vector(n_components, value) {} template ConstantFunction::ConstantFunction( - const std::vector &values) : - Function(values.size()), - function_value_vector(values) + const std::vector &values) + : Function(values.size()) + , function_value_vector(values) {} template ConstantFunction::ConstantFunction( - const Vector &values) : - Function(values.size()), - function_value_vector(values.size()) + const Vector &values) + : Function(values.size()) + , function_value_vector(values.size()) { Assert(values.size() == function_value_vector.size(), ExcDimensionMismatch(values.size(), function_value_vector.size())); @@ -360,13 +360,14 @@ namespace Functions template ConstantFunction::ConstantFunction( const RangeNumberType *begin_ptr, - const unsigned int n_components) : - Function(n_components), - function_value_vector(n_components) + const unsigned int n_components) + : Function(n_components) + , function_value_vector(n_components) { Assert(begin_ptr != nullptr, ExcMessage("Null pointer encountered!")); - std::copy( - begin_ptr, begin_ptr + n_components, function_value_vector.begin()); + std::copy(begin_ptr, + begin_ptr + n_components, + function_value_vector.begin()); } @@ -432,9 +433,9 @@ namespace Functions for (unsigned int i = 0; i < points.size(); ++i) { - Assert( - return_values[i].size() == this->n_components, - ExcDimensionMismatch(return_values[i].size(), this->n_components)); + Assert(return_values[i].size() == this->n_components, + ExcDimensionMismatch(return_values[i].size(), + this->n_components)); std::copy(function_value_vector.begin(), function_value_vector.end(), return_values[i].begin()); @@ -517,9 +518,9 @@ template ComponentSelectFunction::ComponentSelectFunction( const unsigned int selected, const RangeNumberType value, - const unsigned int n_components) : - ConstantFunction(value, n_components), - selected_components(std::make_pair(selected, selected + 1)) + const unsigned int n_components) + : ConstantFunction(value, n_components) + , selected_components(std::make_pair(selected, selected + 1)) {} @@ -527,9 +528,9 @@ ComponentSelectFunction::ComponentSelectFunction( template ComponentSelectFunction::ComponentSelectFunction( const unsigned int selected, - const unsigned int n_components) : - ConstantFunction(1., n_components), - selected_components(std::make_pair(selected, selected + 1)) + const unsigned int n_components) + : ConstantFunction(1., n_components) + , selected_components(std::make_pair(selected, selected + 1)) { Assert(selected < n_components, ExcIndexRange(selected, 0, n_components)); } @@ -539,9 +540,9 @@ ComponentSelectFunction::ComponentSelectFunction( template ComponentSelectFunction::ComponentSelectFunction( const std::pair &selected, - const unsigned int n_components) : - ConstantFunction(1., n_components), - selected_components(selected) + const unsigned int n_components) + : ConstantFunction(1., n_components) + , selected_components(selected) { Assert(selected_components.first < selected_components.second, ExcMessage("The upper bound of the interval must be larger than " @@ -614,9 +615,9 @@ ComponentSelectFunction::memory_consumption() const template ScalarFunctionFromFunctionObject:: ScalarFunctionFromFunctionObject( - const std::function &)> &function_object) : - Function(1), - function_object(function_object) + const std::function &)> &function_object) + : Function(1) + , function_object(function_object) {} @@ -640,10 +641,10 @@ VectorFunctionFromScalarFunctionObject:: VectorFunctionFromScalarFunctionObject( const std::function &)> &function_object, const unsigned int selected_component, - const unsigned int n_components) : - Function(n_components), - function_object(function_object), - selected_component(selected_component) + const unsigned int n_components) + : Function(n_components) + , function_object(function_object) + , selected_component(selected_component) { Assert(selected_component < this->n_components, ExcIndexRange(selected_component, 0, this->n_components)); @@ -693,10 +694,10 @@ VectorFunctionFromTensorFunction:: VectorFunctionFromTensorFunction( const TensorFunction<1, dim, RangeNumberType> &tensor_function, const unsigned int selected_component, - const unsigned int n_components) : - Function(n_components), - tensor_function(tensor_function), - selected_component(selected_component) + const unsigned int n_components) + : Function(n_components) + , tensor_function(tensor_function) + , selected_component(selected_component) { // Verify that the Tensor<1,dim,RangeNumberType> will fit in the given length // selected_components and not hang over the end of the vector. diff --git a/include/deal.II/base/function_time.templates.h b/include/deal.II/base/function_time.templates.h index 83c9f766ee..ebc56fb6f8 100644 --- a/include/deal.II/base/function_time.templates.h +++ b/include/deal.II/base/function_time.templates.h @@ -22,8 +22,8 @@ DEAL_II_NAMESPACE_OPEN template -FunctionTime::FunctionTime(const Number initial_time) : - time(initial_time) +FunctionTime::FunctionTime(const Number initial_time) + : time(initial_time) {} diff --git a/include/deal.II/base/geometry_info.h b/include/deal.II/base/geometry_info.h index ef36a0ace3..ab8e2799b1 100644 --- a/include/deal.II/base/geometry_info.h +++ b/include/deal.II/base/geometry_info.h @@ -2308,15 +2308,14 @@ GeometryInfo<3>::d_linear_shape_function_gradient(const Point<3> & xi, /* -------------- inline functions ------------- */ -inline GeometryPrimitive::GeometryPrimitive(const Object object) : - object(object) +inline GeometryPrimitive::GeometryPrimitive(const Object object) + : object(object) {} -inline GeometryPrimitive::GeometryPrimitive( - const unsigned int object_dimension) : - object(static_cast(object_dimension)) +inline GeometryPrimitive::GeometryPrimitive(const unsigned int object_dimension) + : object(static_cast(object_dimension)) {} @@ -2331,9 +2330,8 @@ namespace internal { template inline SubfaceCase::SubfaceCase( - const typename SubfacePossibilities::Possibilities - subface_possibility) : - value(subface_possibility) + const typename SubfacePossibilities::Possibilities subface_possibility) + : value(subface_possibility) {} @@ -2396,41 +2394,41 @@ RefinementCase<3>::cut_axis(const unsigned int i) template -inline RefinementCase::RefinementCase() : - value(RefinementPossibilities::no_refinement) +inline RefinementCase::RefinementCase() + : value(RefinementPossibilities::no_refinement) {} template inline RefinementCase::RefinementCase( - const typename RefinementPossibilities::Possibilities refinement_case) : - value(refinement_case) + const typename RefinementPossibilities::Possibilities refinement_case) + : value(refinement_case) { // check that only those bits of // the given argument are set that // make sense for a given space // dimension - Assert( - (refinement_case & RefinementPossibilities::isotropic_refinement) == - refinement_case, - ExcInvalidRefinementCase(refinement_case)); + Assert((refinement_case & + RefinementPossibilities::isotropic_refinement) == + refinement_case, + ExcInvalidRefinementCase(refinement_case)); } template -inline RefinementCase::RefinementCase(const std::uint8_t refinement_case) : - value(refinement_case) +inline RefinementCase::RefinementCase(const std::uint8_t refinement_case) + : value(refinement_case) { // check that only those bits of // the given argument are set that // make sense for a given space // dimension - Assert( - (refinement_case & RefinementPossibilities::isotropic_refinement) == - refinement_case, - ExcInvalidRefinementCase(refinement_case)); + Assert((refinement_case & + RefinementPossibilities::isotropic_refinement) == + refinement_case, + ExcInvalidRefinementCase(refinement_case)); } @@ -2612,9 +2610,10 @@ GeometryInfo<2>::cell_to_child_coordinates(const Point<2> & p, const RefinementCase<2> refine_case) { - Assert( - child_index < GeometryInfo<2>::n_children(refine_case), - ExcIndexRange(child_index, 0, GeometryInfo<2>::n_children(refine_case))); + Assert(child_index < GeometryInfo<2>::n_children(refine_case), + ExcIndexRange(child_index, + 0, + GeometryInfo<2>::n_children(refine_case))); Point<2> point = p; switch (refine_case) @@ -2649,9 +2648,10 @@ GeometryInfo<3>::cell_to_child_coordinates(const Point<3> & p, const RefinementCase<3> refine_case) { - Assert( - child_index < GeometryInfo<3>::n_children(refine_case), - ExcIndexRange(child_index, 0, GeometryInfo<3>::n_children(refine_case))); + Assert(child_index < GeometryInfo<3>::n_children(refine_case), + ExcIndexRange(child_index, + 0, + GeometryInfo<3>::n_children(refine_case))); Point<3> point = p; // there might be a cleverer way to do @@ -2754,9 +2754,10 @@ GeometryInfo<3>::child_to_cell_coordinates(const Point<3> & p, const RefinementCase<3> refine_case) { - Assert( - child_index < GeometryInfo<3>::n_children(refine_case), - ExcIndexRange(child_index, 0, GeometryInfo<3>::n_children(refine_case))); + Assert(child_index < GeometryInfo<3>::n_children(refine_case), + ExcIndexRange(child_index, + 0, + GeometryInfo<3>::n_children(refine_case))); Point<3> point = p; // there might be a cleverer way to do @@ -2828,9 +2829,10 @@ GeometryInfo<2>::child_to_cell_coordinates(const Point<2> & p, const unsigned int child_index, const RefinementCase<2> refine_case) { - Assert( - child_index < GeometryInfo<2>::n_children(refine_case), - ExcIndexRange(child_index, 0, GeometryInfo<2>::n_children(refine_case))); + Assert(child_index < GeometryInfo<2>::n_children(refine_case), + ExcIndexRange(child_index, + 0, + GeometryInfo<2>::n_children(refine_case))); Point<2> point = p; switch (refine_case) @@ -2977,19 +2979,19 @@ GeometryInfo<3>::line_to_cell_vertices(const unsigned int line, Assert(line < lines_per_cell, ExcIndexRange(line, 0, lines_per_cell)); Assert(vertex < 2, ExcIndexRange(vertex, 0, 2)); - constexpr unsigned vertices[lines_per_cell][2] = { - {0, 2}, // bottom face - {1, 3}, - {0, 1}, - {2, 3}, - {4, 6}, // top face - {5, 7}, - {4, 5}, - {6, 7}, - {0, 4}, // connects of bottom - {1, 5}, // top face - {2, 6}, - {3, 7}}; + constexpr unsigned vertices[lines_per_cell][2] = {{0, 2}, // bottom face + {1, 3}, + {0, 1}, + {2, 3}, + {4, 6}, // top face + {5, 7}, + {4, 5}, + {6, 7}, + {0, + 4}, // connects of bottom + {1, 5}, // top face + {2, 6}, + {3, 7}}; return vertices[line][vertex]; } @@ -3908,10 +3910,10 @@ GeometryInfo<3>::child_cell_on_face(const RefinementCase<3> &ref_case, Assert(ref_case > RefinementCase::no_refinement, ExcMessage("Cell has no children.")); Assert(face < faces_per_cell, ExcIndexRange(face, 0, faces_per_cell)); - Assert( - subface < GeometryInfo::n_children(face_ref_case) || - (subface == 0 && face_ref_case == RefinementCase::no_refinement), - ExcIndexRange(subface, 0, GeometryInfo<2>::n_children(face_ref_case))); + Assert(subface < GeometryInfo::n_children(face_ref_case) || + (subface == 0 && + face_ref_case == RefinementCase::no_refinement), + ExcIndexRange(subface, 0, GeometryInfo<2>::n_children(face_ref_case))); // invalid number used for invalid cases, // e.g. when the children are more refined at @@ -4392,8 +4394,9 @@ Tensor<1, 3> inline GeometryInfo<3>::d_linear_shape_function_gradient( switch (i) { case 0: - return Point<3>( - -(1 - y) * (1 - z), -(1 - x) * (1 - z), -(1 - x) * (1 - y)); + return Point<3>(-(1 - y) * (1 - z), + -(1 - x) * (1 - z), + -(1 - x) * (1 - y)); case 1: return Point<3>((1 - y) * (1 - z), -x * (1 - z), -x * (1 - y)); case 2: diff --git a/include/deal.II/base/graph_coloring.h b/include/deal.II/base/graph_coloring.h index 7879ccf7c6..d396e496c0 100644 --- a/include/deal.II/base/graph_coloring.h +++ b/include/deal.II/base/graph_coloring.h @@ -545,9 +545,9 @@ namespace GraphColoring const std::function( const typename identity::type &)> &get_conflict_indices) { - Assert( - begin != end, - ExcMessage("GraphColoring is not prepared to deal with empty ranges!")); + Assert(begin != end, + ExcMessage( + "GraphColoring is not prepared to deal with empty ranges!")); // Create the partitioning. std::vector> partitioning = diff --git a/include/deal.II/base/index_set.h b/include/deal.II/base/index_set.h index 29f91e431e..42dd03323e 100644 --- a/include/deal.II/base/index_set.h +++ b/include/deal.II/base/index_set.h @@ -981,9 +981,9 @@ complete_index_set(const unsigned int N) inline IndexSet::IntervalAccessor::IntervalAccessor( const IndexSet * idxset, - const IndexSet::size_type range_idx) : - index_set(idxset), - range_idx(range_idx) + const IndexSet::size_type range_idx) + : index_set(idxset) + , range_idx(range_idx) { Assert(range_idx < idxset->n_intervals(), ExcInternalError("Invalid range index")); @@ -991,17 +991,17 @@ inline IndexSet::IntervalAccessor::IntervalAccessor( -inline IndexSet::IntervalAccessor::IntervalAccessor(const IndexSet *idxset) : - index_set(idxset), - range_idx(numbers::invalid_dof_index) +inline IndexSet::IntervalAccessor::IntervalAccessor(const IndexSet *idxset) + : index_set(idxset) + , range_idx(numbers::invalid_dof_index) {} inline IndexSet::IntervalAccessor::IntervalAccessor( - const IndexSet::IntervalAccessor &other) : - index_set(other.index_set), - range_idx(other.range_idx) + const IndexSet::IntervalAccessor &other) + : index_set(other.index_set) + , range_idx(other.range_idx) { Assert(range_idx == numbers::invalid_dof_index || is_valid(), ExcMessage("invalid iterator")); @@ -1030,8 +1030,9 @@ inline IndexSet::ElementIterator IndexSet::IntervalAccessor::begin() const { Assert(is_valid(), ExcMessage("invalid iterator")); - return IndexSet::ElementIterator( - index_set, range_idx, index_set->ranges[range_idx].begin); + return IndexSet::ElementIterator(index_set, + range_idx, + index_set->ranges[range_idx].begin); } @@ -1043,8 +1044,9 @@ IndexSet::IntervalAccessor::end() const // point to first index in next interval unless we are the last interval. if (range_idx < index_set->ranges.size() - 1) - return IndexSet::ElementIterator( - index_set, range_idx + 1, index_set->ranges[range_idx + 1].begin); + return IndexSet::ElementIterator(index_set, + range_idx + 1, + index_set->ranges[range_idx + 1].begin); else return index_set->end(); } @@ -1077,9 +1079,9 @@ inline bool IndexSet::IntervalAccessor:: operator==(const IndexSet::IntervalAccessor &other) const { - Assert( - index_set == other.index_set, - ExcMessage("Can not compare accessors pointing to different IndexSets")); + Assert(index_set == other.index_set, + ExcMessage( + "Can not compare accessors pointing to different IndexSets")); return range_idx == other.range_idx; } @@ -1089,9 +1091,9 @@ inline bool IndexSet::IntervalAccessor:: operator<(const IndexSet::IntervalAccessor &other) const { - Assert( - index_set == other.index_set, - ExcMessage("Can not compare accessors pointing to different IndexSets")); + Assert(index_set == other.index_set, + ExcMessage( + "Can not compare accessors pointing to different IndexSets")); return range_idx < other.range_idx; } @@ -1116,26 +1118,27 @@ IndexSet::IntervalAccessor::advance() inline IndexSet::IntervalIterator::IntervalIterator( const IndexSet * idxset, - const IndexSet::size_type range_idx) : - accessor(idxset, range_idx) + const IndexSet::size_type range_idx) + : accessor(idxset, range_idx) {} -inline IndexSet::IntervalIterator::IntervalIterator() : accessor(nullptr) +inline IndexSet::IntervalIterator::IntervalIterator() + : accessor(nullptr) {} -inline IndexSet::IntervalIterator::IntervalIterator(const IndexSet *idxset) : - accessor(idxset) +inline IndexSet::IntervalIterator::IntervalIterator(const IndexSet *idxset) + : accessor(idxset) {} inline IndexSet::IntervalIterator::IntervalIterator( - const IndexSet::IntervalIterator &other) : - accessor(other.accessor) + const IndexSet::IntervalIterator &other) + : accessor(other.accessor) {} @@ -1215,9 +1218,9 @@ inline int IndexSet::IntervalIterator:: operator-(const IndexSet::IntervalIterator &other) const { - Assert( - accessor.index_set == other.accessor.index_set, - ExcMessage("Can not compare iterators belonging to different IndexSets")); + Assert(accessor.index_set == other.accessor.index_set, + ExcMessage( + "Can not compare iterators belonging to different IndexSets")); const size_type lhs = (accessor.range_idx == numbers::invalid_dof_index) ? accessor.index_set->ranges.size() : @@ -1240,10 +1243,10 @@ operator-(const IndexSet::IntervalIterator &other) const inline IndexSet::ElementIterator::ElementIterator( const IndexSet * idxset, const IndexSet::size_type range_idx, - const IndexSet::size_type index) : - index_set(idxset), - range_idx(range_idx), - idx(index) + const IndexSet::size_type index) + : index_set(idxset) + , range_idx(range_idx) + , idx(index) { Assert(range_idx < index_set->ranges.size(), ExcMessage( @@ -1257,10 +1260,10 @@ inline IndexSet::ElementIterator::ElementIterator( -inline IndexSet::ElementIterator::ElementIterator(const IndexSet *idxset) : - index_set(idxset), - range_idx(numbers::invalid_dof_index), - idx(numbers::invalid_dof_index) +inline IndexSet::ElementIterator::ElementIterator(const IndexSet *idxset) + : index_set(idxset) + , range_idx(numbers::invalid_dof_index) + , idx(numbers::invalid_dof_index) {} @@ -1295,9 +1298,9 @@ inline bool IndexSet::ElementIterator:: operator==(const IndexSet::ElementIterator &other) const { - Assert( - index_set == other.index_set, - ExcMessage("Can not compare iterators belonging to different IndexSets")); + Assert(index_set == other.index_set, + ExcMessage( + "Can not compare iterators belonging to different IndexSets")); return range_idx == other.range_idx && idx == other.idx; } @@ -1364,9 +1367,9 @@ inline bool IndexSet::ElementIterator:: operator<(const IndexSet::ElementIterator &other) const { - Assert( - index_set == other.index_set, - ExcMessage("Can not compare iterators belonging to different IndexSets")); + Assert(index_set == other.index_set, + ExcMessage( + "Can not compare iterators belonging to different IndexSets")); return range_idx < other.range_idx || (range_idx == other.range_idx && idx < other.idx); } @@ -1377,9 +1380,9 @@ inline std::ptrdiff_t IndexSet::ElementIterator:: operator-(const IndexSet::ElementIterator &other) const { - Assert( - index_set == other.index_set, - ExcMessage("Can not compare iterators belonging to different IndexSets")); + Assert(index_set == other.index_set, + ExcMessage( + "Can not compare iterators belonging to different IndexSets")); if (*this == other) return 0; if (!(*this < other)) @@ -1417,45 +1420,45 @@ operator-(const IndexSet::ElementIterator &other) const /* Range */ -inline IndexSet::Range::Range() : - begin(numbers::invalid_dof_index), - end(numbers::invalid_dof_index), - nth_index_in_set(numbers::invalid_dof_index) +inline IndexSet::Range::Range() + : begin(numbers::invalid_dof_index) + , end(numbers::invalid_dof_index) + , nth_index_in_set(numbers::invalid_dof_index) {} -inline IndexSet::Range::Range(const size_type i1, const size_type i2) : - begin(i1), - end(i2), - nth_index_in_set(numbers::invalid_dof_index) +inline IndexSet::Range::Range(const size_type i1, const size_type i2) + : begin(i1) + , end(i2) + , nth_index_in_set(numbers::invalid_dof_index) {} /* IndexSet itself */ -inline IndexSet::IndexSet() : - is_compressed(true), - index_space_size(0), - largest_range(numbers::invalid_unsigned_int) +inline IndexSet::IndexSet() + : is_compressed(true) + , index_space_size(0) + , largest_range(numbers::invalid_unsigned_int) {} -inline IndexSet::IndexSet(const size_type size) : - is_compressed(true), - index_space_size(size), - largest_range(numbers::invalid_unsigned_int) +inline IndexSet::IndexSet(const size_type size) + : is_compressed(true) + , index_space_size(size) + , largest_range(numbers::invalid_unsigned_int) {} -inline IndexSet::IndexSet(IndexSet &&is) noexcept : - ranges(std::move(is.ranges)), - is_compressed(is.is_compressed), - index_space_size(is.index_space_size), - largest_range(is.largest_range) +inline IndexSet::IndexSet(IndexSet &&is) noexcept + : ranges(std::move(is.ranges)) + , is_compressed(is.is_compressed) + , index_space_size(is.index_space_size) + , largest_range(is.largest_range) { is.ranges.clear(); is.is_compressed = true; @@ -1635,9 +1638,10 @@ IndexSet::add_index(const size_type index) else if (index == ranges.back().end) ranges.back().end++; else - ranges.insert( - Utilities::lower_bound(ranges.begin(), ranges.end(), new_range), - new_range); + ranges.insert(Utilities::lower_bound(ranges.begin(), + ranges.end(), + new_range), + new_range); is_compressed = false; } diff --git a/include/deal.II/base/iterator_range.h b/include/deal.II/base/iterator_range.h index 1e4aa13428..eaba74d719 100644 --- a/include/deal.II/base/iterator_range.h +++ b/include/deal.II/base/iterator_range.h @@ -241,8 +241,8 @@ private: template inline IteratorRange::IteratorOverIterators::IteratorOverIterators( - const BaseIterator &iterator) : - element_of_iterator_collection(iterator) + const BaseIterator &iterator) + : element_of_iterator_collection(iterator) {} @@ -297,16 +297,18 @@ operator!=(const IteratorOverIterators &i_o_i) template -inline IteratorRange::IteratorRange() : it_begin(), it_end() +inline IteratorRange::IteratorRange() + : it_begin() + , it_end() {} template inline IteratorRange::IteratorRange(const iterator b, - const iterator e) : - it_begin(b), - it_end(e) + const iterator e) + : it_begin(b) + , it_end(e) {} diff --git a/include/deal.II/base/linear_index_iterator.h b/include/deal.II/base/linear_index_iterator.h index 353ca9b13b..de4047b15a 100644 --- a/include/deal.II/base/linear_index_iterator.h +++ b/include/deal.II/base/linear_index_iterator.h @@ -510,8 +510,8 @@ operator>(const DerivedIterator &other) const template inline LinearIndexIterator::LinearIndexIterator( - const AccessorType accessor) : - accessor(accessor) + const AccessorType accessor) + : accessor(accessor) {} diff --git a/include/deal.II/base/mg_level_object.h b/include/deal.II/base/mg_level_object.h index 68d576443e..3aaa2adf88 100644 --- a/include/deal.II/base/mg_level_object.h +++ b/include/deal.II/base/mg_level_object.h @@ -181,8 +181,8 @@ private: template MGLevelObject::MGLevelObject(const unsigned int min, - const unsigned int max) : - minlevel(0) + const unsigned int max) + : minlevel(0) { resize(min, max); } diff --git a/include/deal.II/base/mpi.h b/include/deal.II/base/mpi.h index 8e07bbbb45..d9fb558b1c 100644 --- a/include/deal.II/base/mpi.h +++ b/include/deal.II/base/mpi.h @@ -729,16 +729,17 @@ namespace Utilities ierr = MPI_Recv( buffer.data(), len, MPI_CHAR, rank, 21, comm, MPI_STATUS_IGNORE); AssertThrowMPI(ierr); - Assert( - received_objects.find(rank) == received_objects.end(), - ExcInternalError("I should not receive again from this rank")); + Assert(received_objects.find(rank) == received_objects.end(), + ExcInternalError( + "I should not receive again from this rank")); received_objects[rank] = Utilities::unpack(buffer); } } // Wait to have sent all objects. - MPI_Waitall( - send_to.size(), buffer_send_requests.data(), MPI_STATUSES_IGNORE); + MPI_Waitall(send_to.size(), + buffer_send_requests.data(), + MPI_STATUSES_IGNORE); return received_objects; # endif // deal.II with MPI @@ -789,9 +790,10 @@ namespace Utilities std::vector received_objects(n_procs); for (unsigned int i = 0; i < n_procs; ++i) { - std::vector local_buffer( - received_unrolled_buffer.begin() + rdispls[i], - received_unrolled_buffer.begin() + rdispls[i] + size_all_data[i]); + std::vector local_buffer(received_unrolled_buffer.begin() + + rdispls[i], + received_unrolled_buffer.begin() + + rdispls[i] + size_all_data[i]); received_objects[i] = Utilities::unpack(local_buffer); } diff --git a/include/deal.II/base/mpi.templates.h b/include/deal.II/base/mpi.templates.h index ba0c15bcf2..4de4cc641d 100644 --- a/include/deal.II/base/mpi.templates.h +++ b/include/deal.II/base/mpi.templates.h @@ -162,20 +162,21 @@ namespace Utilities "values has different size across MPI processes.")); } # endif - const int ierr = MPI_Allreduce( - values != output ? - // TODO This const_cast is only needed for older - // (e.g., openMPI 1.6, released in 2012) - // implementations of MPI-2. It is not needed as - // of MPI-3 and we should remove it at some - // point in the future. - const_cast(static_cast(values.data())) : - MPI_IN_PLACE, - static_cast(output.data()), - static_cast(values.size()), - internal::mpi_type_id(values.data()), - mpi_op, - mpi_communicator); + const int ierr = + MPI_Allreduce(values != output ? + // TODO This const_cast is only needed for older + // (e.g., openMPI 1.6, released in 2012) + // implementations of MPI-2. It is not needed as + // of MPI-3 and we should remove it at some + // point in the future. + const_cast( + static_cast(values.data())) : + MPI_IN_PLACE, + static_cast(output.data()), + static_cast(values.size()), + internal::mpi_type_id(values.data()), + mpi_op, + mpi_communicator); AssertThrowMPI(ierr); } else @@ -201,20 +202,21 @@ namespace Utilities #ifdef DEAL_II_WITH_MPI if (job_supports_mpi()) { - const int ierr = MPI_Allreduce( - values != output ? - // TODO This const_cast is only needed for older - // (e.g., openMPI 1.6, released in 2012) - // implementations of MPI-2. It is not needed as - // of MPI-3 and we should remove it at some - // point in the future. - const_cast(static_cast(values.data())) : - MPI_IN_PLACE, - static_cast(output.data()), - static_cast(values.size() * 2), - internal::mpi_type_id(static_cast(nullptr)), - mpi_op, - mpi_communicator); + const int ierr = + MPI_Allreduce(values != output ? + // TODO This const_cast is only needed for older + // (e.g., openMPI 1.6, released in 2012) + // implementations of MPI-2. It is not needed as + // of MPI-3 and we should remove it at some + // point in the future. + const_cast( + static_cast(values.data())) : + MPI_IN_PLACE, + static_cast(output.data()), + static_cast(values.size() * 2), + internal::mpi_type_id(static_cast(nullptr)), + mpi_op, + mpi_communicator); AssertThrowMPI(ierr); } else diff --git a/include/deal.II/base/parallel.h b/include/deal.II/base/parallel.h index c86b17f54e..d0ffb55744 100644 --- a/include/deal.II/base/parallel.h +++ b/include/deal.II/base/parallel.h @@ -80,7 +80,8 @@ namespace parallel /** * Constructor. Take and package the given function object. */ - Body(const F &f) : f(f) + Body(const F &f) + : f(f) {} template @@ -187,10 +188,11 @@ namespace parallel typedef SynchronousIterators SyncIterators; Iterators x_begin(begin_in, out); Iterators x_end(end_in, OutputIterator()); - tbb::parallel_for( - tbb::blocked_range(x_begin, x_end, grainsize), - internal::make_body(predicate), - tbb::auto_partitioner()); + tbb::parallel_for(tbb::blocked_range(x_begin, + x_end, + grainsize), + internal::make_body(predicate), + tbb::auto_partitioner()); #endif } @@ -244,10 +246,11 @@ namespace parallel typedef SynchronousIterators SyncIterators; Iterators x_begin(begin_in1, in2, out); Iterators x_end(end_in1, InputIterator2(), OutputIterator()); - tbb::parallel_for( - tbb::blocked_range(x_begin, x_end, grainsize), - internal::make_body(predicate), - tbb::auto_partitioner()); + tbb::parallel_for(tbb::blocked_range(x_begin, + x_end, + grainsize), + internal::make_body(predicate), + tbb::auto_partitioner()); #endif } @@ -303,12 +306,15 @@ namespace parallel Iterators; typedef SynchronousIterators SyncIterators; Iterators x_begin(begin_in1, in2, in3, out); - Iterators x_end( - end_in1, InputIterator2(), InputIterator3(), OutputIterator()); - tbb::parallel_for( - tbb::blocked_range(x_begin, x_end, grainsize), - internal::make_body(predicate), - tbb::auto_partitioner()); + Iterators x_end(end_in1, + InputIterator2(), + InputIterator3(), + OutputIterator()); + tbb::parallel_for(tbb::blocked_range(x_begin, + x_end, + grainsize), + internal::make_body(predicate), + tbb::auto_partitioner()); #endif } @@ -523,21 +529,21 @@ namespace parallel template ReductionOnSubranges(const Function & f, const Reductor & reductor, - const ResultType neutral_element = ResultType()) : - result(neutral_element), - f(f), - neutral_element(neutral_element), - reductor(reductor) + const ResultType neutral_element = ResultType()) + : result(neutral_element) + , f(f) + , neutral_element(neutral_element) + , reductor(reductor) {} /** * Splitting constructor. See the TBB book for more details about this. */ - ReductionOnSubranges(const ReductionOnSubranges &r, tbb::split) : - result(r.neutral_element), - f(r.f), - neutral_element(r.neutral_element), - reductor(r.reductor) + ReductionOnSubranges(const ReductionOnSubranges &r, tbb::split) + : result(r.neutral_element) + , f(r.f) + , neutral_element(r.neutral_element) + , reductor(r.reductor) {} /** @@ -790,8 +796,8 @@ namespace parallel */ struct ParallelForWrapper { - ParallelForWrapper(const parallel::ParallelForInteger &worker) : - worker_(worker) + ParallelForWrapper(const parallel::ParallelForInteger &worker) + : worker_(worker) {} void diff --git a/include/deal.II/base/parameter_acceptor.h b/include/deal.II/base/parameter_acceptor.h index 7ae6e40e0d..ba1303c541 100644 --- a/include/deal.II/base/parameter_acceptor.h +++ b/include/deal.II/base/parameter_acceptor.h @@ -640,9 +640,9 @@ template template ParameterAcceptorProxy::ParameterAcceptorProxy( const std::string section_name, - Args... args) : - SourceClass(args...), - ParameterAcceptor(section_name) + Args... args) + : SourceClass(args...) + , ParameterAcceptor(section_name) {} diff --git a/include/deal.II/base/parameter_handler.h b/include/deal.II/base/parameter_handler.h index 9f12d671cd..cf571cb201 100644 --- a/include/deal.II/base/parameter_handler.h +++ b/include/deal.II/base/parameter_handler.h @@ -1931,7 +1931,8 @@ private: /** * Constructor */ - Entry() : type(array) + Entry() + : type(array) {} /** diff --git a/include/deal.II/base/partitioner.templates.h b/include/deal.II/base/partitioner.templates.h index d4fdcb9134..2b5c8bfb16 100644 --- a/include/deal.II/base/partitioner.templates.h +++ b/include/deal.II/base/partitioner.templates.h @@ -354,23 +354,25 @@ namespace Utilities # ifndef DEBUG if (vector_operation == VectorOperation::insert) { - Assert( - requests.empty(), - ExcInternalError("Did not expect a non-empty communication " - "request when inserting. Check that the same " - "vector_operation argument was passed to " - "import_from_ghosted_array_start as is passed " - "to import_from_ghosted_array_finish.")); + Assert(requests.empty(), + ExcInternalError( + "Did not expect a non-empty communication " + "request when inserting. Check that the same " + "vector_operation argument was passed to " + "import_from_ghosted_array_start as is passed " + "to import_from_ghosted_array_finish.")); # ifdef DEAL_II_WITH_CXX17 if constexpr (std::is_trivial::value) # else if (std::is_trivial::value) # endif - std::memset( - ghost_array.data(), 0, sizeof(Number) * ghost_array.size()); + std::memset(ghost_array.data(), + 0, + sizeof(Number) * ghost_array.size()); else - std::fill( - ghost_array.data(), ghost_array.data() + ghost_array.size(), 0); + std::fill(ghost_array.data(), + ghost_array.data() + ghost_array.size(), + 0); return; } # endif @@ -435,8 +437,9 @@ namespace Utilities // wait for the send operations to complete if (requests.size() > 0 && n_ghost_targets > 0) { - const int ierr = MPI_Waitall( - n_ghost_targets, &requests[n_import_targets], MPI_STATUSES_IGNORE); + const int ierr = MPI_Waitall(n_ghost_targets, + &requests[n_import_targets], + MPI_STATUSES_IGNORE); AssertThrowMPI(ierr); } else @@ -452,11 +455,13 @@ namespace Utilities # else if (std::is_trivial::value) # endif - std::memset( - ghost_array.data(), 0, sizeof(Number) * n_ghost_indices()); + std::memset(ghost_array.data(), + 0, + sizeof(Number) * n_ghost_indices()); else - std::fill( - ghost_array.data(), ghost_array.data() + n_ghost_indices(), 0); + std::fill(ghost_array.data(), + ghost_array.data() + n_ghost_indices(), + 0); } // clear the compress requests diff --git a/include/deal.II/base/patterns.h b/include/deal.II/base/patterns.h index 5545ae1ecd..4346f16eff 100644 --- a/include/deal.II/base/patterns.h +++ b/include/deal.II/base/patterns.h @@ -1410,16 +1410,16 @@ namespace Patterns namespace Patterns { template - Tuple::Tuple(const char *separator, const PatternTypes &... ps) : - // forward to the version with std::string argument + Tuple::Tuple(const char *separator, const PatternTypes &... ps) + : // forward to the version with std::string argument Tuple(std::string(separator), ps...) {} template - Tuple::Tuple(const std::string &separator, const PatternTypes &... ps) : - separator(separator) + Tuple::Tuple(const std::string &separator, const PatternTypes &... ps) + : separator(separator) { static_assert(is_base_of_all::value, "Not all of the input arguments of this function " @@ -1434,8 +1434,8 @@ namespace Patterns template - Tuple::Tuple(const PatternTypes &... ps) : - // forward to the version with the separator argument + Tuple::Tuple(const PatternTypes &... ps) + : // forward to the version with the separator argument Tuple(std::string(":"), ps...) {} diff --git a/include/deal.II/base/point.h b/include/deal.II/base/point.h index a4d6f15cdc..b17db05fee 100644 --- a/include/deal.II/base/point.h +++ b/include/deal.II/base/point.h @@ -287,8 +287,8 @@ inline Point::Point() template -inline Point::Point(const Tensor<1, dim, Number> &t) : - Tensor<1, dim, Number>(t) +inline Point::Point(const Tensor<1, dim, Number> &t) + : Tensor<1, dim, Number>(t) {} @@ -296,12 +296,12 @@ inline Point::Point(const Tensor<1, dim, Number> &t) : template inline Point::Point(const Number x) { - Assert( - dim == 1, - ExcMessage("You can only initialize Point<1> objects using the constructor " - "that takes only one argument. Point objects with dim!=1 " - "require initialization with the constructor that takes 'dim' " - "arguments.")); + Assert(dim == 1, + ExcMessage( + "You can only initialize Point<1> objects using the constructor " + "that takes only one argument. Point objects with dim!=1 " + "require initialization with the constructor that takes 'dim' " + "arguments.")); // we can only get here if we pass the assertion. use the switch anyway so // as to avoid compiler warnings about uninitialized elements or writing @@ -321,12 +321,12 @@ inline Point::Point(const Number x) template inline Point::Point(const Number x, const Number y) { - Assert( - dim == 2, - ExcMessage("You can only initialize Point<2> objects using the constructor " - "that takes two arguments. Point objects with dim!=2 " - "require initialization with the constructor that takes 'dim' " - "arguments.")); + Assert(dim == 2, + ExcMessage( + "You can only initialize Point<2> objects using the constructor " + "that takes two arguments. Point objects with dim!=2 " + "require initialization with the constructor that takes 'dim' " + "arguments.")); // we can only get here if we pass the assertion. use the indirection anyway // so as to avoid compiler warnings about uninitialized elements or writing // beyond the end of the 'values' array @@ -340,12 +340,12 @@ inline Point::Point(const Number x, const Number y) template inline Point::Point(const Number x, const Number y, const Number z) { - Assert( - dim == 3, - ExcMessage("You can only initialize Point<3> objects using the constructor " - "that takes three arguments. Point objects with dim!=3 " - "require initialization with the constructor that takes 'dim' " - "arguments.")); + Assert(dim == 3, + ExcMessage( + "You can only initialize Point<3> objects using the constructor " + "that takes three arguments. Point objects with dim!=3 " + "require initialization with the constructor that takes 'dim' " + "arguments.")); // we can only get here if we pass the assertion. use the indirection anyway // so as to avoid compiler warnings about uninitialized elements or writing diff --git a/include/deal.II/base/polynomial.h b/include/deal.II/base/polynomial.h index f00ebae410..d81c85fdd8 100644 --- a/include/deal.II/base/polynomial.h +++ b/include/deal.II/base/polynomial.h @@ -764,9 +764,9 @@ namespace Polynomials namespace Polynomials { template - inline Polynomial::Polynomial() : - in_lagrange_product_form(false), - lagrange_weight(1.) + inline Polynomial::Polynomial() + : in_lagrange_product_form(false) + , lagrange_weight(1.) {} diff --git a/include/deal.II/base/polynomial_space.h b/include/deal.II/base/polynomial_space.h index 61177a1fc8..3362d7db25 100644 --- a/include/deal.II/base/polynomial_space.h +++ b/include/deal.II/base/polynomial_space.h @@ -269,11 +269,11 @@ PolynomialSpace<3>::compute_index(const unsigned int n) const; template template -PolynomialSpace::PolynomialSpace(const std::vector &pols) : - polynomials(pols.begin(), pols.end()), - n_pols(compute_n_pols(polynomials.size())), - index_map(n_pols), - index_map_inverse(n_pols) +PolynomialSpace::PolynomialSpace(const std::vector &pols) + : polynomials(pols.begin(), pols.end()) + , n_pols(compute_n_pols(polynomials.size())) + , index_map(n_pols) + , index_map_inverse(n_pols) { // per default set this index map // to identity. This map can be diff --git a/include/deal.II/base/qprojector.h b/include/deal.II/base/qprojector.h index 30f98eec62..a13ba572cc 100644 --- a/include/deal.II/base/qprojector.h +++ b/include/deal.II/base/qprojector.h @@ -327,14 +327,14 @@ private: template inline QProjector::DataSetDescriptor::DataSetDescriptor( - const unsigned int dataset_offset) : - dataset_offset(dataset_offset) + const unsigned int dataset_offset) + : dataset_offset(dataset_offset) {} template -inline QProjector::DataSetDescriptor::DataSetDescriptor() : - dataset_offset(numbers::invalid_unsigned_int) +inline QProjector::DataSetDescriptor::DataSetDescriptor() + : dataset_offset(numbers::invalid_unsigned_int) {} diff --git a/include/deal.II/base/quadrature_point_data.h b/include/deal.II/base/quadrature_point_data.h index ddf191f0e7..23c8af64a0 100644 --- a/include/deal.II/base/quadrature_point_data.h +++ b/include/deal.II/base/quadrature_point_data.h @@ -719,16 +719,16 @@ namespace parallel ContinuousQuadratureDataTransfer:: ContinuousQuadratureDataTransfer(const FiniteElement &projection_fe_, const Quadrature & lhs_quadrature, - const Quadrature &rhs_quadrature) : - projection_fe( - std::unique_ptr>(projection_fe_.clone())), - data_size_in_bytes(0), - n_q_points(rhs_quadrature.size()), - project_to_fe_matrix(projection_fe->dofs_per_cell, n_q_points), - project_to_qp_matrix(n_q_points, projection_fe->dofs_per_cell), - handle(numbers::invalid_unsigned_int), - data_storage(nullptr), - triangulation(nullptr) + const Quadrature & rhs_quadrature) + : projection_fe( + std::unique_ptr>(projection_fe_.clone())) + , data_size_in_bytes(0) + , n_q_points(rhs_quadrature.size()) + , project_to_fe_matrix(projection_fe->dofs_per_cell, n_q_points) + , project_to_qp_matrix(n_q_points, projection_fe->dofs_per_cell) + , handle(numbers::invalid_unsigned_int) + , data_storage(nullptr) + , triangulation(nullptr) { Assert( projection_fe->n_components() == 1, @@ -882,8 +882,9 @@ namespace parallel matrix_dofs_child); // finally, put back into the map: - unpack_to_cell_data( - cell->child(child), matrix_quadrature, data_storage); + unpack_to_cell_data(cell->child(child), + matrix_quadrature, + data_storage); } } else diff --git a/include/deal.II/base/smartpointer.h b/include/deal.II/base/smartpointer.h index 828e8213fb..52f245ad64 100644 --- a/include/deal.II/base/smartpointer.h +++ b/include/deal.II/base/smartpointer.h @@ -205,13 +205,17 @@ private: template -inline SmartPointer::SmartPointer() : t(nullptr), id(typeid(P).name()) +inline SmartPointer::SmartPointer() + : t(nullptr) + , id(typeid(P).name()) {} template -inline SmartPointer::SmartPointer(T *t) : t(t), id(typeid(P).name()) +inline SmartPointer::SmartPointer(T *t) + : t(t) + , id(typeid(P).name()) { if (t != nullptr) t->subscribe(id); @@ -220,7 +224,9 @@ inline SmartPointer::SmartPointer(T *t) : t(t), id(typeid(P).name()) template -inline SmartPointer::SmartPointer(T *t, const char *id) : t(t), id(id) +inline SmartPointer::SmartPointer(T *t, const char *id) + : t(t) + , id(id) { if (t != nullptr) t->subscribe(id); @@ -230,9 +236,9 @@ inline SmartPointer::SmartPointer(T *t, const char *id) : t(t), id(id) template template -inline SmartPointer::SmartPointer(const SmartPointer &tt) : - t(tt.t), - id(tt.id) +inline SmartPointer::SmartPointer(const SmartPointer &tt) + : t(tt.t) + , id(tt.id) { if (t != nullptr) t->subscribe(id); @@ -241,9 +247,9 @@ inline SmartPointer::SmartPointer(const SmartPointer &tt) : template -inline SmartPointer::SmartPointer(const SmartPointer &tt) : - t(tt.t), - id(tt.id) +inline SmartPointer::SmartPointer(const SmartPointer &tt) + : t(tt.t) + , id(tt.id) { if (t != nullptr) t->subscribe(id); diff --git a/include/deal.II/base/symmetric_tensor.h b/include/deal.II/base/symmetric_tensor.h index f67a92ddf6..2e00bc982d 100644 --- a/include/deal.II/base/symmetric_tensor.h +++ b/include/deal.II/base/symmetric_tensor.h @@ -961,9 +961,9 @@ namespace internal template Accessor::Accessor( tensor_type & tensor, - const TableIndices &previous_indices) : - tensor(tensor), - previous_indices(previous_indices) + const TableIndices &previous_indices) + : tensor(tensor) + , previous_indices(previous_indices) {} @@ -993,9 +993,9 @@ namespace internal template Accessor::Accessor( tensor_type & tensor, - const TableIndices &previous_indices) : - tensor(tensor), - previous_indices(previous_indices) + const TableIndices &previous_indices) + : tensor(tensor) + , previous_indices(previous_indices) {} @@ -1091,8 +1091,9 @@ inline SymmetricTensor::SymmetricTensor( template inline SymmetricTensor::SymmetricTensor( - const Number (&array)[n_independent_components]) : - data(*reinterpret_cast(array)) + const Number (&array)[n_independent_components]) + : data( + *reinterpret_cast(array)) { // ensure that the reinterpret_cast above actually works Assert(sizeof(typename base_tensor_type::array_type) == sizeof(array), @@ -1732,8 +1733,9 @@ inline typename internal::SymmetricTensorAccessors:: { typename internal::SymmetricTensorAccessors:: double_contraction_result::type tmp; - tmp.data = internal::perform_double_contraction( - data, s.data); + tmp.data = + internal::perform_double_contraction(data, + s.data); return tmp; } @@ -2365,15 +2367,18 @@ namespace internal case 3: { - static const unsigned int table[3][3] = { - {0, 3, 4}, {3, 1, 5}, {4, 5, 2}}; + static const unsigned int table[3][3] = {{0, 3, 4}, + {3, 1, 5}, + {4, 5, 2}}; return table[indices[0]][indices[1]]; } case 4: { - static const unsigned int table[4][4] = { - {0, 4, 5, 6}, {4, 1, 7, 8}, {5, 7, 2, 9}, {6, 8, 9, 3}}; + static const unsigned int table[4][4] = {{0, 4, 5, 6}, + {4, 1, 7, 8}, + {5, 7, 2, 9}, + {6, 8, 9, 3}}; return table[indices[0]][indices[1]]; } diff --git a/include/deal.II/base/synchronous_iterator.h b/include/deal.II/base/synchronous_iterator.h index 959c7d2c57..bc44255a87 100644 --- a/include/deal.II/base/synchronous_iterator.h +++ b/include/deal.II/base/synchronous_iterator.h @@ -78,9 +78,8 @@ private: template -inline SynchronousIterators::SynchronousIterators( - const Iterators &i) : - iterators(i) +inline SynchronousIterators::SynchronousIterators(const Iterators &i) + : iterators(i) {} diff --git a/include/deal.II/base/table.h b/include/deal.II/base/table.h index 1bf475a809..b614862d24 100644 --- a/include/deal.II/base/table.h +++ b/include/deal.II/base/table.h @@ -1943,7 +1943,8 @@ TableBase::TableBase(const TableIndices &sizes, template -TableBase::TableBase(const TableBase &src) : Subscriptor() +TableBase::TableBase(const TableBase &src) + : Subscriptor() { reinit(src.table_size, true); values = src.values; @@ -1963,10 +1964,10 @@ TableBase::TableBase(const TableBase &src) template -TableBase::TableBase(TableBase &&src) noexcept : - Subscriptor(std::move(src)), - values(std::move(src.values)), - table_size(src.table_size) +TableBase::TableBase(TableBase &&src) noexcept + : Subscriptor(std::move(src)) + , values(std::move(src.values)) + , table_size(src.table_size) { src.table_size = TableIndices(); } @@ -1991,17 +1992,17 @@ namespace internal { template inline Accessor::Accessor(const TableType &table, - const iterator data) : - table(table), - data(data) + const iterator data) + : table(table) + , data(data) {} template - inline Accessor::Accessor(const Accessor &a) : - table(a.table), - data(a.data) + inline Accessor::Accessor(const Accessor &a) + : table(a.table) + , data(a.data) {} @@ -2034,17 +2035,17 @@ namespace internal template inline Accessor::Accessor(const TableType &table, - const iterator data) : - table(table), - data(data) + const iterator data) + : table(table) + , data(data) {} template - inline Accessor::Accessor(const Accessor &a) : - table(a.table), - data(a.data) + inline Accessor::Accessor(const Accessor &a) + : table(a.table) + , data(a.data) {} @@ -2108,8 +2109,9 @@ TableBase::operator=(const TableBase &m) { reinit(m.size(), true); if (!empty()) - std::copy( - m.values.begin(), m.values.begin() + n_elements(), values.begin()); + std::copy(m.values.begin(), + m.values.begin() + n_elements(), + values.begin()); return *this; } @@ -2401,8 +2403,8 @@ TableBase::el(const TableIndices &indices) template -inline Table<1, T>::Table(const size_type size) : - TableBase<1, T>(TableIndices<1>(size)) +inline Table<1, T>::Table(const size_type size) + : TableBase<1, T>(TableIndices<1>(size)) {} @@ -2411,8 +2413,8 @@ template template inline Table<1, T>::Table(const size_type size, InputIterator entries, - const bool C_style_indexing) : - TableBase<1, T>(TableIndices<1>(size), entries, C_style_indexing) + const bool C_style_indexing) + : TableBase<1, T>(TableIndices<1>(size), entries, C_style_indexing) {} @@ -2479,8 +2481,8 @@ Table<1, T>::operator()(const TableIndices<1> &indices) template -inline Table<2, T>::Table(const size_type size1, const size_type size2) : - TableBase<2, T>(TableIndices<2>(size1, size2)) +inline Table<2, T>::Table(const size_type size1, const size_type size2) + : TableBase<2, T>(TableIndices<2>(size1, size2)) {} @@ -2490,8 +2492,8 @@ template inline Table<2, T>::Table(const size_type size1, const size_type size2, InputIterator entries, - const bool C_style_indexing) : - TableBase<2, T>(TableIndices<2>(size1, size2), entries, C_style_indexing) + const bool C_style_indexing) + : TableBase<2, T>(TableIndices<2>(size1, size2), entries, C_style_indexing) {} @@ -2610,27 +2612,27 @@ Table<2, T>::n_cols() const namespace TransposeTableIterators { template - inline AccessorBase::AccessorBase() : - container(nullptr), - linear_index(std::numeric_limits::max()) + inline AccessorBase::AccessorBase() + : container(nullptr) + , linear_index(std::numeric_limits::max()) {} template inline AccessorBase::AccessorBase( - const container_pointer_type table) : - container(table), - linear_index(container->values.size()) + const container_pointer_type table) + : container(table) + , linear_index(container->values.size()) {} template inline AccessorBase::AccessorBase( - const AccessorBase &a) : - container(a.container), - linear_index(a.linear_index) + const AccessorBase &a) + : container(a.container) + , linear_index(a.linear_index) {} @@ -2638,9 +2640,9 @@ namespace TransposeTableIterators template inline AccessorBase::AccessorBase( const container_pointer_type table, - const std::ptrdiff_t index) : - container(table), - linear_index(index) + const std::ptrdiff_t index) + : container(table) + , linear_index(index) { Assert(0 <= linear_index && linear_index < container->values.size() + 1, ExcMessage("The current iterator points outside of the table and is " @@ -2726,23 +2728,23 @@ namespace TransposeTableIterators template - Iterator::Iterator(const Accessor &a) : - LinearIndexIterator, Accessor>(a) + Iterator::Iterator(const Accessor &a) + : LinearIndexIterator, Accessor>(a) {} template - Iterator::Iterator(const container_pointer_type table) : - LinearIndexIterator, Accessor>( - Accessor(table)) + Iterator::Iterator(const container_pointer_type table) + : LinearIndexIterator, Accessor>( + Accessor(table)) {} template - Iterator::Iterator(const Iterator &i) : - LinearIndexIterator, Accessor>(*i) + Iterator::Iterator(const Iterator &i) + : LinearIndexIterator, Accessor>(*i) {} @@ -2750,17 +2752,17 @@ namespace TransposeTableIterators template Iterator::Iterator(const container_pointer_type table, const size_type row_n, - const size_type col_n) : - Iterator(table, table->n_rows() * col_n + row_n) + const size_type col_n) + : Iterator(table, table->n_rows() * col_n + row_n) {} template Iterator::Iterator(const container_pointer_type table, - const std::ptrdiff_t linear_index) : - LinearIndexIterator, Accessor>( - Accessor(table, linear_index)) + const std::ptrdiff_t linear_index) + : LinearIndexIterator, Accessor>( + Accessor(table, linear_index)) {} } // namespace TransposeTableIterators @@ -2769,8 +2771,8 @@ namespace TransposeTableIterators //--------------------------------------------------------------------------- template inline TransposeTable::TransposeTable(const size_type size1, - const size_type size2) : - TableBase<2, T>(TableIndices<2>(size2, size1)) + const size_type size2) + : TableBase<2, T>(TableIndices<2>(size2, size1)) {} @@ -2885,8 +2887,8 @@ TransposeTable::end() const template inline Table<3, T>::Table(const size_type size1, const size_type size2, - const size_type size3) : - TableBase<3, T>(TableIndices<3>(size1, size2, size3)) + const size_type size3) + : TableBase<3, T>(TableIndices<3>(size1, size2, size3)) {} @@ -2897,10 +2899,10 @@ inline Table<3, T>::Table(const size_type size1, const size_type size2, const size_type size3, InputIterator entries, - const bool C_style_indexing) : - TableBase<3, T>(TableIndices<3>(size1, size2, size3), - entries, - C_style_indexing) + const bool C_style_indexing) + : TableBase<3, T>(TableIndices<3>(size1, size2, size3), + entries, + C_style_indexing) {} @@ -2982,8 +2984,8 @@ template inline Table<4, T>::Table(const size_type size1, const size_type size2, const size_type size3, - const size_type size4) : - TableBase<4, T>(TableIndices<4>(size1, size2, size3, size4)) + const size_type size4) + : TableBase<4, T>(TableIndices<4>(size1, size2, size3, size4)) {} @@ -3077,8 +3079,8 @@ inline Table<5, T>::Table(const size_type size1, const size_type size2, const size_type size3, const size_type size4, - const size_type size5) : - TableBase<5, T>(TableIndices<5>(size1, size2, size3, size4, size5)) + const size_type size5) + : TableBase<5, T>(TableIndices<5>(size1, size2, size3, size4, size5)) {} @@ -3183,8 +3185,8 @@ inline Table<6, T>::Table(const size_type size1, const size_type size3, const size_type size4, const size_type size5, - const size_type size6) : - TableBase<6, T>() + const size_type size6) + : TableBase<6, T>() { TableIndices<6> table_indices; table_indices[0] = size1; @@ -3308,8 +3310,8 @@ inline Table<7, T>::Table(const size_type size1, const size_type size4, const size_type size5, const size_type size6, - const size_type size7) : - TableBase<7, T>() + const size_type size7) + : TableBase<7, T>() { TableIndices<7> table_indices; table_indices[0] = size1; diff --git a/include/deal.II/base/table_handler.h b/include/deal.II/base/table_handler.h index dc6d086c10..7a9170c180 100644 --- a/include/deal.II/base/table_handler.h +++ b/include/deal.II/base/table_handler.h @@ -763,7 +763,8 @@ protected: namespace internal { template - TableEntry::TableEntry(const T &t) : value(t) + TableEntry::TableEntry(const T &t) + : value(t) {} @@ -908,17 +909,19 @@ TableHandler::add_value(const std::string &key, const T value) for (std::map::iterator p = columns.begin(); p != columns.end(); ++p) - max_col_length = std::max( - max_col_length, static_cast(p->second.entries.size())); + max_col_length = + std::max(max_col_length, + static_cast(p->second.entries.size())); while (columns[key].entries.size() + 1 < max_col_length) { columns[key].entries.push_back(internal::TableEntry(T())); internal::TableEntry &entry = columns[key].entries.back(); entry.cache_string(columns[key].scientific, columns[key].precision); - columns[key].max_length = std::max( - columns[key].max_length, - static_cast(entry.get_cached_string().length())); + columns[key].max_length = + std::max(columns[key].max_length, + static_cast( + entry.get_cached_string().length())); } } diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index ed8512edac..cd9eb8a02f 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -765,8 +765,7 @@ inline DEAL_II_CUDA_HOST_DEV Tensor<0, dim, Number>::Tensor() // Some auto-differentiable numbers need explicit // zero initialization. - : - value(internal::NumberType::value(0.0)) + : value(internal::NumberType::value(0.0)) {} @@ -1772,12 +1771,12 @@ inline DEAL_II_ALWAYS_INLINE contract(const Tensor & src1, const Tensor &src2) { - Assert( - 0 <= index_1 && index_1 < rank_1, - ExcMessage("The specified index_1 must lie within the range [0,rank_1)")); - Assert( - 0 <= index_2 && index_2 < rank_2, - ExcMessage("The specified index_2 must lie within the range [0,rank_2)")); + Assert(0 <= index_1 && index_1 < rank_1, + ExcMessage( + "The specified index_1 must lie within the range [0,rank_1)")); + Assert(0 <= index_2 && index_2 < rank_2, + ExcMessage( + "The specified index_2 must lie within the range [0,rank_2)")); using namespace TensorAccessors; using namespace TensorAccessors::internal; @@ -1846,20 +1845,20 @@ inline double_contract(const Tensor & src1, const Tensor &src2) { - Assert( - 0 <= index_1 && index_1 < rank_1, - ExcMessage("The specified index_1 must lie within the range [0,rank_1)")); - Assert( - 0 <= index_3 && index_3 < rank_1, - ExcMessage("The specified index_3 must lie within the range [0,rank_1)")); + Assert(0 <= index_1 && index_1 < rank_1, + ExcMessage( + "The specified index_1 must lie within the range [0,rank_1)")); + Assert(0 <= index_3 && index_3 < rank_1, + ExcMessage( + "The specified index_3 must lie within the range [0,rank_1)")); Assert(index_1 != index_3, ExcMessage("index_1 and index_3 must not be the same")); - Assert( - 0 <= index_2 && index_2 < rank_2, - ExcMessage("The specified index_2 must lie within the range [0,rank_2)")); - Assert( - 0 <= index_4 && index_4 < rank_2, - ExcMessage("The specified index_4 must lie within the range [0,rank_2)")); + Assert(0 <= index_2 && index_2 < rank_2, + ExcMessage( + "The specified index_2 must lie within the range [0,rank_2)")); + Assert(0 <= index_4 && index_4 < rank_2, + ExcMessage( + "The specified index_4 must lie within the range [0,rank_2)")); Assert(index_2 != index_4, ExcMessage("index_2 and index_4 must not be the same")); @@ -1965,8 +1964,9 @@ contract3(const TensorT1 & left, { typedef typename ProductType::type>::type return_type; - return TensorAccessors::contract3( - left, middle, right); + return TensorAccessors::contract3(left, + middle, + right); } diff --git a/include/deal.II/base/tensor_accessors.h b/include/deal.II/base/tensor_accessors.h index 985ca72ce4..e07cc04c83 100644 --- a/include/deal.II/base/tensor_accessors.h +++ b/include/deal.II/base/tensor_accessors.h @@ -409,7 +409,8 @@ namespace TensorAccessors class ReorderedIndexView { public: - ReorderedIndexView(typename ReferenceType::type t) : t_(t) + ReorderedIndexView(typename ReferenceType::type t) + : t_(t) {} typedef ReorderedIndexView { public: - ReorderedIndexView(typename ReferenceType::type t) : t_(t) + ReorderedIndexView(typename ReferenceType::type t) + : t_(t) {} typedef StoreIndex> value_type; @@ -463,7 +465,8 @@ namespace TensorAccessors class ReorderedIndexView<0, 1, T> { public: - ReorderedIndexView(typename ReferenceType::type t) : t_(t) + ReorderedIndexView(typename ReferenceType::type t) + : t_(t) {} typedef typename ReferenceType::value_type>::type @@ -487,7 +490,8 @@ namespace TensorAccessors class Identity { public: - Identity(typename ReferenceType::type t) : t_(t) + Identity(typename ReferenceType::type t) + : t_(t) {} typedef typename ValueType::value_type return_type; @@ -514,7 +518,9 @@ namespace TensorAccessors class StoreIndex { public: - StoreIndex(S s, int i) : s_(s), i_(i) + StoreIndex(S s, int i) + : s_(s) + , i_(i) {} typedef StoreIndex> value_type; @@ -546,7 +552,9 @@ namespace TensorAccessors class StoreIndex<1, S> { public: - StoreIndex(S s, int i) : s_(s), i_(i) + StoreIndex(S s, int i) + : s_(s) + , i_(i) {} typedef @@ -578,9 +586,9 @@ namespace TensorAccessors inline static typename ReturnType::value_type & extract(T &t, const ArrayType &indices) { - return ExtractHelper:: - template extract::value_type, ArrayType>( - t[indices[position]], indices); + return ExtractHelper::template extract< + typename ValueType::value_type, + ArrayType>(t[indices[position]], indices); } }; @@ -622,8 +630,9 @@ namespace TensorAccessors contract(T1 &result, const T2 &left, const T3 &right) { for (unsigned int i = 0; i < dim; ++i) - Contract::contract( - result[i], left[i], right); + Contract::contract(result[i], + left[i], + right); } }; @@ -651,8 +660,9 @@ namespace TensorAccessors contract(T1 &result, const T2 &left, const T3 &right) { for (unsigned int i = 0; i < dim; ++i) - Contract::contract( - result[i], left, right[i]); + Contract::contract(result[i], + left, + right[i]); } }; @@ -699,8 +709,9 @@ namespace TensorAccessors // zero initialization. T1 result = dealii::internal::NumberType::value(0.0); for (unsigned int i = 0; i < dim; ++i) - result += Contract2::template contract2( - left[i], right[i]); + result += + Contract2::template contract2(left[i], + right[i]); return result; } }; @@ -777,8 +788,10 @@ namespace TensorAccessors // zero initialization. T1 result = dealii::internal::NumberType::value(0.0); for (unsigned int i = 0; i < dim; ++i) - result += Contract3<0, rank_2 - 1, dim>::template contract3( - left, middle[i], right[i]); + result += + Contract3<0, rank_2 - 1, dim>::template contract3(left, + middle[i], + right[i]); return result; } }; diff --git a/include/deal.II/base/tensor_function.templates.h b/include/deal.II/base/tensor_function.templates.h index b589313f22..5e5b0c1992 100644 --- a/include/deal.II/base/tensor_function.templates.h +++ b/include/deal.II/base/tensor_function.templates.h @@ -28,8 +28,8 @@ DEAL_II_NAMESPACE_OPEN template -TensorFunction::TensorFunction(const Number initial_time) : - FunctionTime(initial_time) +TensorFunction::TensorFunction(const Number initial_time) + : FunctionTime(initial_time) {} @@ -84,9 +84,9 @@ TensorFunction::gradient_list( template ConstantTensorFunction::ConstantTensorFunction( const Tensor &value, - const Number initial_time) : - TensorFunction(initial_time), - _value(value) + const Number initial_time) + : TensorFunction(initial_time) + , _value(value) {} @@ -147,9 +147,10 @@ ConstantTensorFunction::gradient_list( template ZeroTensorFunction::ZeroTensorFunction( - const Number initial_time) : - ConstantTensorFunction(dealii::Tensor(), - initial_time) + const Number initial_time) + : ConstantTensorFunction( + dealii::Tensor(), + initial_time) {} diff --git a/include/deal.II/base/tensor_product_polynomials.h b/include/deal.II/base/tensor_product_polynomials.h index 97fc7637dd..3a956a8b5e 100644 --- a/include/deal.II/base/tensor_product_polynomials.h +++ b/include/deal.II/base/tensor_product_polynomials.h @@ -409,11 +409,11 @@ private: template template inline TensorProductPolynomials::TensorProductPolynomials( - const std::vector &pols) : - polynomials(pols.begin(), pols.end()), - n_tensor_pols(Utilities::fixed_power(pols.size())), - index_map(n_tensor_pols), - index_map_inverse(n_tensor_pols) + const std::vector &pols) + : polynomials(pols.begin(), pols.end()) + , n_tensor_pols(Utilities::fixed_power(pols.size())) + , index_map(n_tensor_pols) + , index_map_inverse(n_tensor_pols) { // per default set this index map to identity. This map can be changed by // the user through the set_numbering() function diff --git a/include/deal.II/base/tensor_product_polynomials_bubbles.h b/include/deal.II/base/tensor_product_polynomials_bubbles.h index 367cc79152..bbcd3048bc 100644 --- a/include/deal.II/base/tensor_product_polynomials_bubbles.h +++ b/include/deal.II/base/tensor_product_polynomials_bubbles.h @@ -157,8 +157,8 @@ public: template template inline TensorProductPolynomialsBubbles::TensorProductPolynomialsBubbles( - const std::vector &pols) : - TensorProductPolynomials(pols) + const std::vector &pols) + : TensorProductPolynomials(pols) { const unsigned int q_degree = this->polynomials.size() - 1; const unsigned int n_bubbles = ((q_degree <= 1) ? 1 : dim); diff --git a/include/deal.II/base/tensor_product_polynomials_const.h b/include/deal.II/base/tensor_product_polynomials_const.h index d7b5f4ba2b..4dae705398 100644 --- a/include/deal.II/base/tensor_product_polynomials_const.h +++ b/include/deal.II/base/tensor_product_polynomials_const.h @@ -163,8 +163,8 @@ public: template template inline TensorProductPolynomialsConst::TensorProductPolynomialsConst( - const std::vector &pols) : - TensorProductPolynomials(pols) + const std::vector &pols) + : TensorProductPolynomials(pols) { // append index for renumbering this->index_map.push_back(this->n_tensor_pols); diff --git a/include/deal.II/base/thread_local_storage.h b/include/deal.II/base/thread_local_storage.h index e6e142ef58..12c9fd0827 100644 --- a/include/deal.II/base/thread_local_storage.h +++ b/include/deal.II/base/thread_local_storage.h @@ -184,14 +184,15 @@ namespace Threads // ----------------- inline and template functions -------------------------- template - inline ThreadLocalStorage::ThreadLocalStorage(const T &t) : data(t) + inline ThreadLocalStorage::ThreadLocalStorage(const T &t) + : data(t) {} template inline ThreadLocalStorage::ThreadLocalStorage( - const ThreadLocalStorage &t) : - data(t) + const ThreadLocalStorage &t) + : data(t) {} diff --git a/include/deal.II/base/thread_management.h b/include/deal.II/base/thread_management.h index e2e9604f3c..ca70dc82f0 100644 --- a/include/deal.II/base/thread_management.h +++ b/include/deal.II/base/thread_management.h @@ -286,7 +286,8 @@ namespace Threads /** * Constructor. Lock the mutex. */ - ScopedLock(Mutex &m) : mutex(m) + ScopedLock(Mutex &m) + : mutex(m) { mutex.acquire(); } @@ -316,7 +317,8 @@ namespace Threads * Copy constructor. As discussed in this class's documentation, no state * is copied from the object given as argument. */ - Mutex(const Mutex &) : mutex() + Mutex(const Mutex &) + : mutex() {} @@ -724,7 +726,8 @@ namespace Threads public: typedef RT &reference_type; - inline return_value() : value() + inline return_value() + : value() {} inline reference_type @@ -759,7 +762,8 @@ namespace Threads public: typedef RT &reference_type; - inline return_value() : value(nullptr) + inline return_value() + : value(nullptr) {} inline reference_type @@ -890,7 +894,8 @@ namespace Threads /** * Default constructor. */ - ThreadDescriptor() : thread_is_active(false) + ThreadDescriptor() + : thread_is_active(false) {} ~ThreadDescriptor() @@ -1035,8 +1040,8 @@ namespace Threads /** * Construct a thread object with a function object. */ - Thread(const std::function &function) : - thread_descriptor(new internal::ThreadDescriptor()) + Thread(const std::function &function) + : thread_descriptor(new internal::ThreadDescriptor()) { // in a second step, start the thread. thread_descriptor->start(function); @@ -1052,7 +1057,8 @@ namespace Threads /** * Copy constructor. */ - Thread(const Thread &t) : thread_descriptor(t.thread_descriptor) + Thread(const Thread &t) + : thread_descriptor(t.thread_descriptor) {} /** @@ -1392,8 +1398,8 @@ namespace Threads template struct TaskEntryPoint : public tbb::task { - TaskEntryPoint(TaskDescriptor &task_descriptor) : - task_descriptor(task_descriptor) + TaskEntryPoint(TaskDescriptor &task_descriptor) + : task_descriptor(task_descriptor) {} virtual tbb::task * @@ -1530,10 +1536,10 @@ namespace Threads template inline TaskDescriptor::TaskDescriptor( - const std::function &function) : - function(function), - task(nullptr), - task_is_done(false) + const std::function &function) + : function(function) + , task(nullptr) + , task_is_done(false) {} @@ -1564,7 +1570,8 @@ namespace Threads template - TaskDescriptor::TaskDescriptor() : task_is_done(false) + TaskDescriptor::TaskDescriptor() + : task_is_done(false) { Assert(false, ExcInternalError()); } @@ -1572,8 +1579,8 @@ namespace Threads template - TaskDescriptor::TaskDescriptor(const TaskDescriptor &) : - task_is_done(false) + TaskDescriptor::TaskDescriptor(const TaskDescriptor &) + : task_is_done(false) { // we shouldn't be getting here -- task descriptors // can't be copied @@ -1721,7 +1728,8 @@ namespace Threads * @post Using this constructor automatically makes the task object * joinable(). */ - Task(const Task &t) : task_descriptor(t.task_descriptor) + Task(const Task &t) + : task_descriptor(t.task_descriptor) {} diff --git a/include/deal.II/base/time_stepping.h b/include/deal.II/base/time_stepping.h index 382d3b40b6..ed0226dda8 100644 --- a/include/deal.II/base/time_stepping.h +++ b/include/deal.II/base/time_stepping.h @@ -291,7 +291,8 @@ namespace TimeStepping */ struct Status : public TimeStepping::Status { - Status() : method(invalid) + Status() + : method(invalid) {} runge_kutta_method method; @@ -390,10 +391,10 @@ namespace TimeStepping */ struct Status : public TimeStepping::Status { - Status() : - method(invalid), - n_iterations(numbers::invalid_unsigned_int), - norm_residual(numbers::signaling_nan()) + Status() + : method(invalid) + , n_iterations(numbers::invalid_unsigned_int) + , norm_residual(numbers::signaling_nan()) {} runge_kutta_method method; diff --git a/include/deal.II/base/time_stepping.templates.h b/include/deal.II/base/time_stepping.templates.h index 08a114828c..b1f31024c3 100644 --- a/include/deal.II/base/time_stepping.templates.h +++ b/include/deal.II/base/time_stepping.templates.h @@ -224,11 +224,11 @@ namespace TimeStepping ImplicitRungeKutta::ImplicitRungeKutta( const runge_kutta_method method, const unsigned int max_it, - const double tolerance) : - RungeKutta(), - skip_linear_combi(false), - max_it(max_it), - tolerance(tolerance) + const double tolerance) + : RungeKutta() + , skip_linear_combi(false) + , max_it(max_it) + , tolerance(tolerance) { // virtual functions called in constructors and destructors never use the // override in a derived class @@ -452,16 +452,16 @@ namespace TimeStepping const double min_delta, const double max_delta, const double refine_tol, - const double coarsen_tol) : - coarsen_param(coarsen_param), - refine_param(refine_param), - min_delta_t(min_delta), - max_delta_t(max_delta), - refine_tol(refine_tol), - coarsen_tol(coarsen_tol), - last_same_as_first(false), - last_stage(nullptr), - status{} + const double coarsen_tol) + : coarsen_param(coarsen_param) + , refine_param(refine_param) + , min_delta_t(min_delta) + , max_delta_t(max_delta) + , refine_tol(refine_tol) + , coarsen_tol(coarsen_tol) + , last_same_as_first(false) + , last_stage(nullptr) + , status{} { // virtual functions called in constructors and destructors never use the // override in a derived class diff --git a/include/deal.II/base/timer.h b/include/deal.II/base/timer.h index 2cb6001c9d..27e23900f1 100644 --- a/include/deal.II/base/timer.h +++ b/include/deal.II/base/timer.h @@ -1016,10 +1016,10 @@ TimerOutput::exit_section(const std::string §ion_name) } inline TimerOutput::Scope::Scope(dealii::TimerOutput &timer_, - const std::string & section_name_) : - timer(timer_), - section_name(section_name_), - in(true) + const std::string & section_name_) + : timer(timer_) + , section_name(section_name_) + , in(true) { timer.enter_section(section_name); } diff --git a/include/deal.II/base/utilities.h b/include/deal.II/base/utilities.h index ac27a7a580..2a5f984b45 100644 --- a/include/deal.II/base/utilities.h +++ b/include/deal.II/base/utilities.h @@ -923,9 +923,9 @@ namespace Utilities // verify that the two iterators are properly ordered. since // we need operator- for the iterator type anyway, do the // test as follows, rather than via 'last >= first' - Assert( - last - first >= 0, - ExcMessage("The given iterators do not satisfy the proper ordering.")); + Assert(last - first >= 0, + ExcMessage( + "The given iterators do not satisfy the proper ordering.")); unsigned int len = static_cast(last - first); diff --git a/include/deal.II/base/vector_slice.h b/include/deal.II/base/vector_slice.h index 5ba3fb3d86..52fb648ced 100644 --- a/include/deal.II/base/vector_slice.h +++ b/include/deal.II/base/vector_slice.h @@ -171,20 +171,20 @@ make_slice(VectorType &v, const unsigned int start, const unsigned int length) //--------------------------------------------------------------------------- template -inline VectorSlice::VectorSlice(VectorType &v) : - v(v), - start(0), - length(v.size()) +inline VectorSlice::VectorSlice(VectorType &v) + : v(v) + , start(0) + , length(v.size()) {} template inline VectorSlice::VectorSlice(VectorType & v, unsigned int start, - unsigned int length) : - v(v), - start(start), - length(length) + unsigned int length) + : v(v) + , start(start) + , length(length) { Assert((start + length <= v.size()), ExcIndexRange(length, 0, v.size() - start + 1)); diff --git a/include/deal.II/base/vectorization.h b/include/deal.II/base/vectorization.h index 58cda94b1f..eadadd8896 100644 --- a/include/deal.II/base/vectorization.h +++ b/include/deal.II/base/vectorization.h @@ -2492,12 +2492,12 @@ vectorized_transpose_and_store(const bool add_into, __m128d u1 = in[2 * i + 1].data; __m128d res0 = _mm_unpacklo_pd(u0, u1); __m128d res1 = _mm_unpackhi_pd(u0, u1); - _mm_storeu_pd( - out + 2 * i + offsets[0], - _mm_add_pd(_mm_loadu_pd(out + 2 * i + offsets[0]), res0)); - _mm_storeu_pd( - out + 2 * i + offsets[1], - _mm_add_pd(_mm_loadu_pd(out + 2 * i + offsets[1]), res1)); + _mm_storeu_pd(out + 2 * i + offsets[0], + _mm_add_pd(_mm_loadu_pd(out + 2 * i + offsets[0]), + res0)); + _mm_storeu_pd(out + 2 * i + offsets[1], + _mm_add_pd(_mm_loadu_pd(out + 2 * i + offsets[1]), + res1)); } for (unsigned int i = 2 * n_chunks; i < n_entries; ++i) for (unsigned int v = 0; v < 2; ++v) diff --git a/include/deal.II/base/work_stream.h b/include/deal.II/base/work_stream.h index c38fd56ca9..faa296e2ef 100644 --- a/include/deal.II/base/work_stream.h +++ b/include/deal.II/base/work_stream.h @@ -197,12 +197,13 @@ namespace WorkStream /** * Default constructor. */ - ScratchDataObject() : currently_in_use(false) + ScratchDataObject() + : currently_in_use(false) {} - ScratchDataObject(ScratchData *p, const bool in_use) : - scratch_data(p), - currently_in_use(in_use) + ScratchDataObject(ScratchData *p, const bool in_use) + : scratch_data(p) + , currently_in_use(in_use) {} // TODO: when we push back an object to the list of scratch objects, @@ -215,9 +216,9 @@ namespace WorkStream // again, but it's certainly awkward. one way to avoid this // would be to use unique_ptr but we'd need to figure out a way // to use it in non-C++11 mode - ScratchDataObject(const ScratchDataObject &o) : - scratch_data(o.scratch_data), - currently_in_use(o.currently_in_use) + ScratchDataObject(const ScratchDataObject &o) + : scratch_data(o.scratch_data) + , currently_in_use(o.currently_in_use) {} }; @@ -298,11 +299,11 @@ namespace WorkStream * Default constructor. Initialize everything that doesn't have a * default constructor itself. */ - ItemType() : - n_items(0), - scratch_data(nullptr), - sample_scratch_data(nullptr), - currently_in_use(false) + ItemType() + : n_items(0) + , scratch_data(nullptr) + , sample_scratch_data(nullptr) + , currently_in_use(false) {} }; @@ -317,12 +318,12 @@ namespace WorkStream const unsigned int buffer_size, const unsigned int chunk_size, const ScratchData &sample_scratch_data, - const CopyData & sample_copy_data) : - tbb::filter(/*is_serial=*/true), - remaining_iterator_range(begin, end), - item_buffer(buffer_size), - sample_scratch_data(sample_scratch_data), - chunk_size(chunk_size) + const CopyData & sample_copy_data) + : tbb::filter(/*is_serial=*/true) + , remaining_iterator_range(begin, end) + , item_buffer(buffer_size) + , sample_scratch_data(sample_scratch_data) + , chunk_size(chunk_size) { // initialize the elements of the ring buffer for (unsigned int element = 0; element < item_buffer.size(); @@ -475,10 +476,10 @@ namespace WorkStream Worker( const std::function & worker, - bool copier_exist = true) : - tbb::filter(/* is_serial= */ false), - worker(worker), - copier_exist(copier_exist) + bool copier_exist = true) + : tbb::filter(/* is_serial= */ false) + , worker(worker) + , copier_exist(copier_exist) {} @@ -621,9 +622,9 @@ namespace WorkStream * copying from the additional data object to the global matrix or * similar. */ - Copier(const std::function &copier) : - tbb::filter(/*is_serial=*/true), - copier(copier) + Copier(const std::function &copier) + : tbb::filter(/*is_serial=*/true) + , copier(copier) {} @@ -705,15 +706,16 @@ namespace WorkStream /** * Default constructor. */ - ScratchAndCopyDataObjects() : currently_in_use(false) + ScratchAndCopyDataObjects() + : currently_in_use(false) {} ScratchAndCopyDataObjects(ScratchData *p, CopyData * q, - const bool in_use) : - scratch_data(p), - copy_data(q), - currently_in_use(in_use) + const bool in_use) + : scratch_data(p) + , copy_data(q) + , currently_in_use(in_use) {} // TODO: when we push back an object to the list of scratch objects, in @@ -725,10 +727,10 @@ namespace WorkStream // it's certainly awkward. one way to avoid this would be to use // unique_ptr but we'd need to figure out a way to use it in // non-C++11 mode - ScratchAndCopyDataObjects(const ScratchAndCopyDataObjects &o) : - scratch_data(o.scratch_data), - copy_data(o.copy_data), - currently_in_use(o.currently_in_use) + ScratchAndCopyDataObjects(const ScratchAndCopyDataObjects &o) + : scratch_data(o.scratch_data) + , copy_data(o.copy_data) + , currently_in_use(o.currently_in_use) {} }; @@ -751,11 +753,11 @@ namespace WorkStream & worker, const std::function &copier, const ScratchData & sample_scratch_data, - const CopyData & sample_copy_data) : - worker(worker), - copier(copier), - sample_scratch_data(sample_scratch_data), - sample_copy_data(sample_copy_data) + const CopyData & sample_copy_data) + : worker(worker) + , copier(copier) + , sample_scratch_data(sample_scratch_data) + , sample_copy_data(sample_copy_data) {} @@ -804,8 +806,9 @@ namespace WorkStream scratch_data = new ScratchData(sample_scratch_data); copy_data = new CopyData(sample_copy_data); - scratch_and_copy_data_list.emplace_back( - scratch_data, copy_data, true); + scratch_and_copy_data_list.emplace_back(scratch_data, + copy_data, + true); } } @@ -1014,8 +1017,8 @@ namespace WorkStream { // need to check if the function is not the zero function. To // check zero-ness, create a C++ function out of it and check that - if (static_cast &>(worker)) + if (static_cast &>(worker)) worker(i, scratch_data, copy_data); if (static_cast &>( copier)) @@ -1148,8 +1151,10 @@ namespace WorkStream typedef typename std::vector::const_iterator RangeType; - WorkerAndCopier worker_and_copier( - worker, copier, sample_scratch_data, sample_copy_data); + WorkerAndCopier worker_and_copier(worker, + copier, + sample_scratch_data, + sample_copy_data); tbb::parallel_for( tbb::blocked_range(colored_iterators[color].begin(), diff --git a/include/deal.II/differentiation/ad/ad_number_traits.h b/include/deal.II/differentiation/ad/ad_number_traits.h index 252abe357e..ae8bd2fa97 100644 --- a/include/deal.II/differentiation/ad/ad_number_traits.h +++ b/include/deal.II/differentiation/ad/ad_number_traits.h @@ -939,9 +939,10 @@ namespace Differentiation true), "Expected a complex float_type"); - static_assert( - (is_complex_valued == true ? boost::is_complex::value : true), - "Expected a complex ad_type"); + static_assert((is_complex_valued == true ? + boost::is_complex::value : + true), + "Expected a complex ad_type"); }; # ifdef __clang__ diff --git a/include/deal.II/differentiation/ad/adolc_number_types.h b/include/deal.II/differentiation/ad/adolc_number_types.h index 170532298c..506dfae052 100644 --- a/include/deal.II/differentiation/ad/adolc_number_types.h +++ b/include/deal.II/differentiation/ad/adolc_number_types.h @@ -209,11 +209,11 @@ namespace Differentiation // Violating this condition when will result in an Adol-C internal // error. We could rather always throw here in order to provide a // less cryptic message. - AssertThrow( - index < adtl::getNumDir(), - ExcMessage("The index number of the independent variable being " - "marked is greater than the number of independent " - "variables that have been declared.")); + AssertThrow(index < adtl::getNumDir(), + ExcMessage( + "The index number of the independent variable being " + "marked is greater than the number of independent " + "variables that have been declared.")); out.setADValue(index, 1 /*seed value for first derivative*/); } @@ -272,10 +272,10 @@ namespace Differentiation static double directional_derivative(const adouble &, const unsigned int) { - AssertThrow( - false, - ExcMessage("The derivative values for taped Adol-C numbers must be" - "computed through the ::gradient function.")); + AssertThrow(false, + ExcMessage( + "The derivative values for taped Adol-C numbers must be" + "computed through the ::gradient function.")); return 0.0; } }; diff --git a/include/deal.II/distributed/tria.h b/include/deal.II/distributed/tria.h index 58fbd7a9a7..b6aa5ef89a 100644 --- a/include/deal.II/distributed/tria.h +++ b/include/deal.II/distributed/tria.h @@ -893,10 +893,10 @@ namespace parallel */ unsigned int n_attached_deserialize; - using pack_callback_t = std::function::cell_iterator, - CellStatus, - void *)>; + using pack_callback_t = std::function< + void(typename Triangulation::cell_iterator, + CellStatus, + void *)>; /** * List of callback functions registered by register_data_attach() that diff --git a/include/deal.II/dofs/dof_accessor.templates.h b/include/deal.II/dofs/dof_accessor.templates.h index 6545c1c566..55442f1121 100644 --- a/include/deal.II/dofs/dof_accessor.templates.h +++ b/include/deal.II/dofs/dof_accessor.templates.h @@ -57,12 +57,12 @@ inline DoFAccessor::DoFAccessor( DoFHandlerType::space_dimension> *tria, const int level, const int index, - const DoFHandlerType * dof_handler) : - dealii::internal::DoFAccessorImplementation::Inheritance< - structdim, - DoFHandlerType::dimension, - DoFHandlerType::space_dimension>::BaseClass(tria, level, index), - dof_handler(const_cast(dof_handler)) + const DoFHandlerType * dof_handler) + : dealii::internal::DoFAccessorImplementation::Inheritance< + structdim, + DoFHandlerType::dimension, + DoFHandlerType::space_dimension>::BaseClass(tria, level, index) + , dof_handler(const_cast(dof_handler)) { Assert( tria == nullptr || &dof_handler->get_triangulation() == tria, @@ -86,18 +86,18 @@ DoFAccessor::DoFAccessor( template template inline DoFAccessor::DoFAccessor( - const DoFAccessor &other) : - BaseClass(other), - dof_handler(nullptr) + const DoFAccessor &other) + : BaseClass(other) + , dof_handler(nullptr) { - Assert( - false, - ExcMessage("You are trying to assign iterators that are incompatible. " - "Reasons for incompatibility are that they point to different " - "types of DoFHandlers (e.g., dealii::DoFHandler and " - "dealii::hp::DoFHandler) or that they refer to objects of " - "different dimensionality (e.g., assigning a line iterator " - "to a quad iterator).")); + Assert(false, + ExcMessage( + "You are trying to assign iterators that are incompatible. " + "Reasons for incompatibility are that they point to different " + "types of DoFHandlers (e.g., dealii::DoFHandler and " + "dealii::hp::DoFHandler) or that they refer to objects of " + "different dimensionality (e.g., assigning a line iterator " + "to a quad iterator).")); } @@ -105,9 +105,9 @@ inline DoFAccessor::DoFAccessor( template template inline DoFAccessor::DoFAccessor( - const DoFAccessor &other) : - BaseClass(other), - dof_handler(const_cast(other.dof_handler)) + const DoFAccessor &other) + : BaseClass(other) + , dof_handler(const_cast(other.dof_handler)) {} @@ -261,8 +261,10 @@ namespace internal (void)obj_level; // faces have no levels Assert(obj_level == 0, ExcInternalError()); - return dof_handler.faces->lines.get_dof_index( - dof_handler, obj_index, fe_index, local_index); + return dof_handler.faces->lines.get_dof_index(dof_handler, + obj_index, + fe_index, + local_index); } @@ -325,8 +327,10 @@ namespace internal (void)obj_level; // faces have no levels Assert(obj_level == 0, ExcInternalError()); - return dof_handler.faces->lines.get_dof_index( - dof_handler, obj_index, fe_index, local_index); + return dof_handler.faces->lines.get_dof_index(dof_handler, + obj_index, + fe_index, + local_index); } @@ -361,8 +365,10 @@ namespace internal (void)obj_level; // faces have no levels Assert(obj_level == 0, ExcInternalError()); - return dof_handler.faces->quads.get_dof_index( - dof_handler, obj_index, fe_index, local_index); + return dof_handler.faces->quads.get_dof_index(dof_handler, + obj_index, + fe_index, + local_index); } @@ -423,8 +429,9 @@ namespace internal const unsigned int local_index, const std::integral_constant &) { - return dof_handler.levels[obj_level]->get_dof_index( - obj_index, fe_index, local_index); + return dof_handler.levels[obj_level]->get_dof_index(obj_index, + fe_index, + local_index); } @@ -438,8 +445,10 @@ namespace internal const std::integral_constant &, const types::global_dof_index global_index) { - dof_handler.levels[obj_level]->set_dof_index( - obj_index, fe_index, local_index, global_index); + dof_handler.levels[obj_level]->set_dof_index(obj_index, + fe_index, + local_index, + global_index); } @@ -485,8 +494,9 @@ namespace internal const unsigned int local_index, const std::integral_constant &) { - return dof_handler.levels[obj_level]->get_dof_index( - obj_index, fe_index, local_index); + return dof_handler.levels[obj_level]->get_dof_index(obj_index, + fe_index, + local_index); } @@ -500,8 +510,10 @@ namespace internal const std::integral_constant &, const types::global_dof_index global_index) { - dof_handler.levels[obj_level]->set_dof_index( - obj_index, fe_index, local_index, global_index); + dof_handler.levels[obj_level]->set_dof_index(obj_index, + fe_index, + local_index, + global_index); } @@ -580,8 +592,9 @@ namespace internal const unsigned int local_index, const std::integral_constant &) { - return dof_handler.levels[obj_level]->get_dof_index( - obj_index, fe_index, local_index); + return dof_handler.levels[obj_level]->get_dof_index(obj_index, + fe_index, + local_index); } @@ -595,8 +608,10 @@ namespace internal const std::integral_constant &, const types::global_dof_index global_index) { - dof_handler.levels[obj_level]->set_dof_index( - obj_index, fe_index, local_index, global_index); + dof_handler.levels[obj_level]->set_dof_index(obj_index, + fe_index, + local_index, + global_index); } @@ -619,9 +634,9 @@ namespace internal const unsigned int, const unsigned int) { - Assert( - false, - ExcMessage("hp::DoFHandler does not implement multilevel DoFs.")); + Assert(false, + ExcMessage( + "hp::DoFHandler does not implement multilevel DoFs.")); return numbers::invalid_dof_index; } @@ -647,9 +662,9 @@ namespace internal const unsigned int, types::global_dof_index) { - Assert( - false, - ExcMessage("hp::DoFHandler does not implement multilevel DoFs.")); + Assert(false, + ExcMessage( + "hp::DoFHandler does not implement multilevel DoFs.")); } @@ -802,8 +817,10 @@ namespace internal const unsigned int fe_index, const std::integral_constant &) { - return dof_handler.faces->lines.fe_index_is_active( - dof_handler, obj_index, fe_index, obj_level); + return dof_handler.faces->lines.fe_index_is_active(dof_handler, + obj_index, + fe_index, + obj_level); } @@ -829,8 +846,10 @@ namespace internal const unsigned int n, const std::integral_constant &) { - return dof_handler.faces->lines.nth_active_fe_index( - dof_handler, obj_level, obj_index, n); + return dof_handler.faces->lines.nth_active_fe_index(dof_handler, + obj_level, + obj_index, + n); } @@ -886,8 +905,10 @@ namespace internal const unsigned int fe_index, const std::integral_constant &) { - return dof_handler.faces->lines.fe_index_is_active( - dof_handler, obj_index, fe_index, obj_level); + return dof_handler.faces->lines.fe_index_is_active(dof_handler, + obj_index, + fe_index, + obj_level); } @@ -914,8 +935,10 @@ namespace internal const unsigned int n, const std::integral_constant &) { - return dof_handler.faces->lines.nth_active_fe_index( - dof_handler, obj_level, obj_index, n); + return dof_handler.faces->lines.nth_active_fe_index(dof_handler, + obj_level, + obj_index, + n); } @@ -928,8 +951,10 @@ namespace internal const unsigned int fe_index, const std::integral_constant &) { - return dof_handler.faces->quads.fe_index_is_active( - dof_handler, obj_index, fe_index, obj_level); + return dof_handler.faces->quads.fe_index_is_active(dof_handler, + obj_index, + fe_index, + obj_level); } template @@ -968,8 +993,10 @@ namespace internal const unsigned int n, const std::integral_constant &) { - return dof_handler.faces->quads.nth_active_fe_index( - dof_handler, obj_level, obj_index, n); + return dof_handler.faces->quads.nth_active_fe_index(dof_handler, + obj_level, + obj_index, + n); } @@ -1020,9 +1047,10 @@ namespace internal (fe_index == dealii::DoFHandler::default_fe_index), ExcMessage( "Only the default FE index is allowed for non-hp DoFHandler objects")); - Assert( - local_index < dof_handler.get_fe().dofs_per_vertex, - ExcIndexRange(local_index, 0, dof_handler.get_fe().dofs_per_vertex)); + Assert(local_index < dof_handler.get_fe().dofs_per_vertex, + ExcIndexRange(local_index, + 0, + dof_handler.get_fe().dofs_per_vertex)); dof_handler .vertex_dofs[vertex_index * dof_handler.get_fe().dofs_per_vertex + @@ -1038,16 +1066,17 @@ namespace internal const unsigned int local_index, const types::global_dof_index global_index) { - Assert( - (fe_index != dealii::hp::DoFHandler::default_fe_index), - ExcMessage("You need to specify a FE index when working " - "with hp DoFHandlers")); + Assert((fe_index != + dealii::hp::DoFHandler::default_fe_index), + ExcMessage("You need to specify a FE index when working " + "with hp DoFHandlers")); Assert(dof_handler.fe_collection.size() > 0, ExcMessage("No finite element collection is associated with " "this DoFHandler")); Assert(local_index < dof_handler.get_fe(fe_index).dofs_per_vertex, - ExcIndexRange( - local_index, 0, dof_handler.get_fe(fe_index).dofs_per_vertex)); + ExcIndexRange(local_index, + 0, + dof_handler.get_fe(fe_index).dofs_per_vertex)); Assert(fe_index < dof_handler.fe_collection.size(), ExcInternalError()); Assert(dof_handler.vertex_dof_offsets[vertex_index] != numbers::invalid_unsigned_int, @@ -1110,9 +1139,10 @@ namespace internal (fe_index == dealii::DoFHandler::default_fe_index), ExcMessage( "Only the default FE index is allowed for non-hp DoFHandler objects")); - Assert( - local_index < dof_handler.get_fe().dofs_per_vertex, - ExcIndexRange(local_index, 0, dof_handler.get_fe().dofs_per_vertex)); + Assert(local_index < dof_handler.get_fe().dofs_per_vertex, + ExcIndexRange(local_index, + 0, + dof_handler.get_fe().dofs_per_vertex)); return dof_handler .vertex_dofs[vertex_index * dof_handler.get_fe().dofs_per_vertex + @@ -1128,19 +1158,21 @@ namespace internal const unsigned int fe_index, const unsigned int local_index) { - Assert( - (fe_index != dealii::hp::DoFHandler::default_fe_index), - ExcMessage("You need to specify a FE index when working " - "with hp DoFHandlers")); + Assert((fe_index != + dealii::hp::DoFHandler::default_fe_index), + ExcMessage("You need to specify a FE index when working " + "with hp DoFHandlers")); Assert(dof_handler.fe_collection.size() > 0, ExcMessage("No finite element collection is associated with " "this DoFHandler")); Assert(local_index < dof_handler.get_fe(fe_index).dofs_per_vertex, - ExcIndexRange( - local_index, 0, dof_handler.get_fe(fe_index).dofs_per_vertex)); + ExcIndexRange(local_index, + 0, + dof_handler.get_fe(fe_index).dofs_per_vertex)); Assert(vertex_index < dof_handler.vertex_dof_offsets.size(), - ExcIndexRange( - vertex_index, 0, dof_handler.vertex_dof_offsets.size())); + ExcIndexRange(vertex_index, + 0, + dof_handler.vertex_dof_offsets.size())); Assert(dof_handler.vertex_dof_offsets[vertex_index] != numbers::invalid_unsigned_int, ExcMessage( @@ -1302,10 +1334,10 @@ namespace internal const unsigned int vertex_index, const unsigned int fe_index) { - Assert( - (fe_index != dealii::hp::DoFHandler::default_fe_index), - ExcMessage("You need to specify a FE index when working " - "with hp DoFHandlers")); + Assert((fe_index != + dealii::hp::DoFHandler::default_fe_index), + ExcMessage("You need to specify a FE index when working " + "with hp DoFHandlers")); Assert(dof_handler.fe_collection.size() > 0, ExcMessage("No finite element collection is associated with " "this DoFHandler")); @@ -1468,10 +1500,11 @@ namespace internal std::iota(idx.begin(), idx.end(), 0u); // sort indices based on comparing values in v - std::sort( - idx.begin(), idx.end(), [&v_begin](unsigned int i1, unsigned int i2) { - return *(v_begin + i1) < *(v_begin + i2); - }); + std::sort(idx.begin(), + idx.end(), + [&v_begin](unsigned int i1, unsigned int i2) { + return *(v_begin + i1) < *(v_begin + i2); + }); return idx; } @@ -1611,8 +1644,10 @@ DoFAccessor::vertex_dof_index( const unsigned int fe_index) const { return dealii::internal::DoFAccessorImplementation::Implementation:: - get_vertex_dof_index( - *this->dof_handler, this->vertex_index(vertex), fe_index, i); + get_vertex_dof_index(*this->dof_handler, + this->vertex_index(vertex), + fe_index, + i); } @@ -1628,13 +1663,16 @@ DoFAccessor::mg_vertex_dof_index( Assert(this->dof_handler != nullptr, ExcInvalidObject()); Assert(vertex < GeometryInfo::vertices_per_cell, ExcIndexRange(vertex, 0, GeometryInfo::vertices_per_cell)); - Assert( - i < this->dof_handler->get_fe(fe_index).dofs_per_vertex, - ExcIndexRange(i, 0, this->dof_handler->get_fe(fe_index).dofs_per_vertex)); + Assert(i < this->dof_handler->get_fe(fe_index).dofs_per_vertex, + ExcIndexRange(i, + 0, + this->dof_handler->get_fe(fe_index).dofs_per_vertex)); return dealii::internal::DoFAccessorImplementation::Implementation:: - mg_vertex_dof_index( - *this->dof_handler, level, this->vertex_index(vertex), i); + mg_vertex_dof_index(*this->dof_handler, + level, + this->vertex_index(vertex), + i); } @@ -1665,9 +1703,10 @@ DoFAccessor:: Assert(this->dof_handler != nullptr, ExcInvalidObject()); Assert(vertex < GeometryInfo::vertices_per_cell, ExcIndexRange(vertex, 0, GeometryInfo::vertices_per_cell)); - Assert( - i < this->dof_handler->get_fe(fe_index).dofs_per_vertex, - ExcIndexRange(i, 0, this->dof_handler->get_fe(fe_index).dofs_per_vertex)); + Assert(i < this->dof_handler->get_fe(fe_index).dofs_per_vertex, + ExcIndexRange(i, + 0, + this->dof_handler->get_fe(fe_index).dofs_per_vertex)); return dealii::internal::DoFAccessorImplementation::Implementation:: set_mg_vertex_dof_index( @@ -1953,11 +1992,12 @@ DoFAccessor::get_dof_indices( const unsigned int fe_index) const { Assert(this->dof_handler != nullptr, ExcInvalidObject()); - Assert( - static_cast(this->level()) < this->dof_handler->levels.size(), - ExcMessage("The DoFHandler to which this accessor points has not " - "been initialized, i.e., it doesn't appear that DoF indices " - "have been distributed on it.")); + Assert(static_cast(this->level()) < + this->dof_handler->levels.size(), + ExcMessage( + "The DoFHandler to which this accessor points has not " + "been initialized, i.e., it doesn't appear that DoF indices " + "have been distributed on it.")); switch (structdim) { @@ -2005,8 +2045,9 @@ DoFAccessor::get_dof_indices( ExcInternalError()); // now do the actual work - dealii::internal::DoFAccessorImplementation::get_dof_indices( - *this, dof_indices, fe_index); + dealii::internal::DoFAccessorImplementation::get_dof_indices(*this, + dof_indices, + fe_index); } @@ -2056,8 +2097,10 @@ DoFAccessor::get_mg_dof_indices( Assert(false, ExcNotImplemented()); } - internal::DoFAccessorImplementation::get_mg_dof_indices( - *this, level, dof_indices, fe_index); + internal::DoFAccessorImplementation::get_mg_dof_indices(*this, + level, + dof_indices, + fe_index); } @@ -2192,12 +2235,12 @@ inline typename dealii::internal::DoFHandlerImplementation:: Assert(i == 0, ExcMessage("You can only ask for line zero if the " "current object is a line itself.")); - return typename dealii::internal::DoFHandlerImplementation:: - Iterators::cell_iterator( - &this->get_triangulation(), - this->level(), - this->index(), - &this->get_dof_handler()); + return typename dealii::internal::DoFHandlerImplementation::Iterators< + DoFHandlerType, + level_dof_access>::cell_iterator(&this->get_triangulation(), + this->level(), + this->index(), + &this->get_dof_handler()); } // otherwise we need to be in structdim>=2 @@ -2275,9 +2318,9 @@ inline DoFAccessor<0, DoFHandlerType<1, spacedim>, level_dof_access>:: const Triangulation<1, spacedim> * tria, const typename TriaAccessor<0, 1, spacedim>::VertexKind vertex_kind, const unsigned int vertex_index, - const DoFHandlerType<1, spacedim> * dof_handler) : - BaseClass(tria, vertex_kind, vertex_index), - dof_handler(const_cast *>(dof_handler)) + const DoFHandlerType<1, spacedim> * dof_handler) + : BaseClass(tria, vertex_kind, vertex_index) + , dof_handler(const_cast *>(dof_handler)) {} @@ -2289,12 +2332,12 @@ inline DoFAccessor<0, DoFHandlerType<1, spacedim>, level_dof_access>:: DoFAccessor(const Triangulation<1, spacedim> *, const int, const int, - const DoFHandlerType<1, spacedim> *) : - dof_handler(nullptr) + const DoFHandlerType<1, spacedim> *) + : dof_handler(nullptr) { - Assert( - false, - ExcMessage("This constructor can not be called for face iterators in 1d.")); + Assert(false, + ExcMessage( + "This constructor can not be called for face iterators in 1d.")); } @@ -2386,8 +2429,10 @@ DoFAccessor<0, DoFHandlerType<1, spacedim>, level_dof_access>::get_dof_indices( { for (unsigned int i = 0; i < dof_indices.size(); ++i) dof_indices[i] = dealii::internal::DoFAccessorImplementation:: - Implementation::get_vertex_dof_index( - *dof_handler, this->global_vertex_index, fe_index, i); + Implementation::get_vertex_dof_index(*dof_handler, + this->global_vertex_index, + fe_index, + i); } @@ -2439,8 +2484,10 @@ DoFAccessor<0, DoFHandlerType<1, spacedim>, level_dof_access>::dof_index( const unsigned int fe_index) const { return dealii::internal::DoFAccessorImplementation::Implementation:: - get_vertex_dof_index( - *this->dof_handler, this->vertex_index(0), fe_index, i); + get_vertex_dof_index(*this->dof_handler, + this->vertex_index(0), + fe_index, + i); } @@ -2880,8 +2927,10 @@ namespace internal vertex < GeometryInfo::vertices_per_cell; ++vertex) for (unsigned int d = 0; d < dofs_per_vertex; ++d, ++index) - accessor.set_vertex_dof_index( - vertex, d, local_dof_indices[index], accessor.active_fe_index()); + accessor.set_vertex_dof_index(vertex, + d, + local_dof_indices[index], + accessor.active_fe_index()); // now copy dof numbers into the line. for lines in 3d with the // wrong orientation, we have already made sure that we're ok // by picking the correct vertices (this happens automatically @@ -2926,8 +2975,9 @@ namespace internal local_dof_indices[index], accessor.active_fe_index()); for (unsigned int d = 0; d < dofs_per_hex; ++d, ++index) - accessor.set_dof_index( - d, local_dof_indices[index], accessor.active_fe_index()); + accessor.set_dof_index(d, + local_dof_indices[index], + accessor.active_fe_index()); Assert(index == accessor.get_fe().dofs_per_cell, ExcInternalError()); } @@ -3023,11 +3073,11 @@ namespace internal Assert( accessor.dof_handler != nullptr, (typename std::decay::type::ExcInvalidObject())); - Assert( - static_cast(local_source_end - local_source_begin) == - accessor.get_fe().dofs_per_cell, - (typename std::decay::type::ExcVectorDoesNotMatch())); + Assert(static_cast(local_source_end - + local_source_begin) == + accessor.get_fe().dofs_per_cell, + (typename std::decay::type::ExcVectorDoesNotMatch())); Assert(accessor.dof_handler->n_dofs() == global_destination.size(), (typename std::decay::type::ExcVectorDoesNotMatch())); @@ -3122,8 +3172,10 @@ namespace internal ->cell_dof_indices_cache[accessor.present_index * n_dofs]; // distribute cell vector - constraints.distribute_local_to_global( - local_source_begin, local_source_end, dofs, global_destination); + constraints.distribute_local_to_global(local_source_begin, + local_source_end, + dofs, + global_destination); } @@ -3376,12 +3428,12 @@ inline DoFCellAccessor::DoFCellAccessor( DoFHandlerType::space_dimension> *tria, const int level, const int index, - const AccessorData * local_data) : - DoFAccessor( - tria, - level, - index, - local_data) + const AccessorData * local_data) + : DoFAccessor( + tria, + level, + index, + local_data) {} @@ -3398,8 +3450,8 @@ inline DoFCellAccessor::DoFCellAccessor( template template inline DoFCellAccessor::DoFCellAccessor( - const DoFAccessor &other) : - BaseClass(other) + const DoFAccessor &other) + : BaseClass(other) {} @@ -3617,8 +3669,10 @@ DoFCellAccessor::get_dof_values( this->dof_handler->levels[this->present_level]->get_cell_cache_start( this->present_index, this->get_fe().dofs_per_cell); dealii::internal::DoFAccessorImplementation::Implementation:: - extract_subvector_to( - values, cache, cache + this->get_fe().dofs_per_cell, local_values_begin); + extract_subvector_to(values, + cache, + cache + this->get_fe().dofs_per_cell, + local_values_begin); } @@ -3647,8 +3701,10 @@ DoFCellAccessor::get_dof_values( this->dof_handler->levels[this->present_level]->get_cell_cache_start( this->present_index, this->get_fe().dofs_per_cell); - constraints.get_dof_values( - values, *cache, local_values_begin, local_values_end); + constraints.get_dof_values(values, + *cache, + local_values_begin, + local_values_end); } @@ -3768,8 +3824,10 @@ DoFCellAccessor::distribute_local_to_global( OutputVector & global_destination) const { dealii::internal::DoFCellAccessorImplementation::Implementation:: - distribute_local_to_global( - *this, local_source.begin(), local_source.end(), global_destination); + distribute_local_to_global(*this, + local_source.begin(), + local_source.end(), + global_destination); } @@ -3783,8 +3841,10 @@ DoFCellAccessor::distribute_local_to_global( OutputVector & global_destination) const { dealii::internal::DoFCellAccessorImplementation::Implementation:: - distribute_local_to_global( - *this, local_source_begin, local_source_end, global_destination); + distribute_local_to_global(*this, + local_source_begin, + local_source_end, + global_destination); } diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index b0db0f71eb..e0118fcb45 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -1313,9 +1313,9 @@ template inline types::global_dof_index DoFHandler::n_dofs(const unsigned int level) const { - Assert( - has_level_dofs(), - ExcMessage("n_dofs(level) can only be called after distribute_mg_dofs()")); + Assert(has_level_dofs(), + ExcMessage( + "n_dofs(level) can only be called after distribute_mg_dofs()")); Assert(level < mg_number_cache.size(), ExcInvalidLevel(level)); return mg_number_cache[level].n_global_dofs; } @@ -1556,22 +1556,22 @@ DoFHandler::load(Archive &ar, const unsigned int) ar &n_cells &fe_name &policy_name; - AssertThrow( - n_cells == tria->n_cells(), - ExcMessage("The object being loaded into does not match the triangulation " - "that has been stored previously.")); + AssertThrow(n_cells == tria->n_cells(), + ExcMessage( + "The object being loaded into does not match the triangulation " + "that has been stored previously.")); AssertThrow( fe_name == this->get_fe(0).get_name(), ExcMessage( "The finite element associated with this DoFHandler does not match " "the one that was associated with the DoFHandler previously stored.")); - AssertThrow( - policy_name == internal::policy_to_string(*policy), - ExcMessage("The policy currently associated with this DoFHandler (" + - internal::policy_to_string(*policy) + - ") does not match the one that was associated with the " - "DoFHandler previously stored (" + - policy_name + ").")); + AssertThrow(policy_name == internal::policy_to_string(*policy), + ExcMessage( + "The policy currently associated with this DoFHandler (" + + internal::policy_to_string(*policy) + + ") does not match the one that was associated with the " + "DoFHandler previously stored (" + + policy_name + ").")); } diff --git a/include/deal.II/dofs/dof_renumbering.h b/include/deal.II/dofs/dof_renumbering.h index 41fe5b699d..3ab75b6b9b 100644 --- a/include/deal.II/dofs/dof_renumbering.h +++ b/include/deal.II/dofs/dof_renumbering.h @@ -355,7 +355,8 @@ namespace DoFRenumbering /** * Constructor. */ - CompareDownstream(const Tensor<1, dim> &dir) : dir(dir) + CompareDownstream(const Tensor<1, dim> &dir) + : dir(dir) {} /** * Return true if c1 less c2. @@ -388,7 +389,8 @@ namespace DoFRenumbering /** * Constructor. */ - ComparePointwiseDownstream(const Tensor<1, dim> &dir) : dir(dir) + ComparePointwiseDownstream(const Tensor<1, dim> &dir) + : dir(dir) {} /** * Return true if c1 less c2. diff --git a/include/deal.II/fe/block_mask.h b/include/deal.II/fe/block_mask.h index 59244d788c..ebc66bcc4d 100644 --- a/include/deal.II/fe/block_mask.h +++ b/include/deal.II/fe/block_mask.h @@ -235,14 +235,13 @@ operator<<(std::ostream &out, const BlockMask &mask); // -------------------- inline functions --------------------- -inline BlockMask::BlockMask(const std::vector &block_mask) : - block_mask(block_mask) +inline BlockMask::BlockMask(const std::vector &block_mask) + : block_mask(block_mask) {} -inline BlockMask::BlockMask(const unsigned int n_blocks, - const bool initializer) : - block_mask(n_blocks, initializer) +inline BlockMask::BlockMask(const unsigned int n_blocks, const bool initializer) + : block_mask(n_blocks, initializer) {} diff --git a/include/deal.II/fe/component_mask.h b/include/deal.II/fe/component_mask.h index 6e38c1a021..802a400468 100644 --- a/include/deal.II/fe/component_mask.h +++ b/include/deal.II/fe/component_mask.h @@ -257,14 +257,14 @@ operator<<(std::ostream &out, const ComponentMask &mask); // -------------------- inline functions --------------------- -inline ComponentMask::ComponentMask(const std::vector &component_mask) : - component_mask(component_mask) +inline ComponentMask::ComponentMask(const std::vector &component_mask) + : component_mask(component_mask) {} inline ComponentMask::ComponentMask(const unsigned int n_components, - const bool initializer) : - component_mask(n_components, initializer) + const bool initializer) + : component_mask(n_components, initializer) {} diff --git a/include/deal.II/fe/fe_dg_vector.templates.h b/include/deal.II/fe/fe_dg_vector.templates.h index 678e3e6fd3..44d25ad736 100644 --- a/include/deal.II/fe/fe_dg_vector.templates.h +++ b/include/deal.II/fe/fe_dg_vector.templates.h @@ -32,16 +32,16 @@ DEAL_II_NAMESPACE_OPEN template FE_DGVector::FE_DGVector(const unsigned int deg, - MappingType map) : - FE_PolyTensor( - deg, - FiniteElementData(get_dpo_vector(deg), - dim, - deg + 1, - FiniteElementData::L2), - std::vector(PolynomialType::compute_n_pols(deg), true), - std::vector(PolynomialType::compute_n_pols(deg), - ComponentMask(dim, true))) + MappingType map) + : FE_PolyTensor( + deg, + FiniteElementData(get_dpo_vector(deg), + dim, + deg + 1, + FiniteElementData::L2), + std::vector(PolynomialType::compute_n_pols(deg), true), + std::vector(PolynomialType::compute_n_pols(deg), + ComponentMask(dim, true))) { this->mapping_type = map; const unsigned int polynomial_degree = this->tensor_degree(); diff --git a/include/deal.II/fe/fe_poly.templates.h b/include/deal.II/fe/fe_poly.templates.h index 1a94bba20a..2d0938665e 100644 --- a/include/deal.II/fe/fe_poly.templates.h +++ b/include/deal.II/fe/fe_poly.templates.h @@ -34,11 +34,11 @@ FE_Poly::FE_Poly( const PolynomialType & poly_space, const FiniteElementData & fe_data, const std::vector & restriction_is_additive_flags, - const std::vector &nonzero_components) : - FiniteElement(fe_data, - restriction_is_additive_flags, - nonzero_components), - poly_space(poly_space) + const std::vector &nonzero_components) + : FiniteElement(fe_data, + restriction_is_additive_flags, + nonzero_components) + , poly_space(poly_space) { AssertDimension(dim, PolynomialType::dimension); } @@ -278,15 +278,17 @@ FE_Poly::fill_fe_values( cell_similarity != CellSimilarity::translation) { for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - mapping.transform( - make_array_view(fe_data.shape_3rd_derivatives, k), - mapping_covariant_hessian, - mapping_internal, - make_array_view(output_data.shape_3rd_derivatives, k)); + mapping.transform(make_array_view(fe_data.shape_3rd_derivatives, k), + mapping_covariant_hessian, + mapping_internal, + make_array_view(output_data.shape_3rd_derivatives, + k)); for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - correct_third_derivatives( - output_data, mapping_data, quadrature.size(), k); + correct_third_derivatives(output_data, + mapping_data, + quadrature.size(), + k); } } @@ -365,16 +367,20 @@ FE_Poly::fill_fe_face_values( if (flags & update_3rd_derivatives) { for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - mapping.transform( - make_array_view( - fe_data.shape_3rd_derivatives, k, offset, quadrature.size()), - mapping_covariant_hessian, - mapping_internal, - make_array_view(output_data.shape_3rd_derivatives, k)); + mapping.transform(make_array_view(fe_data.shape_3rd_derivatives, + k, + offset, + quadrature.size()), + mapping_covariant_hessian, + mapping_internal, + make_array_view(output_data.shape_3rd_derivatives, + k)); for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - correct_third_derivatives( - output_data, mapping_data, quadrature.size(), k); + correct_third_derivatives(output_data, + mapping_data, + quadrature.size(), + k); } } @@ -456,16 +462,20 @@ FE_Poly::fill_fe_subface_values( if (flags & update_3rd_derivatives) { for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - mapping.transform( - make_array_view( - fe_data.shape_3rd_derivatives, k, offset, quadrature.size()), - mapping_covariant_hessian, - mapping_internal, - make_array_view(output_data.shape_3rd_derivatives, k)); + mapping.transform(make_array_view(fe_data.shape_3rd_derivatives, + k, + offset, + quadrature.size()), + mapping_covariant_hessian, + mapping_internal, + make_array_view(output_data.shape_3rd_derivatives, + k)); for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - correct_third_derivatives( - output_data, mapping_data, quadrature.size(), k); + correct_third_derivatives(output_data, + mapping_data, + quadrature.size(), + k); } } diff --git a/include/deal.II/fe/fe_poly_face.h b/include/deal.II/fe/fe_poly_face.h index c1b588eb37..288f018bb9 100644 --- a/include/deal.II/fe/fe_poly_face.h +++ b/include/deal.II/fe/fe_poly_face.h @@ -162,11 +162,11 @@ protected: spacedim> &output_data) const override { - return get_face_data( - update_flags, - mapping, - QProjector::project_to_all_children(quadrature), - output_data); + return get_face_data(update_flags, + mapping, + QProjector::project_to_all_children( + quadrature), + output_data); } virtual void diff --git a/include/deal.II/fe/fe_poly_face.templates.h b/include/deal.II/fe/fe_poly_face.templates.h index 2e0e3b1752..b9d3883f4a 100644 --- a/include/deal.II/fe/fe_poly_face.templates.h +++ b/include/deal.II/fe/fe_poly_face.templates.h @@ -30,12 +30,12 @@ template FE_PolyFace::FE_PolyFace( const PolynomialType & poly_space, const FiniteElementData &fe_data, - const std::vector & restriction_is_additive_flags) : - FiniteElement( - fe_data, - restriction_is_additive_flags, - std::vector(1, ComponentMask(1, true))), - poly_space(poly_space) + const std::vector & restriction_is_additive_flags) + : FiniteElement( + fe_data, + restriction_is_additive_flags, + std::vector(1, ComponentMask(1, true))) + , poly_space(poly_space) { AssertDimension(dim, PolynomialType::dimension + 1); } diff --git a/include/deal.II/fe/fe_series.h b/include/deal.II/fe/fe_series.h index 7f469b70c3..681b4dda6f 100644 --- a/include/deal.II/fe/fe_series.h +++ b/include/deal.II/fe/fe_series.h @@ -370,10 +370,10 @@ namespace double complex_mean_value(const std::complex &value) { - AssertThrow( - false, - ExcMessage("FESeries::process_coefficients() can not be used with" - "complex-valued coefficients and VectorTools::mean norm.")); + AssertThrow(false, + ExcMessage( + "FESeries::process_coefficients() can not be used with" + "complex-valued coefficients and VectorTools::mean norm.")); return std::abs(value); } diff --git a/include/deal.II/fe/fe_system.h b/include/deal.II/fe/fe_system.h index 32f76718a4..1eac35bea9 100644 --- a/include/deal.II/fe/fe_system.h +++ b/include/deal.II/fe/fe_system.h @@ -1275,9 +1275,9 @@ namespace // of the std::enable_if. template template -FESystem::FESystem(FEPairs &&... fe_pairs) : - FESystem( - {promote_to_fe_pair(std::forward(fe_pairs))...}) +FESystem::FESystem(FEPairs &&... fe_pairs) + : FESystem( + {promote_to_fe_pair(std::forward(fe_pairs))...}) {} @@ -1286,14 +1286,15 @@ template FESystem::FESystem( const std::initializer_list< std::pair>, unsigned int>> - &fe_systems) : - FiniteElement( - FETools::Compositing::multiply_dof_numbers(fe_systems), - FETools::Compositing::compute_restriction_is_additive_flags( - fe_systems), - FETools::Compositing::compute_nonzero_components( - fe_systems)), - base_elements(count_nonzeros(fe_systems)) + &fe_systems) + : FiniteElement( + FETools::Compositing::multiply_dof_numbers(fe_systems), + FETools::Compositing::compute_restriction_is_additive_flags( + fe_systems), + FETools::Compositing::compute_nonzero_components( + fe_systems)) + , base_elements(count_nonzeros(fe_systems)) { std::vector *> fes; std::vector multiplicities; diff --git a/include/deal.II/fe/fe_tools.templates.h b/include/deal.II/fe/fe_tools.templates.h index 76819477eb..1283029750 100644 --- a/include/deal.II/fe/fe_tools.templates.h +++ b/include/deal.II/fe/fe_tools.templates.h @@ -156,12 +156,13 @@ namespace FETools for (unsigned int m = 0; m < multiplicities[base]; ++m) block_indices.push_back(fes[base]->dofs_per_cell); - return FiniteElementData( - dpo, - (do_tensor_product ? multiplied_n_components : n_components), - degree, - total_conformity, - block_indices); + return FiniteElementData(dpo, + (do_tensor_product ? + multiplied_n_components : + n_components), + degree, + total_conformity, + block_indices); } @@ -396,14 +397,15 @@ namespace FETools // Now check that all FEs have the same number of components: for (unsigned int i = 0; i < fes.size(); ++i) if (multiplicities[i] > 0) // needed because fe might be NULL - Assert( - n_components == fes[i]->n_components(), - ExcDimensionMismatch(n_components, fes[i]->n_components())); + Assert(n_components == fes[i]->n_components(), + ExcDimensionMismatch(n_components, + fes[i]->n_components())); } // generate the array that will hold the output - std::vector> retval( - n_shape_functions, std::vector(n_components, false)); + std::vector> retval(n_shape_functions, + std::vector(n_components, + false)); // finally go through all the shape functions of the base elements, and // copy their flags. this somehow copies the code in build_cell_table, @@ -601,8 +603,9 @@ namespace FETools fe_list.push_back(fe5); multiplicities.push_back(N5); - return compute_nonzero_components( - fe_list, multiplicities, do_tensor_product); + return compute_nonzero_components(fe_list, + multiplicities, + do_tensor_product); } @@ -934,8 +937,9 @@ namespace FETools fe.base_element(base).dofs_per_line * line_number + local_index); - face_system_to_base_table[total_index] = std::make_pair( - std::make_pair(base, m), face_index_in_base); + face_system_to_base_table[total_index] = + std::make_pair(std::make_pair(base, m), + face_index_in_base); if (fe.base_element(base).is_primitive(index_in_base)) { @@ -984,8 +988,9 @@ namespace FETools fe.base_element(base).dofs_per_quad * quad_number + local_index); - face_system_to_base_table[total_index] = std::make_pair( - std::make_pair(base, m), face_index_in_base); + face_system_to_base_table[total_index] = + std::make_pair(std::make_pair(base, m), + face_index_in_base); if (fe.base_element(base).is_primitive(index_in_base)) { @@ -2118,8 +2123,10 @@ namespace FETools cell_number < GeometryInfo::max_children_per_face; ++cell_number) { - const Quadrature q_coarse = QProjector::project_to_subface( - q_gauss, face_coarse, cell_number); + const Quadrature q_coarse = + QProjector::project_to_subface(q_gauss, + face_coarse, + cell_number); FEValues coarse(mapping, fe, q_coarse, update_values); typename Triangulation::active_cell_iterator fine_cell = @@ -2206,8 +2213,9 @@ namespace FETools Triangulation tr; GridGenerator::hyper_cube(tr, 0, 1); - FEValues coarse( - fe, q_fine, update_JxW_values | update_values); + FEValues coarse(fe, + q_fine, + update_JxW_values | update_values); typename Triangulation::cell_iterator coarse_cell = tr.begin(0); @@ -2581,10 +2589,10 @@ namespace FETools // find sub-quadrature position = name.find('('); const std::string subquadrature_name(name, 0, position); - AssertThrow( - subquadrature_name.compare("QTrapez") == 0, - ExcNotImplemented("Could not detect quadrature of name " + - subquadrature_name)); + AssertThrow(subquadrature_name.compare("QTrapez") == 0, + ExcNotImplemented( + "Could not detect quadrature of name " + + subquadrature_name)); // delete "QTrapez()," name.erase(0, position + 3); const std::pair tmp = @@ -2717,9 +2725,9 @@ namespace FETools } catch (const std::string &errline) { - AssertThrow( - false, - ExcInvalidFEName(parameter_name + std::string(" at ") + errline)); + AssertThrow(false, + ExcInvalidFEName(parameter_name + std::string(" at ") + + errline)); return nullptr; } } @@ -3043,17 +3051,19 @@ namespace FETools double_support_point_values_imag.get()[i].reinit( finite_element.n_components(), false); - std::transform( - std::begin(support_point_values[i]), - std::end(support_point_values[i]), - std::begin(double_support_point_values_real.get()[i]), - [](std::complex c) -> double { return c.real(); }); - - std::transform( - std::begin(support_point_values[i]), - std::end(support_point_values[i]), - std::begin(double_support_point_values_imag.get()[i]), - [](std::complex c) -> double { return c.imag(); }); + std::transform(std::begin(support_point_values[i]), + std::end(support_point_values[i]), + std::begin(double_support_point_values_real.get()[i]), + [](std::complex c) -> double { + return c.real(); + }); + + std::transform(std::begin(support_point_values[i]), + std::end(support_point_values[i]), + std::begin(double_support_point_values_imag.get()[i]), + [](std::complex c) -> double { + return c.imag(); + }); } finite_element.convert_generalized_support_point_values_to_dof_values( @@ -3096,8 +3106,9 @@ namespace FETools finite_element.get_generalized_support_points().size()); AssertDimension(dof_values.size(), finite_element.dofs_per_cell); - convert_helper( - finite_element, support_point_values, dof_values); + convert_helper(finite_element, + support_point_values, + dof_values); } diff --git a/include/deal.II/fe/fe_tools_extrapolate.templates.h b/include/deal.II/fe/fe_tools_extrapolate.templates.h index 2db38ad463..0d8029407c 100644 --- a/include/deal.II/fe/fe_tools_extrapolate.templates.h +++ b/include/deal.II/fe/fe_tools_extrapolate.templates.h @@ -102,12 +102,12 @@ namespace FETools & tree_index_, const typename DoFHandler::cell_iterator &dealii_cell_, const typename dealii::internal::p4est::types::quadrant - &p4est_cell_) : - forest(forest_), - tree(tree_), - tree_index(tree_index_), - dealii_cell(dealii_cell_), - p4est_cell(p4est_cell_) + &p4est_cell_) + : forest(forest_) + , tree(tree_) + , tree_index(tree_index_) + , dealii_cell(dealii_cell_) + , p4est_cell(p4est_cell_) {} }; @@ -468,25 +468,25 @@ namespace FETools template ExtrapolateImplementation:: - ExtrapolateImplementation() : - round(0) + ExtrapolateImplementation() + : round(0) {} template - ExtrapolateImplementation::CellData::CellData() : - tree_index(0), - receiver(0) + ExtrapolateImplementation::CellData::CellData() + : tree_index(0) + , receiver(0) {} template ExtrapolateImplementation::CellData::CellData( - const unsigned int dofs_per_cell) : - tree_index(0), - receiver(0) + const unsigned int dofs_per_cell) + : tree_index(0) + , receiver(0) { dof_values.reinit(dofs_per_cell); } @@ -564,8 +564,10 @@ namespace FETools // needs should come up Assert(new_needs.size() == 0, ExcInternalError()); - set_dof_values_by_interpolation( - dealii_cell, p4est_cell, interpolated_values, u2); + set_dof_values_by_interpolation(dealii_cell, + p4est_cell, + interpolated_values, + u2); } } @@ -606,9 +608,9 @@ namespace FETools dealii_cell->get_dof_handler().get_fe(); const unsigned int dofs_per_cell = fe.dofs_per_cell; - Assert( - interpolated_values.size() == dofs_per_cell, - ExcDimensionMismatch(interpolated_values.size(), dofs_per_cell)); + Assert(interpolated_values.size() == dofs_per_cell, + ExcDimensionMismatch(interpolated_values.size(), + dofs_per_cell)); Assert(u.size() == dealii_cell->get_dof_handler().n_dofs(), ExcDimensionMismatch(u.size(), dealii_cell->get_dof_handler().n_dofs())); @@ -770,8 +772,10 @@ namespace FETools fe.get_prolongation_matrix(c, dealii_cell->refinement_case()) .vmult(tmp, local_values); - set_dof_values_by_interpolation( - dealii_cell->child(c), p4est_child[c], tmp, u); + set_dof_values_by_interpolation(dealii_cell->child(c), + p4est_child[c], + tmp, + u); } } } @@ -1317,8 +1321,9 @@ namespace FETools compute_cells(dof2, u, cells_to_compute, computed_cells, new_needs); // if there are no cells to compute and no new needs, stop - ready = Utilities::MPI::sum( - new_needs.size() + cells_to_compute.size(), communicator); + ready = + Utilities::MPI::sum(new_needs.size() + cells_to_compute.size(), + communicator); for (typename std::vector::const_iterator comp = computed_cells.begin(); diff --git a/include/deal.II/fe/fe_tools_interpolate.templates.h b/include/deal.II/fe/fe_tools_interpolate.templates.h index 5b0428e490..c59a2d371a 100644 --- a/include/deal.II/fe/fe_tools_interpolate.templates.h +++ b/include/deal.II/fe/fe_tools_interpolate.templates.h @@ -197,8 +197,9 @@ namespace FETools std_cxx14::make_unique>(dofs_per_cell2, dofs_per_cell1); - get_interpolation_matrix( - cell1->get_fe(), cell2->get_fe(), *interpolation_matrix); + get_interpolation_matrix(cell1->get_fe(), + cell2->get_fe(), + *interpolation_matrix); interpolation_matrices[&cell1->get_fe()][&cell2->get_fe()] = std::move(interpolation_matrix); @@ -217,8 +218,9 @@ namespace FETools const types::global_dof_index gdi = dofs[i]; if (u2_elements.is_element(gdi)) { - ::dealii::internal::ElementAccess::add( - u2_local(i), dofs[i], u2); + ::dealii::internal::ElementAccess::add(u2_local(i), + dofs[i], + u2); ::dealii::internal::ElementAccess::add( 1, dofs[i], touch_count); } @@ -279,9 +281,9 @@ namespace FETools const FiniteElement & fe2, OutVector & u1_interpolated) { - Assert( - dof1.get_fe(0).n_components() == fe2.n_components(), - ExcDimensionMismatch(dof1.get_fe(0).n_components(), fe2.n_components())); + Assert(dof1.get_fe(0).n_components() == fe2.n_components(), + ExcDimensionMismatch(dof1.get_fe(0).n_components(), + fe2.n_components())); Assert(u1.size() == dof1.n_dofs(), ExcDimensionMismatch(u1.size(), dof1.n_dofs())); Assert(u1_interpolated.size() == dof1.n_dofs(), @@ -521,9 +523,9 @@ namespace FETools const FiniteElement &fe2, OutVector & u1_difference) { - Assert( - dof1.get_fe(0).n_components() == fe2.n_components(), - ExcDimensionMismatch(dof1.get_fe(0).n_components(), fe2.n_components())); + Assert(dof1.get_fe(0).n_components() == fe2.n_components(), + ExcDimensionMismatch(dof1.get_fe(0).n_components(), + fe2.n_components())); Assert(u1.size() == dof1.n_dofs(), ExcDimensionMismatch(u1.size(), dof1.n_dofs())); Assert(u1_difference.size() == dof1.n_dofs(), @@ -712,8 +714,9 @@ namespace FETools cell2->get_dof_indices(dofs); for (unsigned int i = 0; i < n2; ++i) { - ::dealii::internal::ElementAccess::add( - u2_local(i), dofs[i], u2); + ::dealii::internal::ElementAccess::add(u2_local(i), + dofs[i], + u2); } ++cell1; diff --git a/include/deal.II/fe/fe_values.h b/include/deal.II/fe/fe_values.h index 299f03e2ca..6ed5c4a936 100644 --- a/include/deal.II/fe/fe_values.h +++ b/include/deal.II/fe/fe_values.h @@ -4772,9 +4772,10 @@ template inline const FEValuesViews::Scalar &FEValuesBase:: operator[](const FEValuesExtractors::Scalar &scalar) const { - Assert( - scalar.component < fe_values_views_cache.scalars.size(), - ExcIndexRange(scalar.component, 0, fe_values_views_cache.scalars.size())); + Assert(scalar.component < fe_values_views_cache.scalars.size(), + ExcIndexRange(scalar.component, + 0, + fe_values_views_cache.scalars.size())); return fe_values_views_cache.scalars[scalar.component]; } diff --git a/include/deal.II/fe/fe_values_extractors.h b/include/deal.II/fe/fe_values_extractors.h index cea48293be..0807c9feed 100644 --- a/include/deal.II/fe/fe_values_extractors.h +++ b/include/deal.II/fe/fe_values_extractors.h @@ -215,48 +215,50 @@ namespace FEValuesExtractors namespace FEValuesExtractors { - inline Scalar::Scalar() : component(numbers::invalid_unsigned_int) + inline Scalar::Scalar() + : component(numbers::invalid_unsigned_int) {} - inline Scalar::Scalar(const unsigned int component) : component(component) + inline Scalar::Scalar(const unsigned int component) + : component(component) {} - inline Vector::Vector() : - first_vector_component(numbers::invalid_unsigned_int) + inline Vector::Vector() + : first_vector_component(numbers::invalid_unsigned_int) {} - inline Vector::Vector(const unsigned int first_vector_component) : - first_vector_component(first_vector_component) + inline Vector::Vector(const unsigned int first_vector_component) + : first_vector_component(first_vector_component) {} template - inline SymmetricTensor::SymmetricTensor() : - first_tensor_component(numbers::invalid_unsigned_int) + inline SymmetricTensor::SymmetricTensor() + : first_tensor_component(numbers::invalid_unsigned_int) {} template inline SymmetricTensor::SymmetricTensor( - const unsigned int first_tensor_component) : - first_tensor_component(first_tensor_component) + const unsigned int first_tensor_component) + : first_tensor_component(first_tensor_component) {} template - inline Tensor::Tensor() : - first_tensor_component(numbers::invalid_unsigned_int) + inline Tensor::Tensor() + : first_tensor_component(numbers::invalid_unsigned_int) {} template - inline Tensor::Tensor(const unsigned int first_tensor_component) : - first_tensor_component(first_tensor_component) + inline Tensor::Tensor(const unsigned int first_tensor_component) + : first_tensor_component(first_tensor_component) {} } // namespace FEValuesExtractors diff --git a/include/deal.II/fe/mapping_q_generic.h b/include/deal.II/fe/mapping_q_generic.h index d783940541..f8c34f83a7 100644 --- a/include/deal.II/fe/mapping_q_generic.h +++ b/include/deal.II/fe/mapping_q_generic.h @@ -752,8 +752,9 @@ MappingQGeneric::InternalData::shape( const unsigned int shape_nr) const { Assert(qpoint * n_shape_functions + shape_nr < shape_values.size(), - ExcIndexRange( - qpoint * n_shape_functions + shape_nr, 0, shape_values.size())); + ExcIndexRange(qpoint * n_shape_functions + shape_nr, + 0, + shape_values.size())); return shape_values[qpoint * n_shape_functions + shape_nr]; } @@ -765,8 +766,9 @@ MappingQGeneric::InternalData::shape(const unsigned int qpoint, const unsigned int shape_nr) { Assert(qpoint * n_shape_functions + shape_nr < shape_values.size(), - ExcIndexRange( - qpoint * n_shape_functions + shape_nr, 0, shape_values.size())); + ExcIndexRange(qpoint * n_shape_functions + shape_nr, + 0, + shape_values.size())); return shape_values[qpoint * n_shape_functions + shape_nr]; } @@ -778,8 +780,9 @@ MappingQGeneric::InternalData::derivative( const unsigned int shape_nr) const { Assert(qpoint * n_shape_functions + shape_nr < shape_derivatives.size(), - ExcIndexRange( - qpoint * n_shape_functions + shape_nr, 0, shape_derivatives.size())); + ExcIndexRange(qpoint * n_shape_functions + shape_nr, + 0, + shape_derivatives.size())); return shape_derivatives[qpoint * n_shape_functions + shape_nr]; } @@ -792,8 +795,9 @@ MappingQGeneric::InternalData::derivative( const unsigned int shape_nr) { Assert(qpoint * n_shape_functions + shape_nr < shape_derivatives.size(), - ExcIndexRange( - qpoint * n_shape_functions + shape_nr, 0, shape_derivatives.size())); + ExcIndexRange(qpoint * n_shape_functions + shape_nr, + 0, + shape_derivatives.size())); return shape_derivatives[qpoint * n_shape_functions + shape_nr]; } diff --git a/include/deal.II/grid/composition_manifold.h b/include/deal.II/grid/composition_manifold.h index 70b9ef72c8..abfe350202 100644 --- a/include/deal.II/grid/composition_manifold.h +++ b/include/deal.II/grid/composition_manifold.h @@ -139,12 +139,11 @@ template CompositionManifold:: - CompositionManifold( - const ChartManifold &F, - const ChartManifold &G) : - ChartManifold(F.get_periodicity()), - F(&F), - G(&G) + CompositionManifold(const ChartManifold &F, + const ChartManifold &G) + : ChartManifold(F.get_periodicity()) + , F(&F) + , G(&G) { // We don't know what to do with a periodicity in the second manifold, so // throw an assertion if the second manifold is periodic diff --git a/include/deal.II/grid/filtered_iterator.h b/include/deal.II/grid/filtered_iterator.h index d5a40bfac9..b9119a24b9 100644 --- a/include/deal.II/grid/filtered_iterator.h +++ b/include/deal.II/grid/filtered_iterator.h @@ -925,19 +925,18 @@ filter_iterators(IteratorRange i, template template -inline FilteredIterator::FilteredIterator(Predicate p) : - predicate(new PredicateTemplate(p)) +inline FilteredIterator::FilteredIterator(Predicate p) + : predicate(new PredicateTemplate(p)) {} template template -inline FilteredIterator::FilteredIterator( - Predicate p, - const BaseIterator &bi) : - BaseIterator(bi), - predicate(new PredicateTemplate(p)) +inline FilteredIterator::FilteredIterator(Predicate p, + const BaseIterator &bi) + : BaseIterator(bi) + , predicate(new PredicateTemplate(p)) { if ((this->state() == IteratorState::valid) && !(*predicate)(*this)) set_to_next_positive(bi); @@ -947,13 +946,13 @@ inline FilteredIterator::FilteredIterator( template inline FilteredIterator::FilteredIterator( - const FilteredIterator &fi) : - // this construction looks strange, but without going through the - // address of fi, GCC would not cast fi to the base class of type - // BaseIterator but tries to go through constructing a new - // BaseIterator with an Accessor. - BaseIterator(*(BaseIterator *)(&fi)), - predicate(fi.predicate->clone()) + const FilteredIterator &fi) + : // this construction looks strange, but without going through the + // address of fi, GCC would not cast fi to the base class of type + // BaseIterator but tries to go through constructing a new + // BaseIterator with an Accessor. + BaseIterator(*(BaseIterator *)(&fi)) + , predicate(fi.predicate->clone()) {} @@ -1134,8 +1133,8 @@ FilteredIterator::operator--(int) template template inline FilteredIterator::PredicateTemplate< - Predicate>::PredicateTemplate(const Predicate &predicate) : - predicate(predicate) + Predicate>::PredicateTemplate(const Predicate &predicate) + : predicate(predicate) {} @@ -1194,7 +1193,8 @@ namespace IteratorFilters // ---------------- IteratorFilters::LevelEqualTo --------- - inline LevelEqualTo::LevelEqualTo(const unsigned int level) : level(level) + inline LevelEqualTo::LevelEqualTo(const unsigned int level) + : level(level) {} @@ -1210,8 +1210,8 @@ namespace IteratorFilters // ---------------- IteratorFilters::SubdomainEqualTo --------- inline SubdomainEqualTo::SubdomainEqualTo( - const types::subdomain_id subdomain_id) : - subdomain_id(subdomain_id) + const types::subdomain_id subdomain_id) + : subdomain_id(subdomain_id) {} @@ -1249,18 +1249,18 @@ namespace IteratorFilters // ---------------- IteratorFilters::MaterialIdEqualTo --------- inline MaterialIdEqualTo::MaterialIdEqualTo( const types::material_id material_id, - const bool only_locally_owned) : - material_ids{material_id}, - only_locally_owned(only_locally_owned) + const bool only_locally_owned) + : material_ids{material_id} + , only_locally_owned(only_locally_owned) {} inline MaterialIdEqualTo::MaterialIdEqualTo( const std::set &material_ids, - const bool only_locally_owned) : - material_ids(material_ids), - only_locally_owned(only_locally_owned) + const bool only_locally_owned) + : material_ids(material_ids) + , only_locally_owned(only_locally_owned) {} @@ -1280,18 +1280,18 @@ namespace IteratorFilters // ---------------- IteratorFilters::ActiveFEIndexEqualTo --------- inline ActiveFEIndexEqualTo::ActiveFEIndexEqualTo( const unsigned int active_fe_index, - const bool only_locally_owned) : - active_fe_indices{active_fe_index}, - only_locally_owned(only_locally_owned) + const bool only_locally_owned) + : active_fe_indices{active_fe_index} + , only_locally_owned(only_locally_owned) {} inline ActiveFEIndexEqualTo::ActiveFEIndexEqualTo( const std::set &active_fe_indices, - const bool only_locally_owned) : - active_fe_indices(active_fe_indices), - only_locally_owned(only_locally_owned) + const bool only_locally_owned) + : active_fe_indices(active_fe_indices) + , only_locally_owned(only_locally_owned) {} diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index 21e4df56ee..9d2acdf4de 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -2870,8 +2870,9 @@ namespace GridTools { const std::vector children = get_active_child_cells(cell->child(child)); - child_cells.insert( - child_cells.end(), children.begin(), children.end()); + child_cells.insert(child_cells.end(), + children.begin(), + children.end()); } else child_cells.push_back(cell->child(child)); @@ -2962,9 +2963,9 @@ namespace GridTools }; inline CrossDerivative::CrossDerivative(const unsigned int d0, - const unsigned int d1) : - direction_0(d0), - direction_1(d1) + const unsigned int d1) + : direction_0(d0) + , direction_1(d1) {} @@ -3050,10 +3051,10 @@ namespace GridTools ExcMessage("This function assumes that the last weight is a " "dependent variable (and hence we cannot take its " "derivative directly).")); - Assert( - row_n != dependent_direction, - ExcMessage("We cannot differentiate with respect to the variable " - "that is assumed to be dependent.")); + Assert(row_n != dependent_direction, + ExcMessage( + "We cannot differentiate with respect to the variable " + "that is assumed to be dependent.")); const Point manifold_point = f(center); const Tensor<1, spacedim> stencil_value = cross_stencil( @@ -3122,9 +3123,10 @@ namespace GridTools for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) - F_k += (x_k - trial_point) * object->vertex(i) * - GeometryInfo::d_linear_shape_function_gradient( - xi, i); + F_k += + (x_k - trial_point) * object->vertex(i) * + GeometryInfo::d_linear_shape_function_gradient(xi, + i); Tensor<2, structdim> H_k; for (unsigned int i = 0; @@ -3540,9 +3542,9 @@ namespace GridTools (void)mesh; (void)pack; (void)unpack; - Assert( - false, - ExcMessage("GridTools::exchange_cell_data_to_ghosts() requires MPI.")); + Assert(false, + ExcMessage( + "GridTools::exchange_cell_data_to_ghosts() requires MPI.")); # else constexpr int dim = MeshType::dimension; constexpr int spacedim = MeshType::space_dimension; @@ -3589,8 +3591,10 @@ namespace GridTools if (send_to.size() > 0) { // this cell's data needs to be sent to someone - typename MeshType::active_cell_iterator mesh_it( - tria, cell->level(), cell->index(), &mesh); + typename MeshType::active_cell_iterator mesh_it(tria, + cell->level(), + cell->index(), + &mesh); const boost::optional data = pack(mesh_it); diff --git a/include/deal.II/grid/tensor_product_manifold.h b/include/deal.II/grid/tensor_product_manifold.h index 8b0bb6799f..d0b4e7bc31 100644 --- a/include/deal.II/grid/tensor_product_manifold.h +++ b/include/deal.II/grid/tensor_product_manifold.h @@ -200,13 +200,13 @@ TensorProductManifold:: TensorProductManifold( const ChartManifold &manifold_A, - const ChartManifold &manifold_B) : - ChartManifold( - internal::TensorProductManifoldImplementation::concat( - manifold_A.get_periodicity(), - manifold_B.get_periodicity())), - manifold_A(&manifold_A), - manifold_B(&manifold_B) + const ChartManifold &manifold_B) + : ChartManifold( + internal::TensorProductManifoldImplementation::concat( + manifold_A.get_periodicity(), + manifold_B.get_periodicity())) + , manifold_A(&manifold_A) + , manifold_B(&manifold_B) {} template space_point_A; Point space_point_B; - internal::TensorProductManifoldImplementation::split_point( - space_point, space_point_A, space_point_B); + internal::TensorProductManifoldImplementation::split_point(space_point, + space_point_A, + space_point_B); Point result_A = manifold_A->pull_back(space_point_A); Point result_B = manifold_B->pull_back(space_point_B); @@ -309,8 +310,9 @@ TensorProductManifold chart_point_A; Point chart_point_B; - internal::TensorProductManifoldImplementation::split_point( - chart_point, chart_point_A, chart_point_B); + internal::TensorProductManifoldImplementation::split_point(chart_point, + chart_point_A, + chart_point_B); Point result_A = manifold_A->push_forward(chart_point_A); Point result_B = manifold_B->push_forward(chart_point_B); @@ -360,8 +362,9 @@ TensorProductManifold chart_point_A; Point chart_point_B; - internal::TensorProductManifoldImplementation::split_point( - chart_point, chart_point_A, chart_point_B); + internal::TensorProductManifoldImplementation::split_point(chart_point, + chart_point_A, + chart_point_B); DerivativeForm<1, chartdim_A, spacedim_A> result_A = manifold_A->push_forward_gradient(chart_point_A); diff --git a/include/deal.II/grid/tria_accessor.templates.h b/include/deal.II/grid/tria_accessor.templates.h index 3dfd8b2524..768bae31e0 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -49,10 +49,10 @@ inline TriaAccessorBase::TriaAccessorBase( const Triangulation *tria, const int level, const int index, - const AccessorData *) : - present_level((structdim == dim) ? level : 0), - present_index(index), - tria(tria) + const AccessorData *) + : present_level((structdim == dim) ? level : 0) + , present_index(index) + , tria(tria) { // non-cells have no level, so a 0 // should have been passed, or a -1 @@ -69,10 +69,10 @@ inline TriaAccessorBase::TriaAccessorBase( template inline TriaAccessorBase::TriaAccessorBase( - const TriaAccessorBase &a) : - present_level(a.present_level), - present_index(a.present_index), - tria(a.tria) + const TriaAccessorBase &a) + : present_level(a.present_level) + , present_index(a.present_index) + , tria(a.tria) {} @@ -413,9 +413,9 @@ InvalidAccessor::InvalidAccessor( template InvalidAccessor::InvalidAccessor( - const InvalidAccessor &i) : - TriaAccessorBase( - static_cast &>(i)) + const InvalidAccessor &i) + : TriaAccessorBase( + static_cast &>(i)) { Assert(false, ExcMessage("You are attempting an illegal conversion between " @@ -701,9 +701,8 @@ namespace internal face_orientation(const TriaAccessor<3, dim, spacedim> &accessor, const unsigned int face) { - return ( - accessor.tria->levels[accessor.present_level]->cells.face_orientation( - accessor.present_index, face)); + return (accessor.tria->levels[accessor.present_level] + ->cells.face_orientation(accessor.present_index, face)); } @@ -1132,8 +1131,8 @@ inline TriaAccessor::TriaAccessor( const Triangulation *parent, const int level, const int index, - const AccessorData * local_data) : - TriaAccessorBase(parent, level, index, local_data) + const AccessorData * local_data) + : TriaAccessorBase(parent, level, index, local_data) {} @@ -1142,9 +1141,9 @@ template inline bool TriaAccessor::used() const { - Assert( - this->state() == IteratorState::valid, - TriaAccessorExceptions::ExcDereferenceInvalidObject(*this)); + Assert(this->state() == IteratorState::valid, + TriaAccessorExceptions::ExcDereferenceInvalidObject( + *this)); return this->objects().used[this->present_index]; } @@ -1155,8 +1154,9 @@ inline TriaIterator> TriaAccessor::vertex_iterator( const unsigned int i) const { - return TriaIterator>( - this->tria, 0, vertex_index(i)); + return TriaIterator>(this->tria, + 0, + vertex_index(i)); } @@ -1343,9 +1343,9 @@ template void TriaAccessor::set_used_flag() const { - Assert( - this->state() == IteratorState::valid, - TriaAccessorExceptions::ExcDereferenceInvalidObject(*this)); + Assert(this->state() == IteratorState::valid, + TriaAccessorExceptions::ExcDereferenceInvalidObject( + *this)); this->objects().used[this->present_index] = true; } @@ -1355,9 +1355,9 @@ template void TriaAccessor::clear_used_flag() const { - Assert( - this->state() == IteratorState::valid, - TriaAccessorExceptions::ExcDereferenceInvalidObject(*this)); + Assert(this->state() == IteratorState::valid, + TriaAccessorExceptions::ExcDereferenceInvalidObject( + *this)); this->objects().used[this->present_index] = false; } @@ -1430,9 +1430,9 @@ template RefinementCase TriaAccessor::refinement_case() const { - Assert( - this->state() == IteratorState::valid, - TriaAccessorExceptions::ExcDereferenceInvalidObject(*this)); + Assert(this->state() == IteratorState::valid, + TriaAccessorExceptions::ExcDereferenceInvalidObject( + *this)); switch (structdim) { @@ -1537,9 +1537,9 @@ template inline bool TriaAccessor::has_children() const { - Assert( - this->state() == IteratorState::valid, - TriaAccessorExceptions::ExcDereferenceInvalidObject(*this)); + Assert(this->state() == IteratorState::valid, + TriaAccessorExceptions::ExcDereferenceInvalidObject( + *this)); // each set of two children are stored // consecutively, so we only have to find @@ -1565,13 +1565,14 @@ inline void TriaAccessor::set_refinement_case( const RefinementCase &refinement_case) const { - Assert( - this->state() == IteratorState::valid, - TriaAccessorExceptions::ExcDereferenceInvalidObject(*this)); + Assert(this->state() == IteratorState::valid, + TriaAccessorExceptions::ExcDereferenceInvalidObject( + *this)); Assert(static_cast(this->present_index) < this->objects().refinement_cases.size(), - ExcIndexRange( - this->present_index, 0, this->objects().refinement_cases.size())); + ExcIndexRange(this->present_index, + 0, + this->objects().refinement_cases.size())); this->objects().refinement_cases[this->present_index] = refinement_case; } @@ -1581,13 +1582,14 @@ template inline void TriaAccessor::clear_refinement_case() const { - Assert( - this->state() == IteratorState::valid, - TriaAccessorExceptions::ExcDereferenceInvalidObject(*this)); + Assert(this->state() == IteratorState::valid, + TriaAccessorExceptions::ExcDereferenceInvalidObject( + *this)); Assert(static_cast(this->present_index) < this->objects().refinement_cases.size(), - ExcIndexRange( - this->present_index, 0, this->objects().refinement_cases.size())); + ExcIndexRange(this->present_index, + 0, + this->objects().refinement_cases.size())); this->objects().refinement_cases[this->present_index] = RefinementCase::no_refinement; @@ -2057,8 +2059,9 @@ TriaAccessor::enclosing_ball() const is_initial_guess_vertex; // First let all the vertices be outside - std::fill( - is_initial_guess_vertex.begin(), is_initial_guess_vertex.end(), false); + std::fill(is_initial_guess_vertex.begin(), + is_initial_guess_vertex.end(), + false); // Get an initial guess by looking at the largest diagonal Point center; @@ -2092,8 +2095,10 @@ TriaAccessor::enclosing_ball() const const Point p61(this->vertex(6) - this->vertex(1)); const Point p25(this->vertex(2) - this->vertex(5)); const Point p34(this->vertex(3) - this->vertex(4)); - const std::vector diagonals = { - p70.norm(), p61.norm(), p25.norm(), p34.norm()}; + const std::vector diagonals = {p70.norm(), + p61.norm(), + p25.norm(), + p34.norm()}; const std::vector::const_iterator it = std::max_element(diagonals.begin(), diagonals.end()); if (it == diagonals.begin()) @@ -2239,9 +2244,9 @@ TriaAccessor::is_translation_of( template inline TriaAccessor<0, dim, spacedim>::TriaAccessor( const Triangulation *tria, - const unsigned int vertex_index) : - tria(tria), - global_vertex_index(vertex_index) + const unsigned int vertex_index) + : tria(tria) + , global_vertex_index(vertex_index) {} @@ -2251,9 +2256,9 @@ inline TriaAccessor<0, dim, spacedim>::TriaAccessor( const Triangulation *tria, const int /*level*/, const int index, - const AccessorData *) : - tria(tria), - global_vertex_index(index) + const AccessorData *) + : tria(tria) + , global_vertex_index(index) {} @@ -2261,9 +2266,9 @@ inline TriaAccessor<0, dim, spacedim>::TriaAccessor( template template inline TriaAccessor<0, dim, spacedim>::TriaAccessor( - const TriaAccessor &) : - tria(nullptr), - global_vertex_index(numbers::invalid_unsigned_int) + const TriaAccessor &) + : tria(nullptr) + , global_vertex_index(numbers::invalid_unsigned_int) { Assert(false, ExcImpossibleInDim(0)); } @@ -2273,9 +2278,9 @@ inline TriaAccessor<0, dim, spacedim>::TriaAccessor( template template inline TriaAccessor<0, dim, spacedim>::TriaAccessor( - const InvalidAccessor &) : - tria(nullptr), - global_vertex_index(numbers::invalid_unsigned_int) + const InvalidAccessor &) + : tria(nullptr) + , global_vertex_index(numbers::invalid_unsigned_int) { Assert(false, ExcImpossibleInDim(0)); } @@ -2598,10 +2603,10 @@ template inline TriaAccessor<0, 1, spacedim>::TriaAccessor( const Triangulation<1, spacedim> *tria, const VertexKind vertex_kind, - const unsigned int vertex_index) : - tria(tria), - vertex_kind(vertex_kind), - global_vertex_index(vertex_index) + const unsigned int vertex_index) + : tria(tria) + , vertex_kind(vertex_kind) + , global_vertex_index(vertex_index) {} @@ -2611,10 +2616,10 @@ inline TriaAccessor<0, 1, spacedim>::TriaAccessor( const Triangulation<1, spacedim> *tria, const int level, const int index, - const AccessorData *) : - tria(tria), - vertex_kind(interior_vertex), - global_vertex_index(numbers::invalid_unsigned_int) + const AccessorData *) + : tria(tria) + , vertex_kind(interior_vertex) + , global_vertex_index(numbers::invalid_unsigned_int) { // in general, calling this constructor should yield an error -- users should // instead call the one immediately above. however, if you create something @@ -2633,10 +2638,10 @@ inline TriaAccessor<0, 1, spacedim>::TriaAccessor( template template inline TriaAccessor<0, 1, spacedim>::TriaAccessor( - const TriaAccessor &) : - tria(nullptr), - vertex_kind(interior_vertex), - global_vertex_index(numbers::invalid_unsigned_int) + const TriaAccessor &) + : tria(nullptr) + , vertex_kind(interior_vertex) + , global_vertex_index(numbers::invalid_unsigned_int) { Assert(false, ExcImpossibleInDim(0)); } @@ -2646,10 +2651,10 @@ inline TriaAccessor<0, 1, spacedim>::TriaAccessor( template template inline TriaAccessor<0, 1, spacedim>::TriaAccessor( - const InvalidAccessor &) : - tria(nullptr), - vertex_kind(interior_vertex), - global_vertex_index(numbers::invalid_unsigned_int) + const InvalidAccessor &) + : tria(nullptr) + , vertex_kind(interior_vertex) + , global_vertex_index(numbers::invalid_unsigned_int) { Assert(false, ExcImpossibleInDim(0)); } @@ -2824,10 +2829,10 @@ TriaAccessor<0, 1, spacedim>::boundary_id() const case left_vertex: case right_vertex: { - Assert( - tria->vertex_to_boundary_id_map_1d->find(this->vertex_index()) != - tria->vertex_to_boundary_id_map_1d->end(), - ExcInternalError()); + Assert(tria->vertex_to_boundary_id_map_1d->find( + this->vertex_index()) != + tria->vertex_to_boundary_id_map_1d->end(), + ExcInternalError()); return (*tria->vertex_to_boundary_id_map_1d)[this->vertex_index()]; } @@ -3026,17 +3031,17 @@ inline CellAccessor::CellAccessor( const Triangulation *parent, const int level, const int index, - const AccessorData * local_data) : - TriaAccessor(parent, level, index, local_data) + const AccessorData * local_data) + : TriaAccessor(parent, level, index, local_data) {} template inline CellAccessor::CellAccessor( - const TriaAccessor &cell_accessor) : - TriaAccessor( - static_cast &>(cell_accessor)) + const TriaAccessor &cell_accessor) + : TriaAccessor( + static_cast &>(cell_accessor)) {} @@ -3418,8 +3423,9 @@ template inline TriaIterator> CellAccessor::neighbor(const unsigned int i) const { - TriaIterator> q( - this->tria, neighbor_level(i), neighbor_index(i)); + TriaIterator> q(this->tria, + neighbor_level(i), + neighbor_index(i)); Assert((q.state() == IteratorState::past_the_end) || q->used(), ExcInternalError()); @@ -3433,8 +3439,9 @@ template inline TriaIterator> CellAccessor::child(const unsigned int i) const { - TriaIterator> q( - this->tria, this->present_level + 1, this->child_index(i)); + TriaIterator> q(this->tria, + this->present_level + 1, + this->child_index(i)); Assert((q.state() == IteratorState::past_the_end) || q->used(), ExcInternalError()); diff --git a/include/deal.II/grid/tria_iterator.h b/include/deal.II/grid/tria_iterator.h index e57ed72490..9b4bcf16b5 100644 --- a/include/deal.II/grid/tria_iterator.h +++ b/include/deal.II/grid/tria_iterator.h @@ -927,16 +927,16 @@ public: template -inline TriaRawIterator::TriaRawIterator(const Accessor &a) : - accessor(a) +inline TriaRawIterator::TriaRawIterator(const Accessor &a) + : accessor(a) {} template template -inline TriaRawIterator::TriaRawIterator(const OtherAccessor &a) : - accessor(a) +inline TriaRawIterator::TriaRawIterator(const OtherAccessor &a) + : accessor(a) {} @@ -944,8 +944,8 @@ inline TriaRawIterator::TriaRawIterator(const OtherAccessor &a) : template template inline TriaRawIterator::TriaRawIterator( - const TriaRawIterator &i) : - accessor(i.accessor) + const TriaRawIterator &i) + : accessor(i.accessor) {} @@ -953,8 +953,8 @@ inline TriaRawIterator::TriaRawIterator( template template inline TriaRawIterator::TriaRawIterator( - const TriaIterator &i) : - accessor(i.accessor) + const TriaIterator &i) + : accessor(i.accessor) {} @@ -962,8 +962,8 @@ inline TriaRawIterator::TriaRawIterator( template template inline TriaRawIterator::TriaRawIterator( - const TriaActiveIterator &i) : - accessor(i.accessor) + const TriaActiveIterator &i) + : accessor(i.accessor) {} @@ -1115,8 +1115,8 @@ TriaRawIterator::memory_consumption() const template template inline TriaIterator::TriaIterator( - const TriaIterator &i) : - TriaRawIterator(i.accessor) + const TriaIterator &i) + : TriaRawIterator(i.accessor) {} @@ -1124,8 +1124,8 @@ inline TriaIterator::TriaIterator( template template inline TriaIterator::TriaIterator( - const TriaActiveIterator &i) : - TriaRawIterator(i.accessor) + const TriaActiveIterator &i) + : TriaRawIterator(i.accessor) {} @@ -1133,8 +1133,8 @@ inline TriaIterator::TriaIterator( template template inline TriaIterator::TriaIterator( - const TriaRawIterator &i) : - TriaRawIterator(i.accessor) + const TriaRawIterator &i) + : TriaRawIterator(i.accessor) { # ifdef DEBUG // do this like this, because: @@ -1150,8 +1150,8 @@ inline TriaIterator::TriaIterator( template template -TriaIterator::TriaIterator(const OtherAccessor &a) : - TriaRawIterator(a) +TriaIterator::TriaIterator(const OtherAccessor &a) + : TriaRawIterator(a) { # ifdef DEBUG // do this like this, because: @@ -1168,8 +1168,8 @@ TriaIterator::TriaIterator(const OtherAccessor &a) : template template inline TriaActiveIterator::TriaActiveIterator( - const TriaActiveIterator &i) : - TriaIterator(i.accessor) + const TriaActiveIterator &i) + : TriaIterator(i.accessor) {} @@ -1177,8 +1177,8 @@ inline TriaActiveIterator::TriaActiveIterator( template template inline TriaActiveIterator::TriaActiveIterator( - const TriaRawIterator &i) : - TriaIterator(i) + const TriaRawIterator &i) + : TriaIterator(i) { # ifdef DEBUG // do this like this, because: diff --git a/include/deal.II/grid/tria_iterator.templates.h b/include/deal.II/grid/tria_iterator.templates.h index e915517cb4..dc5e4ff1e4 100644 --- a/include/deal.II/grid/tria_iterator.templates.h +++ b/include/deal.II/grid/tria_iterator.templates.h @@ -35,15 +35,15 @@ DEAL_II_NAMESPACE_OPEN template -inline TriaRawIterator::TriaRawIterator() : - accessor(nullptr, -2, -2, nullptr) +inline TriaRawIterator::TriaRawIterator() + : accessor(nullptr, -2, -2, nullptr) {} template inline TriaRawIterator::TriaRawIterator( - const TriaRawIterator &i) : - accessor(i.accessor) + const TriaRawIterator &i) + : accessor(i.accessor) {} @@ -53,8 +53,8 @@ inline TriaRawIterator::TriaRawIterator( const Triangulation *parent, const int level, const int index, - const typename Accessor::AccessorData *local_data) : - accessor(parent, level, index, local_data) + const typename Accessor::AccessorData *local_data) + : accessor(parent, level, index, local_data) {} @@ -63,8 +63,8 @@ inline TriaRawIterator::TriaRawIterator( const TriaAccessorBase &tria_accessor, - const typename Accessor::AccessorData * local_data) : - accessor(nullptr, -2, -2, local_data) + const typename Accessor::AccessorData * local_data) + : accessor(nullptr, -2, -2, local_data) { accessor.copy_from(tria_accessor); } @@ -125,20 +125,20 @@ TriaRawIterator::operator--(int) template -inline TriaIterator::TriaIterator() : TriaRawIterator() +inline TriaIterator::TriaIterator() + : TriaRawIterator() {} template -inline TriaIterator::TriaIterator(const TriaIterator &i) : - TriaRawIterator(i.accessor) +inline TriaIterator::TriaIterator(const TriaIterator &i) + : TriaRawIterator(i.accessor) {} template -inline TriaIterator::TriaIterator( - const TriaRawIterator &i) : - TriaRawIterator(i.accessor) +inline TriaIterator::TriaIterator(const TriaRawIterator &i) + : TriaRawIterator(i.accessor) { #ifdef DEBUG // do this like this, because: @@ -158,8 +158,8 @@ inline TriaIterator::TriaIterator( const Triangulation *parent, const int level, const int index, - const typename Accessor::AccessorData *local_data) : - TriaRawIterator(parent, level, index, local_data) + const typename Accessor::AccessorData *local_data) + : TriaRawIterator(parent, level, index, local_data) { #ifdef DEBUG // do this like this, because: @@ -179,8 +179,8 @@ inline TriaIterator::TriaIterator( const TriaAccessorBase &tria_accessor, - const typename Accessor::AccessorData * local_data) : - TriaRawIterator(tria_accessor, local_data) + const typename Accessor::AccessorData * local_data) + : TriaRawIterator(tria_accessor, local_data) { #ifdef DEBUG // do this like this, because: @@ -303,22 +303,22 @@ TriaIterator::operator--(int) template -inline TriaActiveIterator::TriaActiveIterator() : - TriaIterator() +inline TriaActiveIterator::TriaActiveIterator() + : TriaIterator() {} template inline TriaActiveIterator::TriaActiveIterator( - const TriaActiveIterator &i) : - TriaIterator(static_cast>(i)) + const TriaActiveIterator &i) + : TriaIterator(static_cast>(i)) {} template inline TriaActiveIterator::TriaActiveIterator( - const TriaRawIterator &i) : - TriaIterator(i) + const TriaRawIterator &i) + : TriaIterator(i) { #ifdef DEBUG // do this like this, because: @@ -336,8 +336,8 @@ inline TriaActiveIterator::TriaActiveIterator( template inline TriaActiveIterator::TriaActiveIterator( - const TriaIterator &i) : - TriaIterator(i) + const TriaIterator &i) + : TriaIterator(i) { #ifdef DEBUG // do this like this, because: @@ -358,8 +358,8 @@ inline TriaActiveIterator::TriaActiveIterator( const Triangulation *parent, const int level, const int index, - const typename Accessor::AccessorData *local_data) : - TriaIterator(parent, level, index, local_data) + const typename Accessor::AccessorData *local_data) + : TriaIterator(parent, level, index, local_data) { #ifdef DEBUG // do this like this, because: @@ -380,8 +380,8 @@ inline TriaActiveIterator::TriaActiveIterator( const TriaAccessorBase &tria_accessor, - const typename Accessor::AccessorData * local_data) : - TriaIterator(tria_accessor, local_data) + const typename Accessor::AccessorData * local_data) + : TriaIterator(tria_accessor, local_data) { #ifdef DEBUG // do this like this, because: diff --git a/include/deal.II/grid/tria_objects.h b/include/deal.II/grid/tria_objects.h index e8e0d4fe4f..f9d003291e 100644 --- a/include/deal.II/grid/tria_objects.h +++ b/include/deal.II/grid/tria_objects.h @@ -673,11 +673,11 @@ namespace internal template - inline TriaObjects::TriaObjects() : - next_free_single(numbers::invalid_unsigned_int), - next_free_pair(numbers::invalid_unsigned_int), - reverse_order_next_free_single(false), - user_data_type(data_unknown) + inline TriaObjects::TriaObjects() + : next_free_single(numbers::invalid_unsigned_int) + , next_free_pair(numbers::invalid_unsigned_int) + , reverse_order_next_free_single(false) + , user_data_type(data_unknown) {} @@ -765,10 +765,11 @@ namespace internal TriaObjectsHex::face_orientation(const unsigned int cell, const unsigned int face) const { - Assert( - cell < face_orientations.size() / GeometryInfo<3>::faces_per_cell, - ExcIndexRange( - 0, cell, face_orientations.size() / GeometryInfo<3>::faces_per_cell)); + Assert(cell < face_orientations.size() / GeometryInfo<3>::faces_per_cell, + ExcIndexRange(0, + cell, + face_orientations.size() / + GeometryInfo<3>::faces_per_cell)); Assert(face < GeometryInfo<3>::faces_per_cell, ExcIndexRange(0, face, GeometryInfo<3>::faces_per_cell)); diff --git a/include/deal.II/hp/dof_faces.h b/include/deal.II/hp/dof_faces.h index 59667492e1..5a480677d5 100644 --- a/include/deal.II/hp/dof_faces.h +++ b/include/deal.II/hp/dof_faces.h @@ -368,20 +368,20 @@ namespace internal const unsigned int local_index, const unsigned int /*obj_level*/) const { - Assert( - (fe_index != dealii::hp::DoFHandler::default_fe_index), - ExcMessage("You need to specify a FE index when working " - "with hp DoFHandlers")); - Assert( - fe_index < dof_handler.get_fe_collection().size(), - ExcIndexRange(fe_index, 0, dof_handler.get_fe_collection().size())); - Assert( - local_index < - dof_handler.get_fe(fe_index).template n_dofs_per_object(), - ExcIndexRange(local_index, - 0, - dof_handler.get_fe(fe_index) - .template n_dofs_per_object())); + Assert((fe_index != + dealii::hp::DoFHandler::default_fe_index), + ExcMessage("You need to specify a FE index when working " + "with hp DoFHandlers")); + Assert(fe_index < dof_handler.get_fe_collection().size(), + ExcIndexRange(fe_index, + 0, + dof_handler.get_fe_collection().size())); + Assert(local_index < dof_handler.get_fe(fe_index) + .template n_dofs_per_object(), + ExcIndexRange(local_index, + 0, + dof_handler.get_fe(fe_index) + .template n_dofs_per_object())); Assert(obj_index < dof_offsets.size(), ExcIndexRange(obj_index, 0, dof_offsets.size())); @@ -429,20 +429,20 @@ namespace internal const types::global_dof_index global_index, const unsigned int /*obj_level*/) { - Assert( - (fe_index != dealii::hp::DoFHandler::default_fe_index), - ExcMessage("You need to specify a FE index when working " - "with hp DoFHandlers")); - Assert( - fe_index < dof_handler.get_fe_collection().size(), - ExcIndexRange(fe_index, 0, dof_handler.get_fe_collection().size())); - Assert( - local_index < - dof_handler.get_fe(fe_index).template n_dofs_per_object(), - ExcIndexRange(local_index, - 0, - dof_handler.get_fe(fe_index) - .template n_dofs_per_object())); + Assert((fe_index != + dealii::hp::DoFHandler::default_fe_index), + ExcMessage("You need to specify a FE index when working " + "with hp DoFHandlers")); + Assert(fe_index < dof_handler.get_fe_collection().size(), + ExcIndexRange(fe_index, + 0, + dof_handler.get_fe_collection().size())); + Assert(local_index < dof_handler.get_fe(fe_index) + .template n_dofs_per_object(), + ExcIndexRange(local_index, + 0, + dof_handler.get_fe(fe_index) + .template n_dofs_per_object())); Assert(obj_index < dof_offsets.size(), ExcIndexRange(obj_index, 0, dof_offsets.size())); @@ -590,15 +590,17 @@ namespace internal const unsigned int /*obj_level*/) const { Assert(obj_index < dof_offsets.size(), - ExcIndexRange( - obj_index, 0, static_cast(dof_offsets.size()))); - Assert( - (fe_index != dealii::hp::DoFHandler::default_fe_index), - ExcMessage("You need to specify a FE index when working " - "with hp DoFHandlers")); - Assert( - fe_index < dof_handler.get_fe_collection().size(), - ExcIndexRange(fe_index, 0, dof_handler.get_fe_collection().size())); + ExcIndexRange(obj_index, + 0, + static_cast(dof_offsets.size()))); + Assert((fe_index != + dealii::hp::DoFHandler::default_fe_index), + ExcMessage("You need to specify a FE index when working " + "with hp DoFHandlers")); + Assert(fe_index < dof_handler.get_fe_collection().size(), + ExcIndexRange(fe_index, + 0, + dof_handler.get_fe_collection().size())); // make sure we are on an // object for which DoFs have diff --git a/include/deal.II/hp/dof_handler.h b/include/deal.II/hp/dof_handler.h index 21a10d06a7..1da049a872 100644 --- a/include/deal.II/hp/dof_handler.h +++ b/include/deal.II/hp/dof_handler.h @@ -1180,13 +1180,13 @@ namespace hp ExcMessage( "The object being loaded into does not match the triangulation " "that has been stored previously.")); - AssertThrow( - policy_name == dealii::internal::policy_to_string(*policy), - ExcMessage("The policy currently associated with this DoFHandler (" + - dealii::internal::policy_to_string(*policy) + - ") does not match the one that was associated with the " - "DoFHandler previously stored (" + - policy_name + ").")); + AssertThrow(policy_name == dealii::internal::policy_to_string(*policy), + ExcMessage( + "The policy currently associated with this DoFHandler (" + + dealii::internal::policy_to_string(*policy) + + ") does not match the one that was associated with the " + "DoFHandler previously stored (" + + policy_name + ").")); } template diff --git a/include/deal.II/hp/dof_level.h b/include/deal.II/hp/dof_level.h index 31eb0f2526..858c88fb13 100644 --- a/include/deal.II/hp/dof_level.h +++ b/include/deal.II/hp/dof_level.h @@ -450,11 +450,11 @@ namespace internal // the index is so large that we cannot accept it. (but this // will not likely happen because it requires someone using an // FECollection that has more than 32k entries.) - Assert( - is_compressed_entry(fe_index) == false, - ExcMessage("You are using an active_fe_index that is larger than an " - "internal limitation for these objects. Try to work with " - "hp::FECollection objects that have a more modest size.")); + Assert(is_compressed_entry(fe_index) == false, + ExcMessage( + "You are using an active_fe_index that is larger than an " + "internal limitation for these objects. Try to work with " + "hp::FECollection objects that have a more modest size.")); active_fe_indices[obj_index] = fe_index; } diff --git a/include/deal.II/lac/affine_constraints.h b/include/deal.II/lac/affine_constraints.h index f1598df83d..6b10a5fee8 100644 --- a/include/deal.II/lac/affine_constraints.h +++ b/include/deal.II/lac/affine_constraints.h @@ -1572,10 +1572,10 @@ private: template inline AffineConstraints::AffineConstraints( - const IndexSet &local_constraints) : - lines(), - local_lines(local_constraints), - sorted(false) + const IndexSet &local_constraints) + : lines() + , local_lines(local_constraints) + , sorted(false) { // make sure the IndexSet is compressed. Otherwise this can lead to crashes // that are hard to find (only happen in release mode). @@ -1585,12 +1585,12 @@ inline AffineConstraints::AffineConstraints( template inline AffineConstraints::AffineConstraints( - const AffineConstraints &affine_constraints) : - Subscriptor(), - lines(affine_constraints.lines), - lines_cache(affine_constraints.lines_cache), - local_lines(affine_constraints.local_lines), - sorted(affine_constraints.sorted) + const AffineConstraints &affine_constraints) + : Subscriptor() + , lines(affine_constraints.lines) + , lines_cache(affine_constraints.lines_cache) + , local_lines(affine_constraints.local_lines) + , sorted(affine_constraints.sorted) {} template @@ -1612,9 +1612,9 @@ AffineConstraints::add_line(const size_type line) // if necessary enlarge vector of existing entries for cache if (line_index >= lines_cache.size()) - lines_cache.resize( - std::max(2 * static_cast(lines_cache.size()), line_index + 1), - numbers::invalid_size_type); + lines_cache.resize(std::max(2 * static_cast(lines_cache.size()), + line_index + 1), + numbers::invalid_size_type); // push a new line to the end of the list lines.emplace_back(); @@ -1803,8 +1803,9 @@ AffineConstraints::distribute_local_to_global( ++local_vector_begin, ++local_indices_begin) { if (is_constrained(*local_indices_begin) == false) - internal::ElementAccess::add( - *local_vector_begin, *local_indices_begin, global_vector); + internal::ElementAccess::add(*local_vector_begin, + *local_indices_begin, + global_vector); else { const ConstraintLine &position = diff --git a/include/deal.II/lac/affine_constraints.templates.h b/include/deal.II/lac/affine_constraints.templates.h index 817d3504f9..d38c490589 100644 --- a/include/deal.II/lac/affine_constraints.templates.h +++ b/include/deal.II/lac/affine_constraints.templates.h @@ -278,10 +278,11 @@ AffineConstraints::add_entries( if (p->first == col_val_pair->first) { // entry exists, break innermost loop - Assert( - p->second == col_val_pair->second, - ExcEntryAlreadyExists( - line, col_val_pair->first, p->second, col_val_pair->second)); + Assert(p->second == col_val_pair->second, + ExcEntryAlreadyExists(line, + col_val_pair->first, + p->second, + col_val_pair->second)); break; } @@ -638,10 +639,11 @@ AffineConstraints::merge( const bool allow_different_local_lines) { (void)allow_different_local_lines; - Assert( - allow_different_local_lines || local_lines == other_constraints.local_lines, - ExcMessage("local_lines for this and the other objects are not the same " - "although allow_different_local_lines is false.")); + Assert(allow_different_local_lines || + local_lines == other_constraints.local_lines, + ExcMessage( + "local_lines for this and the other objects are not the same " + "although allow_different_local_lines is false.")); // store the previous state with respect to sorting const bool object_was_sorted = sorted; @@ -708,8 +710,9 @@ AffineConstraints::merge( { // do not bother to resize the lines cache exactly since it is pretty // cheap to adjust it along the way. - std::fill( - lines_cache.begin(), lines_cache.end(), numbers::invalid_size_type); + std::fill(lines_cache.begin(), + lines_cache.end(), + numbers::invalid_size_type); // reset lines_cache for our own constraints size_type index = 0; @@ -1645,8 +1648,9 @@ AffineConstraints::condense(SparseMatrix &uncondensed, // complex' for 3rd argument number v = static_cast(entry->value()); v *= lines[distribute[row]].entries[q].second; - uncondensed.add( - lines[distribute[row]].entries[q].first, column, v); + uncondensed.add(lines[distribute[row]].entries[q].first, + column, + v); } // set old entry to zero @@ -2126,11 +2130,11 @@ AffineConstraints::distribute_local_to_global( for (size_type q = 0; q < position_j.entries.size(); ++q) { - Assert( - !(!local_lines.size() || - local_lines.is_element(position_j.entries[q].first)) || - is_constrained(position_j.entries[q].first) == false, - ExcMessage("Tried to distribute to a fixed dof.")); + Assert(!(!local_lines.size() || + local_lines.is_element( + position_j.entries[q].first)) || + is_constrained(position_j.entries[q].first) == false, + ExcMessage("Tried to distribute to a fixed dof.")); global_vector(position_j.entries[q].first) -= val * position_j.entries[q].second * matrix_entry; } @@ -2195,8 +2199,9 @@ namespace internal PETScWrappers::MPI::Vector & output, const std::integral_constant /*is_block_vector*/) { - output.reinit( - locally_owned_elements, needed_elements, vec.get_mpi_communicator()); + output.reinit(locally_owned_elements, + needed_elements, + vec.get_mpi_communicator()); output = vec; } #endif @@ -2214,8 +2219,9 @@ namespace internal // way to efficiently avoid the copy then const_cast &>(vec) .zero_out_ghosts(); - output.reinit( - locally_owned_elements, needed_elements, vec.get_mpi_communicator()); + output.reinit(locally_owned_elements, + needed_elements, + vec.get_mpi_communicator()); output = vec; output.update_ghost_values(); } @@ -2358,8 +2364,9 @@ AffineConstraints::distribute(VectorType &vec) const vec, next_constraint->entries[i].first)) * next_constraint->entries[i].second); AssertIsFinite(new_value); - internal::ElementAccess::set( - new_value, next_constraint->index, vec); + internal::ElementAccess::set(new_value, + next_constraint->index, + vec); } } } @@ -2403,14 +2410,14 @@ namespace internals }; inline Distributing::Distributing(const size_type global_row, - const size_type local_row) : - global_row(global_row), - local_row(local_row), - constraint_position(numbers::invalid_size_type) + const size_type local_row) + : global_row(global_row) + , local_row(local_row) + , constraint_position(numbers::invalid_size_type) {} - inline Distributing::Distributing(const Distributing &in) : - constraint_position(numbers::invalid_size_type) + inline Distributing::Distributing(const Distributing &in) + : constraint_position(numbers::invalid_size_type) { *this = (in); } @@ -2444,7 +2451,8 @@ namespace internals template struct DataCache { - DataCache() : row_length(8) + DataCache() + : row_length(8) {} void @@ -2541,7 +2549,9 @@ namespace internals class GlobalRowsFromLocal { public: - GlobalRowsFromLocal() : n_active_rows(0), n_inhomogeneous_rows(0) + GlobalRowsFromLocal() + : n_active_rows(0) + , n_inhomogeneous_rows(0) {} void @@ -2845,13 +2855,15 @@ namespace internals /** * Constructor, does nothing. */ - ScratchData() : in_use(false) + ScratchData() + : in_use(false) {} /** * Copy constructor, does nothing */ - ScratchData(const ScratchData &) : in_use(false) + ScratchData(const ScratchData &) + : in_use(false) {} /** @@ -2907,8 +2919,8 @@ namespace internals * Constructor. Grabs a scratch data object on the current thread and * mark it as used */ - ScratchDataAccessor() : - my_scratch_data(&AffineConstraintsData::scratch_data.get()) + ScratchDataAccessor() + : my_scratch_data(&AffineConstraintsData::scratch_data.get()) { Assert(my_scratch_data->in_use == false, ExcMessage( @@ -3155,10 +3167,10 @@ namespace internals { while (matrix_values->column() < column) ++matrix_values; - Assert( - matrix_values->column() == column, - typename SparseMatrix::ExcInvalidIndex(row, column)); + Assert(matrix_values->column() == column, + typename SparseMatrix< + typename SparseMatrixIterator::MatrixType::value_type>:: + ExcInvalidIndex(row, column)); matrix_values->value() += value; } } @@ -3207,8 +3219,10 @@ namespace internals { const size_type loc_col = global_rows.local_row(j); const number col_val = matrix_ptr[loc_col]; - dealiiSparseMatrix::add_value( - col_val, row, global_rows.global_row(j), matrix_values); + dealiiSparseMatrix::add_value(col_val, + row, + global_rows.global_row(j), + matrix_values); } } else @@ -3217,8 +3231,10 @@ namespace internals { number col_val = resolve_matrix_entry( global_rows, global_rows, i, j, loc_row, local_matrix); - dealiiSparseMatrix::add_value( - col_val, row, global_rows.global_row(j), matrix_values); + dealiiSparseMatrix::add_value(col_val, + row, + global_rows.global_row(j), + matrix_values); } } } @@ -3235,15 +3251,19 @@ namespace internals { const size_type loc_col = global_rows.local_row(j); const number col_val = matrix_ptr[loc_col]; - dealiiSparseMatrix::add_value( - col_val, row, global_rows.global_row(j), matrix_values); + dealiiSparseMatrix::add_value(col_val, + row, + global_rows.global_row(j), + matrix_values); } for (size_type j = i + 1; j < column_end; ++j) { const size_type loc_col = global_rows.local_row(j); const number col_val = matrix_ptr[loc_col]; - dealiiSparseMatrix::add_value( - col_val, row, global_rows.global_row(j), matrix_values); + dealiiSparseMatrix::add_value(col_val, + row, + global_rows.global_row(j), + matrix_values); } } else @@ -3254,15 +3274,19 @@ namespace internals { number col_val = resolve_matrix_entry( global_rows, global_rows, i, j, loc_row, local_matrix); - dealiiSparseMatrix::add_value( - col_val, row, global_rows.global_row(j), matrix_values); + dealiiSparseMatrix::add_value(col_val, + row, + global_rows.global_row(j), + matrix_values); } for (size_type j = i + 1; j < column_end; ++j) { number col_val = resolve_matrix_entry( global_rows, global_rows, i, j, loc_row, local_matrix); - dealiiSparseMatrix::add_value( - col_val, row, global_rows.global_row(j), matrix_values); + dealiiSparseMatrix::add_value(col_val, + row, + global_rows.global_row(j), + matrix_values); } } } @@ -3280,8 +3304,10 @@ namespace internals if (row == global_rows.global_row(j)) sparse_matrix->begin(row)->value() += col_val; else - dealiiSparseMatrix::add_value( - col_val, row, global_rows.global_row(j), matrix_values); + dealiiSparseMatrix::add_value(col_val, + row, + global_rows.global_row(j), + matrix_values); } } else @@ -3294,8 +3320,10 @@ namespace internals if (row == global_rows.global_row(j)) sparse_matrix->begin(row)->value() += col_val; else - dealiiSparseMatrix::add_value( - col_val, row, global_rows.global_row(j), matrix_values); + dealiiSparseMatrix::add_value(col_val, + row, + global_rows.global_row(j), + matrix_values); } } } @@ -3533,8 +3561,9 @@ AffineConstraints::make_sorted_row_list( if (position.inhomogeneity != number(0.)) global_rows.set_ith_constraint_inhomogeneous(i); for (size_type q = 0; q < position.entries.size(); ++q) - global_rows.insert_index( - position.entries[q].first, local_row, position.entries[q].second); + global_rows.insert_index(position.entries[q].first, + local_row, + position.entries[q].second); } } @@ -3581,8 +3610,10 @@ AffineConstraints::make_sorted_row_list( // keep the list sorted else { - std::vector::iterator it = Utilities::lower_bound( - active_dofs.begin(), active_dofs.end() - i + 1, new_index); + std::vector::iterator it = + Utilities::lower_bound(active_dofs.begin(), + active_dofs.end() - i + 1, + new_index); if (*it != new_index) active_dofs.insert(it, new_index); } @@ -3765,9 +3796,9 @@ AffineConstraints::distribute_local_to_global( // Vector, LinearAlgebra::distributed::vector, etc. if (std::is_same::value) { - global_vector.add( - vector_indices, - *reinterpret_cast *>(&vector_values)); + global_vector.add(vector_indices, + *reinterpret_cast *>( + &vector_values)); } else { @@ -4189,8 +4220,9 @@ AffineConstraints::add_entries_local_to_global( // additional construct that also takes care of block indices. std::vector &block_starts = scratch_data->block_starts; block_starts.resize(num_blocks + 1); - internals::make_block_starts( - sparsity_pattern, actual_dof_indices, block_starts); + internals::make_block_starts(sparsity_pattern, + actual_dof_indices, + block_starts); for (size_type block = 0; block < num_blocks; ++block) { diff --git a/include/deal.II/lac/arpack_solver.h b/include/deal.II/lac/arpack_solver.h index fba27a61cf..9874ad7a32 100644 --- a/include/deal.II/lac/arpack_solver.h +++ b/include/deal.II/lac/arpack_solver.h @@ -459,10 +459,10 @@ private: inline ArpackSolver::AdditionalData::AdditionalData( const unsigned int number_of_arnoldi_vectors, const WhichEigenvalues eigenvalue_of_interest, - const bool symmetric) : - number_of_arnoldi_vectors(number_of_arnoldi_vectors), - eigenvalue_of_interest(eigenvalue_of_interest), - symmetric(symmetric) + const bool symmetric) + : number_of_arnoldi_vectors(number_of_arnoldi_vectors) + , eigenvalue_of_interest(eigenvalue_of_interest) + , symmetric(symmetric) { // Check for possible options for symmetric problems if (symmetric) @@ -488,12 +488,12 @@ inline ArpackSolver::AdditionalData::AdditionalData( inline ArpackSolver::ArpackSolver(SolverControl & control, - const AdditionalData &data) : - solver_control(control), - additional_data(data), - initial_vector_provided(false), - sigmar(0.0), - sigmai(0.0) + const AdditionalData &data) + : solver_control(control) + , additional_data(data) + , initial_vector_provided(false) + , sigmar(0.0) + , sigmai(0.0) {} @@ -546,9 +546,9 @@ ArpackSolver::solve(const MatrixType1 & /*system_matrix*/, ArpackExcInvalidEigenvectorSize(nev, eigenvectors.size())); } else - Assert( - nev + 1 <= eigenvectors.size(), - ArpackExcInvalidEigenvectorSizeNonsymmetric(nev, eigenvectors.size())); + Assert(nev + 1 <= eigenvectors.size(), + ArpackExcInvalidEigenvectorSizeNonsymmetric(nev, + eigenvectors.size())); Assert(nev <= eigenvalues.size(), ArpackExcInvalidEigenvalueSize(nev, eigenvalues.size())); diff --git a/include/deal.II/lac/block_indices.h b/include/deal.II/lac/block_indices.h index 8f2ae3fb73..c0e9ca908b 100644 --- a/include/deal.II/lac/block_indices.h +++ b/include/deal.II/lac/block_indices.h @@ -281,15 +281,17 @@ BlockIndices::reinit(const std::vector &block_sizes) } -inline BlockIndices::BlockIndices() : n_blocks(0), start_indices(1, 0) +inline BlockIndices::BlockIndices() + : n_blocks(0) + , start_indices(1, 0) {} inline BlockIndices::BlockIndices(const unsigned int n_blocks, - const size_type block_size) : - n_blocks(n_blocks), - start_indices(n_blocks + 1) + const size_type block_size) + : n_blocks(n_blocks) + , start_indices(n_blocks + 1) { for (size_type i = 0; i <= n_blocks; ++i) start_indices[i] = i * block_size; @@ -297,18 +299,18 @@ inline BlockIndices::BlockIndices(const unsigned int n_blocks, -inline BlockIndices::BlockIndices(const std::vector &block_sizes) : - n_blocks(static_cast(block_sizes.size())), - start_indices(block_sizes.size() + 1) +inline BlockIndices::BlockIndices(const std::vector &block_sizes) + : n_blocks(static_cast(block_sizes.size())) + , start_indices(block_sizes.size() + 1) { reinit(block_sizes); } -inline BlockIndices::BlockIndices(BlockIndices &&b) noexcept : - n_blocks(b.n_blocks), - start_indices(std::move(b.start_indices)) +inline BlockIndices::BlockIndices(BlockIndices &&b) noexcept + : n_blocks(b.n_blocks) + , start_indices(std::move(b.start_indices)) { b.n_blocks = 0; b.start_indices = std::vector(1, 0); diff --git a/include/deal.II/lac/block_linear_operator.h b/include/deal.II/lac/block_linear_operator.h index f1b88f3965..36e5b5633a 100644 --- a/include/deal.II/lac/block_linear_operator.h +++ b/include/deal.II/lac/block_linear_operator.h @@ -213,9 +213,9 @@ public: * class LinearOperator are initialized with default variants that throw an * exception upon invocation. */ - BlockLinearOperator(const BlockPayload &payload) : - LinearOperator( - typename BlockPayload::BlockType(payload, payload)) + BlockLinearOperator(const BlockPayload &payload) + : LinearOperator( + typename BlockPayload::BlockType(payload, payload)) { n_block_rows = []() -> unsigned int { Assert( diff --git a/include/deal.II/lac/block_matrix_array.h b/include/deal.II/lac/block_matrix_array.h index 23ed615055..bad0dc6eb4 100644 --- a/include/deal.II/lac/block_matrix_array.h +++ b/include/deal.II/lac/block_matrix_array.h @@ -547,14 +547,14 @@ inline BlockMatrixArray::Entry::Entry( size_type row, size_type col, number prefix, - bool transpose) : - row(row), - col(col), - prefix(prefix), - transpose(transpose), - matrix(new_pointer_matrix_base(m, - typename BlockVectorType::BlockType(), - typeid(*this).name())) + bool transpose) + : row(row) + , col(col) + , prefix(prefix) + , transpose(transpose) + , matrix(new_pointer_matrix_base(m, + typename BlockVectorType::BlockType(), + typeid(*this).name())) {} diff --git a/include/deal.II/lac/block_matrix_base.h b/include/deal.II/lac/block_matrix_base.h index 3af2818297..f21847beff 100644 --- a/include/deal.II/lac/block_matrix_base.h +++ b/include/deal.II/lac/block_matrix_base.h @@ -1081,9 +1081,9 @@ private: namespace BlockMatrixIterators { template - inline AccessorBase::AccessorBase() : - row_block(0), - col_block(0) + inline AccessorBase::AccessorBase() + : row_block(0) + , col_block(0) {} @@ -1111,9 +1111,9 @@ namespace BlockMatrixIterators inline Accessor::Accessor( const BlockMatrixType *matrix, const size_type row, - const size_type col) : - matrix(matrix), - base_iterator(matrix->block(0, 0).begin()) + const size_type col) + : matrix(matrix) + , base_iterator(matrix->block(0, 0).begin()) { (void)col; Assert(col == 0, ExcNotImplemented()); @@ -1173,9 +1173,9 @@ namespace BlockMatrixIterators template inline Accessor::Accessor( - const Accessor &other) : - matrix(other.matrix), - base_iterator(other.base_iterator) + const Accessor &other) + : matrix(other.matrix) + , base_iterator(other.base_iterator) { this->row_block = other.row_block; this->col_block = other.col_block; @@ -1311,9 +1311,9 @@ namespace BlockMatrixIterators template inline Accessor::Accessor(BlockMatrixType *matrix, const size_type row, - const size_type col) : - matrix(matrix), - base_iterator(matrix->block(0, 0).begin()) + const size_type col) + : matrix(matrix) + , base_iterator(matrix->block(0, 0).begin()) { (void)col; Assert(col == 0, ExcNotImplemented()); diff --git a/include/deal.II/lac/block_sparse_matrix_ez.templates.h b/include/deal.II/lac/block_sparse_matrix_ez.templates.h index 9c2dc1d1ea..473ca63c22 100644 --- a/include/deal.II/lac/block_sparse_matrix_ez.templates.h +++ b/include/deal.II/lac/block_sparse_matrix_ez.templates.h @@ -27,9 +27,9 @@ DEAL_II_NAMESPACE_OPEN template BlockSparseMatrixEZ::BlockSparseMatrixEZ(const unsigned int rows, - const unsigned int cols) : - row_indices(rows, 0), - column_indices(cols, 0) + const unsigned int cols) + : row_indices(rows, 0) + , column_indices(cols, 0) {} @@ -82,11 +82,11 @@ BlockSparseMatrixEZ::operator=(const double d) template BlockSparseMatrixEZ::BlockSparseMatrixEZ( - const BlockSparseMatrixEZ &m) : - Subscriptor(m), - row_indices(m.row_indices), - column_indices(m.column_indices), - blocks(m.blocks) + const BlockSparseMatrixEZ &m) + : Subscriptor(m) + , row_indices(m.row_indices) + , column_indices(m.column_indices) + , blocks(m.blocks) {} diff --git a/include/deal.II/lac/block_sparsity_pattern.h b/include/deal.II/lac/block_sparsity_pattern.h index 70dc376fcd..11df312a7b 100644 --- a/include/deal.II/lac/block_sparsity_pattern.h +++ b/include/deal.II/lac/block_sparsity_pattern.h @@ -982,8 +982,9 @@ BlockDynamicSparsityPattern::column_number(const size_type row, unsigned int rowlen = sub_objects[row_index.first][b]->row_length(row_index.second); if (index < c + rowlen) - return block_columns + sub_objects[row_index.first][b]->column_number( - row_index.second, index - c); + return block_columns + + sub_objects[row_index.first][b]->column_number(row_index.second, + index - c); c += rowlen; block_columns += sub_objects[row_index.first][b]->n_cols(); } diff --git a/include/deal.II/lac/block_vector.templates.h b/include/deal.II/lac/block_vector.templates.h index 1e8c71343c..db97aa0f26 100644 --- a/include/deal.II/lac/block_vector.templates.h +++ b/include/deal.II/lac/block_vector.templates.h @@ -51,8 +51,8 @@ BlockVector::BlockVector(const BlockIndices &n) template -BlockVector::BlockVector(const BlockVector &v) : - BlockVectorBase>() +BlockVector::BlockVector(const BlockVector &v) + : BlockVectorBase>() { this->components.resize(v.n_blocks()); this->block_indices = v.block_indices; diff --git a/include/deal.II/lac/block_vector_base.h b/include/deal.II/lac/block_vector_base.h index d3833c75cd..78abfe73ee 100644 --- a/include/deal.II/lac/block_vector_base.h +++ b/include/deal.II/lac/block_vector_base.h @@ -1071,26 +1071,26 @@ namespace internal { template inline Iterator::Iterator( - const Iterator &c) : - parent(c.parent), - global_index(c.global_index), - current_block(c.current_block), - index_within_block(c.index_within_block), - next_break_forward(c.next_break_forward), - next_break_backward(c.next_break_backward) + const Iterator &c) + : parent(c.parent) + , global_index(c.global_index) + , current_block(c.current_block) + , index_within_block(c.index_within_block) + , next_break_forward(c.next_break_forward) + , next_break_backward(c.next_break_backward) {} template inline Iterator::Iterator( - const Iterator &c) : - parent(c.parent), - global_index(c.global_index), - current_block(c.current_block), - index_within_block(c.index_within_block), - next_break_forward(c.next_break_forward), - next_break_backward(c.next_break_backward) + const Iterator &c) + : parent(c.parent) + , global_index(c.global_index) + , current_block(c.current_block) + , index_within_block(c.index_within_block) + , next_break_forward(c.next_break_forward) + , next_break_backward(c.next_break_backward) { // Only permit copy-constructing const iterators from non-const // iterators, and not vice versa (i.e., Constness must always be @@ -1109,13 +1109,13 @@ namespace internal const size_type current_block, const size_type index_within_block, const size_type next_break_forward, - const size_type next_break_backward) : - parent(&parent), - global_index(global_index), - current_block(current_block), - index_within_block(index_within_block), - next_break_forward(next_break_forward), - next_break_backward(next_break_backward) + const size_type next_break_backward) + : parent(&parent) + , global_index(global_index) + , current_block(current_block) + , index_within_block(index_within_block) + , next_break_forward(next_break_forward) + , next_break_backward(next_break_backward) {} @@ -1411,11 +1411,10 @@ namespace internal template - Iterator::Iterator( - BlockVector & parent, - const size_type global_index) : - parent(&parent), - global_index(global_index) + Iterator::Iterator(BlockVector & parent, + const size_type global_index) + : parent(&parent) + , global_index(global_index) { // find which block we are // in. for this, take into diff --git a/include/deal.II/lac/chunk_sparse_matrix.h b/include/deal.II/lac/chunk_sparse_matrix.h index 9b0cd88511..a2859f41ec 100644 --- a/include/deal.II/lac/chunk_sparse_matrix.h +++ b/include/deal.II/lac/chunk_sparse_matrix.h @@ -1666,27 +1666,27 @@ namespace ChunkSparseMatrixIterators { template inline Accessor::Accessor(const MatrixType * matrix, - const unsigned int row) : - ChunkSparsityPatternIterators::Accessor(&matrix->get_sparsity_pattern(), - row), - matrix(matrix) + const unsigned int row) + : ChunkSparsityPatternIterators::Accessor(&matrix->get_sparsity_pattern(), + row) + , matrix(matrix) {} template - inline Accessor::Accessor(const MatrixType *matrix) : - ChunkSparsityPatternIterators::Accessor(&matrix->get_sparsity_pattern()), - matrix(matrix) + inline Accessor::Accessor(const MatrixType *matrix) + : ChunkSparsityPatternIterators::Accessor(&matrix->get_sparsity_pattern()) + , matrix(matrix) {} template inline Accessor::Accessor( - const ChunkSparseMatrixIterators::Accessor &a) : - ChunkSparsityPatternIterators::Accessor(a), - matrix(&a.get_matrix()) + const ChunkSparseMatrixIterators::Accessor &a) + : ChunkSparsityPatternIterators::Accessor(a) + , matrix(&a.get_matrix()) {} @@ -1714,8 +1714,8 @@ namespace ChunkSparseMatrixIterators template inline Accessor::Reference::Reference(const Accessor *accessor, - const bool) : - accessor(accessor) + const bool) + : accessor(accessor) {} @@ -1803,18 +1803,18 @@ namespace ChunkSparseMatrixIterators template inline Accessor::Accessor(MatrixType * matrix, - const unsigned int row) : - ChunkSparsityPatternIterators::Accessor(&matrix->get_sparsity_pattern(), - row), - matrix(matrix) + const unsigned int row) + : ChunkSparsityPatternIterators::Accessor(&matrix->get_sparsity_pattern(), + row) + , matrix(matrix) {} template - inline Accessor::Accessor(MatrixType *matrix) : - ChunkSparsityPatternIterators::Accessor(&matrix->get_sparsity_pattern()), - matrix(matrix) + inline Accessor::Accessor(MatrixType *matrix) + : ChunkSparsityPatternIterators::Accessor(&matrix->get_sparsity_pattern()) + , matrix(matrix) {} @@ -1839,23 +1839,23 @@ namespace ChunkSparseMatrixIterators template inline Iterator::Iterator(MatrixType * matrix, - const unsigned int row) : - accessor(matrix, row) + const unsigned int row) + : accessor(matrix, row) {} template - inline Iterator::Iterator(MatrixType *matrix) : - accessor(matrix) + inline Iterator::Iterator(MatrixType *matrix) + : accessor(matrix) {} template inline Iterator::Iterator( - const ChunkSparseMatrixIterators::Iterator &i) : - accessor(*i) + const ChunkSparseMatrixIterators::Iterator &i) + : accessor(*i) {} diff --git a/include/deal.II/lac/chunk_sparse_matrix.templates.h b/include/deal.II/lac/chunk_sparse_matrix.templates.h index 6954e43050..5b6ee7e718 100644 --- a/include/deal.II/lac/chunk_sparse_matrix.templates.h +++ b/include/deal.II/lac/chunk_sparse_matrix.templates.h @@ -269,27 +269,27 @@ namespace internal template -ChunkSparseMatrix::ChunkSparseMatrix() : - cols(nullptr, "ChunkSparseMatrix"), - val(nullptr), - max_len(0) +ChunkSparseMatrix::ChunkSparseMatrix() + : cols(nullptr, "ChunkSparseMatrix") + , val(nullptr) + , max_len(0) {} template -ChunkSparseMatrix::ChunkSparseMatrix(const ChunkSparseMatrix &m) : - Subscriptor(m), - cols(nullptr, "ChunkSparseMatrix"), - val(nullptr), - max_len(0) +ChunkSparseMatrix::ChunkSparseMatrix(const ChunkSparseMatrix &m) + : Subscriptor(m) + , cols(nullptr, "ChunkSparseMatrix") + , val(nullptr) + , max_len(0) { - Assert( - m.cols == nullptr && m.val == nullptr && m.max_len == 0, - ExcMessage("This constructor can only be called if the provided argument " - "is an empty matrix. This constructor can not be used to " - "copy-construct a non-empty matrix. Use the " - "ChunkSparseMatrix::copy_from() function for that purpose.")); + Assert(m.cols == nullptr && m.val == nullptr && m.max_len == 0, + ExcMessage( + "This constructor can only be called if the provided argument " + "is an empty matrix. This constructor can not be used to " + "copy-construct a non-empty matrix. Use the " + "ChunkSparseMatrix::copy_from() function for that purpose.")); } @@ -299,12 +299,12 @@ ChunkSparseMatrix & ChunkSparseMatrix::operator=(const ChunkSparseMatrix &m) { (void)m; - Assert( - m.cols == nullptr && m.val == nullptr && m.max_len == 0, - ExcMessage("This operator can only be called if the provided right " - "hand side is an empty matrix. This operator can not be " - "used to copy a non-empty matrix. Use the " - "ChunkSparseMatrix::copy_from() function for that purpose.")); + Assert(m.cols == nullptr && m.val == nullptr && m.max_len == 0, + ExcMessage( + "This operator can only be called if the provided right " + "hand side is an empty matrix. This operator can not be " + "used to copy a non-empty matrix. Use the " + "ChunkSparseMatrix::copy_from() function for that purpose.")); return *this; } @@ -312,10 +312,10 @@ ChunkSparseMatrix::operator=(const ChunkSparseMatrix &m) template -ChunkSparseMatrix::ChunkSparseMatrix(const ChunkSparsityPattern &c) : - cols(nullptr, "ChunkSparseMatrix"), - val(nullptr), - max_len(0) +ChunkSparseMatrix::ChunkSparseMatrix(const ChunkSparsityPattern &c) + : cols(nullptr, "ChunkSparseMatrix") + , val(nullptr) + , max_len(0) { // virtual functions called in constructors and destructors never use the // override in a derived class @@ -327,10 +327,10 @@ ChunkSparseMatrix::ChunkSparseMatrix(const ChunkSparsityPattern &c) : template ChunkSparseMatrix::ChunkSparseMatrix(const ChunkSparsityPattern &c, - const IdentityMatrix & id) : - cols(nullptr, "ChunkSparseMatrix"), - val(nullptr), - max_len(0) + const IdentityMatrix & id) + : cols(nullptr, "ChunkSparseMatrix") + , val(nullptr) + , max_len(0) { (void)id; Assert(c.n_rows() == id.m(), ExcDimensionMismatch(c.n_rows(), id.m())); @@ -396,12 +396,11 @@ ChunkSparseMatrix::operator=(const double d) parallel::apply_to_subranges( 0U, matrix_size, - std::bind( - &internal::ChunkSparseMatrixImplementation::template zero_subrange< - number>, - std::placeholders::_1, - std::placeholders::_2, - val.get()), + std::bind(&internal::ChunkSparseMatrixImplementation:: + template zero_subrange, + std::placeholders::_1, + std::placeholders::_2, + val.get()), grain_size); else if (matrix_size > 0) std::memset(val.get(), 0, matrix_size * sizeof(number)); @@ -505,11 +504,12 @@ ChunkSparseMatrix::n_actually_nonzero_elements() const // around the matrix. since we have the invariant that padding elements are // zero, nothing bad can happen here const size_type chunk_size = cols->get_chunk_size(); - return std::count_if( - val.get(), - val.get() + - cols->sparsity_pattern.n_nonzero_elements() * chunk_size * chunk_size, - std::bind(std::not_equal_to(), std::placeholders::_1, 0)); + return std::count_if(val.get(), + val.get() + cols->sparsity_pattern.n_nonzero_elements() * + chunk_size * chunk_size, + std::bind(std::not_equal_to(), + std::placeholders::_1, + 0)); } @@ -851,11 +851,12 @@ ChunkSparseMatrix::matrix_norm_square(const Vector &v) const if ((cols_have_padding == false) || (*colnum_ptr != cols->sparsity_pattern.n_cols() - 1)) result += internal::ChunkSparseMatrixImplementation:: - chunk_matrix_scalar_product( - cols->chunk_size, - val_ptr, - v_ptr, - v.begin() + *colnum_ptr * cols->chunk_size); + chunk_matrix_scalar_product(cols->chunk_size, + val_ptr, + v_ptr, + v.begin() + + *colnum_ptr * + cols->chunk_size); else // we're at a chunk column that has padding for (size_type r = 0; r < cols->chunk_size; ++r) @@ -949,11 +950,12 @@ ChunkSparseMatrix::matrix_scalar_product( if ((cols_have_padding == false) || (*colnum_ptr != cols->sparsity_pattern.n_cols() - 1)) result += internal::ChunkSparseMatrixImplementation:: - chunk_matrix_scalar_product( - cols->chunk_size, - val_ptr, - u_ptr, - v.begin() + *colnum_ptr * cols->chunk_size); + chunk_matrix_scalar_product(cols->chunk_size, + val_ptr, + u_ptr, + v.begin() + + *colnum_ptr * + cols->chunk_size); else // we're at a chunk column that has padding for (size_type r = 0; r < cols->chunk_size; ++r) diff --git a/include/deal.II/lac/chunk_sparsity_pattern.h b/include/deal.II/lac/chunk_sparsity_pattern.h index 4ca9b76dfc..9320e4b0fb 100644 --- a/include/deal.II/lac/chunk_sparsity_pattern.h +++ b/include/deal.II/lac/chunk_sparsity_pattern.h @@ -865,25 +865,25 @@ private: namespace ChunkSparsityPatternIterators { inline Accessor::Accessor(const ChunkSparsityPattern *sparsity_pattern, - const unsigned int row) : - sparsity_pattern(sparsity_pattern), - reduced_accessor(row == sparsity_pattern->n_rows() ? - *sparsity_pattern->sparsity_pattern.end() : - *sparsity_pattern->sparsity_pattern.begin( - row / sparsity_pattern->get_chunk_size())), - chunk_row(row == sparsity_pattern->n_rows() ? - 0 : - row % sparsity_pattern->get_chunk_size()), - chunk_col(0) + const unsigned int row) + : sparsity_pattern(sparsity_pattern) + , reduced_accessor(row == sparsity_pattern->n_rows() ? + *sparsity_pattern->sparsity_pattern.end() : + *sparsity_pattern->sparsity_pattern.begin( + row / sparsity_pattern->get_chunk_size())) + , chunk_row(row == sparsity_pattern->n_rows() ? + 0 : + row % sparsity_pattern->get_chunk_size()) + , chunk_col(0) {} - inline Accessor::Accessor(const ChunkSparsityPattern *sparsity_pattern) : - sparsity_pattern(sparsity_pattern), - reduced_accessor(*sparsity_pattern->sparsity_pattern.end()), - chunk_row(0), - chunk_col(0) + inline Accessor::Accessor(const ChunkSparsityPattern *sparsity_pattern) + : sparsity_pattern(sparsity_pattern) + , reduced_accessor(*sparsity_pattern->sparsity_pattern.end()) + , chunk_row(0) + , chunk_col(0) {} @@ -1040,8 +1040,8 @@ namespace ChunkSparsityPatternIterators inline Iterator::Iterator(const ChunkSparsityPattern *sparsity_pattern, - const unsigned int row) : - accessor(sparsity_pattern, row) + const unsigned int row) + : accessor(sparsity_pattern, row) {} diff --git a/include/deal.II/lac/cuda_atomic.h b/include/deal.II/lac/cuda_atomic.h index 0d72ba0fce..f018365923 100644 --- a/include/deal.II/lac/cuda_atomic.h +++ b/include/deal.II/lac/cuda_atomic.h @@ -59,10 +59,10 @@ namespace LinearAlgebra do { assumed = old; - old = atomicCAS( - address_as_ull, - assumed, - __double_as_longlong(val + __longlong_as_double(assumed))); + old = atomicCAS(address_as_ull, + assumed, + __double_as_longlong(val + + __longlong_as_double(assumed))); } while (assumed != old); diff --git a/include/deal.II/lac/dynamic_sparsity_pattern.h b/include/deal.II/lac/dynamic_sparsity_pattern.h index 65d7125b19..fd276668a4 100644 --- a/include/deal.II/lac/dynamic_sparsity_pattern.h +++ b/include/deal.II/lac/dynamic_sparsity_pattern.h @@ -677,22 +677,22 @@ namespace DynamicSparsityPatternIterators { inline Accessor::Accessor(const DynamicSparsityPattern *sparsity_pattern, const size_type row, - const unsigned int index_within_row) : - sparsity_pattern(sparsity_pattern), - current_row(row), - current_entry( - ((sparsity_pattern->rowset.size() == 0) ? - sparsity_pattern->lines[current_row].entries.begin() : - sparsity_pattern - ->lines[sparsity_pattern->rowset.index_within_set(current_row)] - .entries.begin()) + - index_within_row), - end_of_row( - (sparsity_pattern->rowset.size() == 0) ? - sparsity_pattern->lines[current_row].entries.end() : - sparsity_pattern - ->lines[sparsity_pattern->rowset.index_within_set(current_row)] - .entries.end()) + const unsigned int index_within_row) + : sparsity_pattern(sparsity_pattern) + , current_row(row) + , current_entry( + ((sparsity_pattern->rowset.size() == 0) ? + sparsity_pattern->lines[current_row].entries.begin() : + sparsity_pattern + ->lines[sparsity_pattern->rowset.index_within_set(current_row)] + .entries.begin()) + + index_within_row) + , end_of_row( + (sparsity_pattern->rowset.size() == 0) ? + sparsity_pattern->lines[current_row].entries.end() : + sparsity_pattern + ->lines[sparsity_pattern->rowset.index_within_set(current_row)] + .entries.end()) { AssertIndexRange(current_row, sparsity_pattern->n_rows()); Assert((sparsity_pattern->rowset.size() == 0) || @@ -711,11 +711,11 @@ namespace DynamicSparsityPatternIterators } - inline Accessor::Accessor(const DynamicSparsityPattern *sparsity_pattern) : - sparsity_pattern(sparsity_pattern), - current_row(numbers::invalid_size_type), - current_entry(), - end_of_row() + inline Accessor::Accessor(const DynamicSparsityPattern *sparsity_pattern) + : sparsity_pattern(sparsity_pattern) + , current_row(numbers::invalid_size_type) + , current_entry() + , end_of_row() {} @@ -822,14 +822,14 @@ namespace DynamicSparsityPatternIterators inline Iterator::Iterator(const DynamicSparsityPattern *sparsity_pattern, const size_type row, - const unsigned int index_within_row) : - accessor(sparsity_pattern, row, index_within_row) + const unsigned int index_within_row) + : accessor(sparsity_pattern, row, index_within_row) {} - inline Iterator::Iterator(const DynamicSparsityPattern *sparsity_pattern) : - accessor(sparsity_pattern) + inline Iterator::Iterator(const DynamicSparsityPattern *sparsity_pattern) + : accessor(sparsity_pattern) {} @@ -1009,9 +1009,10 @@ DynamicSparsityPattern::column_number(const size_type row, const size_type local_row = rowset.size() ? rowset.index_within_set(row) : row; - Assert( - index < lines[local_row].entries.size(), - ExcIndexRangeType(index, 0, lines[local_row].entries.size())); + Assert(index < lines[local_row].entries.size(), + ExcIndexRangeType(index, + 0, + lines[local_row].entries.size())); return lines[local_row].entries[index]; } diff --git a/include/deal.II/lac/eigen.h b/include/deal.II/lac/eigen.h index 88ee365e26..37f4fa39bd 100644 --- a/include/deal.II/lac/eigen.h +++ b/include/deal.II/lac/eigen.h @@ -73,7 +73,8 @@ public: /** * Constructor. Set the shift parameter. */ - AdditionalData(const double shift = 0.) : shift(shift) + AdditionalData(const double shift = 0.) + : shift(shift) {} }; @@ -161,10 +162,10 @@ public: */ AdditionalData(double relaxation = 1., unsigned int start_adaption = 6, - bool use_residual = true) : - relaxation(relaxation), - start_adaption(start_adaption), - use_residual(use_residual) + bool use_residual = true) + : relaxation(relaxation) + , start_adaption(start_adaption) + , use_residual(use_residual) {} }; @@ -206,9 +207,9 @@ protected: template EigenPower::EigenPower(SolverControl & cn, VectorMemory &mem, - const AdditionalData & data) : - Solver(cn, mem), - additional_data(data) + const AdditionalData & data) + : Solver(cn, mem) + , additional_data(data) {} @@ -277,8 +278,9 @@ EigenPower::solve(double &value, const MatrixType &A, VectorType &x) // Check the change of the eigenvalue // Brrr, this is not really a good criterion - conv = this->iteration_status( - iter, std::fabs(1. / length - 1. / old_length), x); + conv = this->iteration_status(iter, + std::fabs(1. / length - 1. / old_length), + x); } // in case of failure: throw exception @@ -294,9 +296,9 @@ EigenPower::solve(double &value, const MatrixType &A, VectorType &x) template EigenInverse::EigenInverse(SolverControl & cn, VectorMemory &mem, - const AdditionalData & data) : - Solver(cn, mem), - additional_data(data) + const AdditionalData & data) + : Solver(cn, mem) + , additional_data(data) {} diff --git a/include/deal.II/lac/filtered_matrix.h b/include/deal.II/lac/filtered_matrix.h index 4a1cc9da36..6cd6b71116 100644 --- a/include/deal.II/lac/filtered_matrix.h +++ b/include/deal.II/lac/filtered_matrix.h @@ -578,9 +578,9 @@ private: template inline FilteredMatrix::Accessor::Accessor( const FilteredMatrix *matrix, - const size_type index) : - matrix(matrix), - index(index) + const size_type index) + : matrix(matrix) + , index(index) { Assert(index <= matrix->constraints.size(), ExcIndexRange(index, 0, matrix->constraints.size())); @@ -628,8 +628,8 @@ FilteredMatrix::Accessor::advance() template inline FilteredMatrix::const_iterator::const_iterator( const FilteredMatrix *matrix, - const size_type index) : - accessor(matrix, index) + const size_type index) + : accessor(matrix, index) {} @@ -720,18 +720,18 @@ FilteredMatrix::initialize(const MatrixType &m, bool ecs) template -inline FilteredMatrix::FilteredMatrix() : - expect_constrained_source(false) +inline FilteredMatrix::FilteredMatrix() + : expect_constrained_source(false) {} template -inline FilteredMatrix::FilteredMatrix(const FilteredMatrix &fm) : - Subscriptor(), - expect_constrained_source(fm.expect_constrained_source), - matrix(fm.matrix), - constraints(fm.constraints) +inline FilteredMatrix::FilteredMatrix(const FilteredMatrix &fm) + : Subscriptor() + , expect_constrained_source(fm.expect_constrained_source) + , matrix(fm.matrix) + , constraints(fm.constraints) {} @@ -739,8 +739,8 @@ inline FilteredMatrix::FilteredMatrix(const FilteredMatrix &fm) : template template inline FilteredMatrix::FilteredMatrix(const MatrixType &m, - const bool ecs) : - expect_constrained_source(false) + const bool ecs) + : expect_constrained_source(false) { initialize(m, ecs); } @@ -779,8 +779,9 @@ FilteredMatrix::add_constraints( // add new constraints to end const size_type old_size = constraints.size(); constraints.reserve(old_size + new_constraints.size()); - constraints.insert( - constraints.end(), new_constraints.begin(), new_constraints.end()); + constraints.insert(constraints.end(), + new_constraints.begin(), + new_constraints.end()); // then merge the two arrays to // form one sorted one std::inplace_merge(constraints.begin(), diff --git a/include/deal.II/lac/full_matrix.h b/include/deal.II/lac/full_matrix.h index f36765e1ec..58852e01cc 100644 --- a/include/deal.II/lac/full_matrix.h +++ b/include/deal.II/lac/full_matrix.h @@ -1373,10 +1373,10 @@ FullMatrix::Tvmult_add(Vector & w, template inline FullMatrix::Accessor::Accessor(const FullMatrix *matrix, const size_type r, - const size_type c) : - matrix(matrix), - a_row(r), - a_col(c) + const size_type c) + : matrix(matrix) + , a_row(r) + , a_col(c) {} @@ -1409,8 +1409,8 @@ template inline FullMatrix::const_iterator::const_iterator( const FullMatrix *matrix, const size_type r, - const size_type c) : - accessor(matrix, r, c) + const size_type c) + : accessor(matrix, r, c) {} diff --git a/include/deal.II/lac/full_matrix.templates.h b/include/deal.II/lac/full_matrix.templates.h index 4ac2f7ab83..da3d78b6d5 100644 --- a/include/deal.II/lac/full_matrix.templates.h +++ b/include/deal.II/lac/full_matrix.templates.h @@ -43,21 +43,22 @@ DEAL_II_NAMESPACE_OPEN template -FullMatrix::FullMatrix(const size_type n) : Table<2, number>(n, n) +FullMatrix::FullMatrix(const size_type n) + : Table<2, number>(n, n) {} template -FullMatrix::FullMatrix(const size_type m, const size_type n) : - Table<2, number>(m, n) +FullMatrix::FullMatrix(const size_type m, const size_type n) + : Table<2, number>(m, n) {} template FullMatrix::FullMatrix(const size_type m, const size_type n, - const number * entries) : - Table<2, number>(m, n) + const number * entries) + : Table<2, number>(m, n) { this->fill(entries); } @@ -65,8 +66,8 @@ FullMatrix::FullMatrix(const size_type m, template -FullMatrix::FullMatrix(const IdentityMatrix &id) : - Table<2, number>(id.m(), id.n()) +FullMatrix::FullMatrix(const IdentityMatrix &id) + : Table<2, number>(id.m(), id.n()) { for (size_type i = 0; i < id.m(); ++i) (*this)(i, i) = 1; diff --git a/include/deal.II/lac/identity_matrix.h b/include/deal.II/lac/identity_matrix.h index 6c3687867b..f54c34b701 100644 --- a/include/deal.II/lac/identity_matrix.h +++ b/include/deal.II/lac/identity_matrix.h @@ -156,12 +156,14 @@ private: #ifndef DOXYGEN -inline IdentityMatrix::IdentityMatrix() : size(0) +inline IdentityMatrix::IdentityMatrix() + : size(0) {} -inline IdentityMatrix::IdentityMatrix(const size_type n) : size(n) +inline IdentityMatrix::IdentityMatrix(const size_type n) + : size(n) {} diff --git a/include/deal.II/lac/la_parallel_block_vector.templates.h b/include/deal.II/lac/la_parallel_block_vector.templates.h index 6f01dcb2d3..054d6d796c 100644 --- a/include/deal.II/lac/la_parallel_block_vector.templates.h +++ b/include/deal.II/lac/la_parallel_block_vector.templates.h @@ -89,8 +89,8 @@ namespace LinearAlgebra template - BlockVector::BlockVector(const BlockVector &v) : - BlockVectorBase>() + BlockVector::BlockVector(const BlockVector &v) + : BlockVectorBase>() { this->components.resize(v.n_blocks()); this->block_indices = v.block_indices; @@ -571,8 +571,9 @@ namespace LinearAlgebra // query). this is the same in all the functions below int local_result = -1; for (unsigned int i = 0; i < this->n_blocks(); ++i) - local_result = std::max( - local_result, -static_cast(this->block(i).all_zero_local())); + local_result = + std::max(local_result, + -static_cast(this->block(i).all_zero_local())); if (this->block(0).partitioner->n_mpi_processes() > 1) return -Utilities::MPI::max( @@ -891,8 +892,9 @@ namespace LinearAlgebra matrix(i, j) = this->block(i).inner_product_local(V.block(j)); } - Utilities::MPI::sum( - matrix, this->block(0).get_mpi_communicator(), matrix); + Utilities::MPI::sum(matrix, + this->block(0).get_mpi_communicator(), + matrix); } diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index d5e3ed0ae9..88cd2b61d4 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -64,13 +64,14 @@ namespace LinearAlgebra { if (new_alloc_size > allocated_size) { - Assert( - ((allocated_size > 0 && values != nullptr) || values == nullptr), - ExcInternalError()); + Assert(((allocated_size > 0 && values != nullptr) || + values == nullptr), + ExcInternalError()); Number *new_val; - Utilities::System::posix_memalign( - (void **)&new_val, 64, sizeof(Number) * new_alloc_size); + Utilities::System::posix_memalign((void **)&new_val, + 64, + sizeof(Number) * new_alloc_size); values.reset(new_val); allocated_size = new_alloc_size; @@ -156,8 +157,9 @@ namespace LinearAlgebra { // set up parallel partitioner with index sets and communicator std::shared_ptr new_partitioner( - new Utilities::MPI::Partitioner( - locally_owned_indices, ghost_indices, communicator)); + new Utilities::MPI::Partitioner(locally_owned_indices, + ghost_indices, + communicator)); reinit(new_partitioner); } @@ -205,10 +207,10 @@ namespace LinearAlgebra template - Vector::Vector() : - partitioner(new Utilities::MPI::Partitioner()), - allocated_size(0), - values(nullptr, &free) + Vector::Vector() + : partitioner(new Utilities::MPI::Partitioner()) + , allocated_size(0) + , values(nullptr, &free) { reinit(0); } @@ -216,11 +218,11 @@ namespace LinearAlgebra template - Vector::Vector(const Vector &v) : - Subscriptor(), - allocated_size(0), - values(nullptr, &free), - vector_is_ghosted(false) + Vector::Vector(const Vector &v) + : Subscriptor() + , allocated_size(0) + , values(nullptr, &free) + , vector_is_ghosted(false) { reinit(v, true); @@ -231,8 +233,10 @@ namespace LinearAlgebra { dealii::internal::VectorOperations::Vector_copy copier(v.values.get(), values.get()); - internal::VectorOperations::parallel_for( - copier, 0, partitioner->local_size(), thread_loop_partitioner); + internal::VectorOperations::parallel_for(copier, + 0, + partitioner->local_size(), + thread_loop_partitioner); } } @@ -241,10 +245,10 @@ namespace LinearAlgebra template Vector::Vector(const IndexSet &local_range, const IndexSet &ghost_indices, - const MPI_Comm communicator) : - allocated_size(0), - values(nullptr, &free), - vector_is_ghosted(false) + const MPI_Comm communicator) + : allocated_size(0) + , values(nullptr, &free) + , vector_is_ghosted(false) { reinit(local_range, ghost_indices, communicator); } @@ -253,10 +257,10 @@ namespace LinearAlgebra template Vector::Vector(const IndexSet &local_range, - const MPI_Comm communicator) : - allocated_size(0), - values(nullptr, &free), - vector_is_ghosted(false) + const MPI_Comm communicator) + : allocated_size(0) + , values(nullptr, &free) + , vector_is_ghosted(false) { reinit(local_range, communicator); } @@ -264,10 +268,10 @@ namespace LinearAlgebra template - Vector::Vector(const size_type size) : - allocated_size(0), - values(nullptr, &free), - vector_is_ghosted(false) + Vector::Vector(const size_type size) + : allocated_size(0) + , values(nullptr, &free) + , vector_is_ghosted(false) { reinit(size, false); } @@ -276,10 +280,10 @@ namespace LinearAlgebra template Vector::Vector( - const std::shared_ptr &partitioner) : - allocated_size(0), - values(nullptr, &free), - vector_is_ghosted(false) + const std::shared_ptr &partitioner) + : allocated_size(0) + , values(nullptr, &free) + , vector_is_ghosted(false) { reinit(partitioner); } @@ -368,8 +372,10 @@ namespace LinearAlgebra { dealii::internal::VectorOperations::Vector_copy copier(c.values.get(), values.get()); - internal::VectorOperations::parallel_for( - copier, 0, this_size, thread_loop_partitioner); + internal::VectorOperations::parallel_for(copier, + 0, + this_size, + thread_loop_partitioner); } if (must_update_ghost_values) @@ -391,8 +397,10 @@ namespace LinearAlgebra { dealii::internal::VectorOperations::Vector_copy copier(src.values.get(), values.get()); - internal::VectorOperations::parallel_for( - copier, 0, partitioner->local_size(), thread_loop_partitioner); + internal::VectorOperations::parallel_for(copier, + 0, + partitioner->local_size(), + thread_loop_partitioner); } } @@ -449,8 +457,9 @@ namespace LinearAlgebra AssertThrow(ierr == 0, ExcPETScError(ierr)); const size_type vec_size = local_size(); - petsc_helpers::copy_petsc_vector( - start_ptr, start_ptr + vec_size, begin()); + petsc_helpers::copy_petsc_vector(start_ptr, + start_ptr + vec_size, + begin()); // restore the representation of the vector ierr = VecRestoreArray(static_cast(petsc_vec), &start_ptr); @@ -722,10 +731,10 @@ namespace LinearAlgebra &flag, MPI_STATUSES_IGNORE); AssertThrowMPI(ierr); - Assert( - flag == 1, - ExcMessage("MPI found unfinished update_ghost_values() requests" - "when calling swap, which is not allowed")); + Assert(flag == 1, + ExcMessage( + "MPI found unfinished update_ghost_values() requests" + "when calling swap, which is not allowed")); } if (compress_requests.size() > 0) { @@ -765,8 +774,10 @@ namespace LinearAlgebra internal::VectorOperations::Vector_set setter(s, values.get()); - internal::VectorOperations::parallel_for( - setter, 0, this_size, thread_loop_partitioner); + internal::VectorOperations::parallel_for(setter, + 0, + this_size, + thread_loop_partitioner); } // if we call Vector::operator=0, we want to zero out all the entries @@ -807,8 +818,10 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_add_v vector_add( values.get(), v.values.get()); - internal::VectorOperations::parallel_for( - vector_add, 0, partitioner->local_size(), thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add, + 0, + partitioner->local_size(), + thread_loop_partitioner); if (vector_is_ghosted) update_ghost_values(); @@ -831,8 +844,10 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_subtract_v vector_subtract(values.get(), v.values.get()); - internal::VectorOperations::parallel_for( - vector_subtract, 0, partitioner->local_size(), thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_subtract, + 0, + partitioner->local_size(), + thread_loop_partitioner); if (vector_is_ghosted) update_ghost_values(); @@ -850,8 +865,10 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_add_factor vector_add( values.get(), a); - internal::VectorOperations::parallel_for( - vector_add, 0, partitioner->local_size(), thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add, + 0, + partitioner->local_size(), + thread_loop_partitioner); if (vector_is_ghosted) update_ghost_values(); @@ -878,8 +895,10 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_add_av vector_add( values.get(), v.values.get(), a); - internal::VectorOperations::parallel_for( - vector_add, 0, partitioner->local_size(), thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add, + 0, + partitioner->local_size(), + thread_loop_partitioner); } @@ -919,8 +938,10 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_add_avpbw vector_add( values.get(), v.values.get(), w.values.get(), a, b); - internal::VectorOperations::parallel_for( - vector_add, 0, partitioner->local_size(), thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add, + 0, + partitioner->local_size(), + thread_loop_partitioner); if (vector_is_ghosted) update_ghost_values(); @@ -950,8 +971,10 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_sadd_xv vector_sadd( values.get(), v.values.get(), x); - internal::VectorOperations::parallel_for( - vector_sadd, 0, partitioner->local_size(), thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_sadd, + 0, + partitioner->local_size(), + thread_loop_partitioner); if (vector_is_ghosted) update_ghost_values(); @@ -976,8 +999,10 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_sadd_xav vector_sadd( values.get(), v.values.get(), a, x); - internal::VectorOperations::parallel_for( - vector_sadd, 0, partitioner->local_size(), thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_sadd, + 0, + partitioner->local_size(), + thread_loop_partitioner); } @@ -1013,8 +1038,10 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_sadd_xavbw vector_sadd( values.get(), v.values.get(), w.values.get(), x, a, b); - internal::VectorOperations::parallel_for( - vector_sadd, 0, partitioner->local_size(), thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_sadd, + 0, + partitioner->local_size(), + thread_loop_partitioner); if (vector_is_ghosted) update_ghost_values(); @@ -1030,8 +1057,10 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_multiply_factor vector_multiply(values.get(), factor); - internal::VectorOperations::parallel_for( - vector_multiply, 0, partitioner->local_size(), thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_multiply, + 0, + partitioner->local_size(), + thread_loop_partitioner); if (vector_is_ghosted) update_ghost_values(); @@ -1064,8 +1093,10 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_scale vector_scale( values.get(), v.values.get()); - internal::VectorOperations::parallel_for( - vector_scale, 0, partitioner->local_size(), thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_scale, + 0, + partitioner->local_size(), + thread_loop_partitioner); if (vector_is_ghosted) update_ghost_values(); @@ -1087,8 +1118,10 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_equ_au vector_equ( values.get(), v.values.get(), a); - internal::VectorOperations::parallel_for( - vector_equ, 0, partitioner->local_size(), thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_equ, + 0, + partitioner->local_size(), + thread_loop_partitioner); if (vector_is_ghosted) update_ghost_values(); @@ -1111,8 +1144,10 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_equ_aubv vector_equ( values.get(), v.values.get(), w.values.get(), a, b); - internal::VectorOperations::parallel_for( - vector_equ, 0, partitioner->local_size(), thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_equ, + 0, + partitioner->local_size(), + thread_loop_partitioner); if (vector_is_ghosted) update_ghost_values(); @@ -1363,8 +1398,10 @@ namespace LinearAlgebra AssertDimension(vec_size, w.local_size()); Number sum; - internal::VectorOperations::AddAndDot adder( - this->values.get(), v.values.get(), w.values.get(), a); + internal::VectorOperations::AddAndDot adder(this->values.get(), + v.values.get(), + w.values.get(), + a); internal::VectorOperations::parallel_reduce( adder, 0, vec_size, sum, thread_loop_partitioner); AssertIsFinite(sum); diff --git a/include/deal.II/lac/la_vector.h b/include/deal.II/lac/la_vector.h index 46e6116380..e27d903014 100644 --- a/include/deal.II/lac/la_vector.h +++ b/include/deal.II/lac/la_vector.h @@ -396,14 +396,15 @@ namespace LinearAlgebra /*--------------------------- Inline functions ----------------------------*/ template - inline Vector::Vector(const Vector &V) : - ReadWriteVector(V) + inline Vector::Vector(const Vector &V) + : ReadWriteVector(V) {} template - inline Vector::Vector(const size_type n) : ReadWriteVector(n) + inline Vector::Vector(const size_type n) + : ReadWriteVector(n) {} diff --git a/include/deal.II/lac/la_vector.templates.h b/include/deal.II/lac/la_vector.templates.h index 8b080c48f5..98ce6922d7 100644 --- a/include/deal.II/lac/la_vector.templates.h +++ b/include/deal.II/lac/la_vector.templates.h @@ -69,9 +69,9 @@ namespace LinearAlgebra // Downcast V. If fails, throws an exception. const Vector &down_V = dynamic_cast &>(V); - Assert( - down_V.size() == this->size(), - ExcMessage("Cannot add two vectors with different numbers of elements")); + Assert(down_V.size() == this->size(), + ExcMessage( + "Cannot add two vectors with different numbers of elements")); ReadWriteVector::reinit(down_V, omit_zeroing_entries); } @@ -91,8 +91,10 @@ namespace LinearAlgebra dealii::internal::VectorOperations::Vector_copy copier( in_vector.values.get(), this->values.get()); - internal::VectorOperations::parallel_for( - copier, 0, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(copier, + 0, + this->size(), + this->thread_loop_partitioner); return *this; } @@ -110,8 +112,10 @@ namespace LinearAlgebra dealii::internal::VectorOperations::Vector_copy copier( in_vector.values.get(), this->values.get()); - internal::VectorOperations::parallel_for( - copier, 0, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(copier, + 0, + this->size(), + this->thread_loop_partitioner); return *this; } @@ -128,8 +132,10 @@ namespace LinearAlgebra internal::VectorOperations::Vector_set setter(Number(), this->values.get()); - internal::VectorOperations::parallel_for( - setter, 0, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(setter, + 0, + this->size(), + this->thread_loop_partitioner); return *this; } @@ -144,8 +150,10 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_multiply_factor vector_multiply(this->values.get(), factor); - internal::VectorOperations::parallel_for( - vector_multiply, 0, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_multiply, + 0, + this->size(), + this->thread_loop_partitioner); return *this; } @@ -175,14 +183,16 @@ namespace LinearAlgebra // Downcast V. If fails, throws an exception. const Vector &down_V = dynamic_cast &>(V); - Assert( - down_V.size() == this->size(), - ExcMessage("Cannot add two vectors with different numbers of elements")); + Assert(down_V.size() == this->size(), + ExcMessage( + "Cannot add two vectors with different numbers of elements")); internal::VectorOperations::Vectorization_add_v vector_add( this->values.get(), down_V.values.get()); - internal::VectorOperations::parallel_for( - vector_add, 0, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add, + 0, + this->size(), + this->thread_loop_partitioner); return *this; } @@ -204,8 +214,10 @@ namespace LinearAlgebra "Cannot subtract two vectors with different numbers of elements")); internal::VectorOperations::Vectorization_subtract_v vector_subtract(this->values.get(), down_V.values.get()); - internal::VectorOperations::parallel_for( - vector_subtract, 0, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_subtract, + 0, + this->size(), + this->thread_loop_partitioner); return *this; } @@ -254,8 +266,10 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_add_factor vector_add( this->values.get(), a); - internal::VectorOperations::parallel_for( - vector_add, 0, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add, + 0, + this->size(), + this->thread_loop_partitioner); } @@ -271,14 +285,16 @@ namespace LinearAlgebra // Downcast V. If fails, throws an exception. const Vector &down_V = dynamic_cast &>(V); AssertIsFinite(a); - Assert( - down_V.size() == this->size(), - ExcMessage("Cannot add two vectors with different numbers of elements")); + Assert(down_V.size() == this->size(), + ExcMessage( + "Cannot add two vectors with different numbers of elements")); internal::VectorOperations::Vectorization_add_av vector_add_av( this->values.get(), down_V.values.get(), a); - internal::VectorOperations::parallel_for( - vector_add_av, 0, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add_av, + 0, + this->size(), + this->thread_loop_partitioner); } @@ -302,18 +318,20 @@ namespace LinearAlgebra // Downcast W. If fails, throws an exception. const Vector &down_W = dynamic_cast &>(W); AssertIsFinite(a); - Assert( - down_V.size() == this->size(), - ExcMessage("Cannot add two vectors with different numbers of elements")); + Assert(down_V.size() == this->size(), + ExcMessage( + "Cannot add two vectors with different numbers of elements")); AssertIsFinite(b); - Assert( - down_W.size() == this->size(), - ExcMessage("Cannot add two vectors with different numbers of elements")); + Assert(down_W.size() == this->size(), + ExcMessage( + "Cannot add two vectors with different numbers of elements")); internal::VectorOperations::Vectorization_add_avpbw vector_add( this->values.get(), down_V.values.get(), down_W.values.get(), a, b); - internal::VectorOperations::parallel_for( - vector_add, 0, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add, + 0, + this->size(), + this->thread_loop_partitioner); } @@ -335,8 +353,10 @@ namespace LinearAlgebra const Vector &down_V = dynamic_cast &>(V); internal::VectorOperations::Vectorization_sadd_xav vector_sadd_xav( this->values.get(), down_V.values.get(), a, s); - internal::VectorOperations::parallel_for( - vector_sadd_xav, 0, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_sadd_xav, + 0, + this->size(), + this->thread_loop_partitioner); } @@ -352,14 +372,16 @@ namespace LinearAlgebra // Downcast scaling_factors. If fails, throws an exception. const Vector &down_scaling_factors = dynamic_cast &>(scaling_factors); - Assert( - down_scaling_factors.size() == this->size(), - ExcMessage("Cannot add two vectors with different numbers of elements")); + Assert(down_scaling_factors.size() == this->size(), + ExcMessage( + "Cannot add two vectors with different numbers of elements")); internal::VectorOperations::Vectorization_scale vector_scale( this->values.get(), down_scaling_factors.values.get()); - internal::VectorOperations::parallel_for( - vector_scale, 0, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_scale, + 0, + this->size(), + this->thread_loop_partitioner); } @@ -378,8 +400,10 @@ namespace LinearAlgebra const Vector &down_V = dynamic_cast &>(V); internal::VectorOperations::Vectorization_equ_au vector_equ( this->values.get(), down_V.values.get(), a); - internal::VectorOperations::parallel_for( - vector_equ, 0, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_equ, + 0, + this->size(), + this->thread_loop_partitioner); } @@ -515,16 +539,18 @@ namespace LinearAlgebra // Downcast W. If fails, throws an exception. const Vector &down_W = dynamic_cast &>(W); AssertIsFinite(a); - Assert( - down_V.size() == this->size(), - ExcMessage("Cannot add two vectors with different numbers of elements")); - Assert( - down_W.size() == this->size(), - ExcMessage("Cannot add two vectors with different numbers of elements")); + Assert(down_V.size() == this->size(), + ExcMessage( + "Cannot add two vectors with different numbers of elements")); + Assert(down_W.size() == this->size(), + ExcMessage( + "Cannot add two vectors with different numbers of elements")); Number sum; - internal::VectorOperations::AddAndDot adder( - this->values.get(), down_V.values.get(), down_W.values.get(), a); + internal::VectorOperations::AddAndDot adder(this->values.get(), + down_V.values.get(), + down_W.values.get(), + a); internal::VectorOperations::parallel_reduce( adder, 0, this->size(), sum, this->thread_loop_partitioner); AssertIsFinite(sum); diff --git a/include/deal.II/lac/lapack_full_matrix.h b/include/deal.II/lac/lapack_full_matrix.h index 0d62e354a5..d48df437f7 100644 --- a/include/deal.II/lac/lapack_full_matrix.h +++ b/include/deal.II/lac/lapack_full_matrix.h @@ -1105,10 +1105,10 @@ void LAPACKFullMatrix::Tvmult_add(Vector &, const Vector &) const { - Assert( - false, - ExcMessage("LAPACKFullMatrix::Tvmult_add must be called with a " - "matching Vector vector type.")); + Assert(false, + ExcMessage( + "LAPACKFullMatrix::Tvmult_add must be called with a " + "matching Vector vector type.")); } diff --git a/include/deal.II/lac/linear_operator.h b/include/deal.II/lac/linear_operator.h index fa1299c04e..2415f2e8c9 100644 --- a/include/deal.II/lac/linear_operator.h +++ b/include/deal.II/lac/linear_operator.h @@ -167,9 +167,9 @@ public: * be used for any linear operator operations, and will throw an exception * upon invocation. */ - LinearOperator(const Payload &payload = Payload()) : - Payload(payload), - is_null_operator(false) + LinearOperator(const Payload &payload = Payload()) + : Payload(payload) + , is_null_operator(false) { vmult = [](Range &, const Domain &) { Assert(false, diff --git a/include/deal.II/lac/matrix_block.h b/include/deal.II/lac/matrix_block.h index 56302e28b9..fae68b2ae9 100644 --- a/include/deal.II/lac/matrix_block.h +++ b/include/deal.II/lac/matrix_block.h @@ -629,27 +629,27 @@ namespace internal template -inline MatrixBlock::MatrixBlock() : - row(numbers::invalid_size_type), - column(numbers::invalid_size_type) +inline MatrixBlock::MatrixBlock() + : row(numbers::invalid_size_type) + , column(numbers::invalid_size_type) {} template -inline MatrixBlock::MatrixBlock(const MatrixBlock &M) : - Subscriptor(), - row(M.row), - column(M.column), - matrix(M.matrix), - row_indices(M.row_indices), - column_indices(M.column_indices) +inline MatrixBlock::MatrixBlock(const MatrixBlock &M) + : Subscriptor() + , row(M.row) + , column(M.column) + , matrix(M.matrix) + , row_indices(M.row_indices) + , column_indices(M.column_indices) {} template -inline MatrixBlock::MatrixBlock(size_type i, size_type j) : - row(i), - column(j) +inline MatrixBlock::MatrixBlock(size_type i, size_type j) + : row(i) + , column(j) {} @@ -914,9 +914,9 @@ MatrixBlockVector::matrix(size_type i) template inline MGMatrixBlockVector::MGMatrixBlockVector(const bool e, - const bool f) : - edge_matrices(e), - edge_flux_matrices(f) + const bool f) + : edge_matrices(e) + , edge_flux_matrices(f) {} diff --git a/include/deal.II/lac/matrix_iterator.h b/include/deal.II/lac/matrix_iterator.h index 1c5e3b0fae..33e1c115a6 100644 --- a/include/deal.II/lac/matrix_iterator.h +++ b/include/deal.II/lac/matrix_iterator.h @@ -131,16 +131,16 @@ private: template inline MatrixIterator::MatrixIterator(MatrixType * matrix, const size_type r, - const size_type i) : - accessor(matrix, r, i) + const size_type i) + : accessor(matrix, r, i) {} template template inline MatrixIterator::MatrixIterator( - const MatrixIterator &other) : - accessor(other.accessor) + const MatrixIterator &other) + : accessor(other.accessor) {} diff --git a/include/deal.II/lac/packaged_operation.h b/include/deal.II/lac/packaged_operation.h index d642f000c0..676986660c 100644 --- a/include/deal.II/lac/packaged_operation.h +++ b/include/deal.II/lac/packaged_operation.h @@ -109,15 +109,15 @@ public: PackagedOperation() { apply = [](Range &) { - Assert( - false, - ExcMessage("Uninitialized PackagedOperation::apply called")); + Assert(false, + ExcMessage( + "Uninitialized PackagedOperation::apply called")); }; apply_add = [](Range &) { - Assert( - false, - ExcMessage("Uninitialized PackagedOperation::apply_add called")); + Assert(false, + ExcMessage( + "Uninitialized PackagedOperation::apply_add called")); }; reinit_vector = [](Range &, bool) { diff --git a/include/deal.II/lac/parpack_solver.h b/include/deal.II/lac/parpack_solver.h index 81d4530f46..512c08c74a 100644 --- a/include/deal.II/lac/parpack_solver.h +++ b/include/deal.II/lac/parpack_solver.h @@ -285,10 +285,10 @@ public: /** * Constructor. */ - Shift(const MatrixType &A, const MatrixType &B, const double sigma) : - A(A), - B(B), - sigma(sigma) + Shift(const MatrixType &A, const MatrixType &B, const double sigma) + : A(A) + , B(B) + , sigma(sigma) {} /** @@ -655,11 +655,11 @@ PArpackSolver::AdditionalData::AdditionalData( const unsigned int number_of_arnoldi_vectors, const WhichEigenvalues eigenvalue_of_interest, const bool symmetric, - const int mode) : - number_of_arnoldi_vectors(number_of_arnoldi_vectors), - eigenvalue_of_interest(eigenvalue_of_interest), - symmetric(symmetric), - mode(mode) + const int mode) + : number_of_arnoldi_vectors(number_of_arnoldi_vectors) + , eigenvalue_of_interest(eigenvalue_of_interest) + , symmetric(symmetric) + , mode(mode) { // Check for possible options for symmetric problems if (symmetric) @@ -690,20 +690,20 @@ PArpackSolver::AdditionalData::AdditionalData( template PArpackSolver::PArpackSolver(SolverControl & control, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - solver_control(control), - additional_data(data), - mpi_communicator(mpi_communicator), - mpi_communicator_fortran(MPI_Comm_c2f(mpi_communicator)), - lworkl(0), - nloc(0), - ncv(0), - ldv(0), - initial_vector_provided(false), - ldz(0), - lworkev(0), - sigmar(0.0), - sigmai(0.0) + const AdditionalData &data) + : solver_control(control) + , additional_data(data) + , mpi_communicator(mpi_communicator) + , mpi_communicator_fortran(MPI_Comm_c2f(mpi_communicator)) + , lworkl(0) + , nloc(0) + , ncv(0) + , ldv(0) + , initial_vector_provided(false) + , ldz(0) + , lworkev(0) + , sigmar(0.0) + , sigmai(0.0) {} @@ -725,8 +725,9 @@ PArpackSolver::set_initial_vector(const VectorType &vec) initial_vector_provided = true; Assert(resid.size() == local_indices.size(), ExcDimensionMismatch(resid.size(), local_indices.size())); - vec.extract_subvector_to( - local_indices.begin(), local_indices.end(), resid.data()); + vec.extract_subvector_to(local_indices.begin(), + local_indices.end(), + resid.data()); } @@ -844,9 +845,9 @@ PArpackSolver::solve(const MatrixType1 &system_matrix, { if (additional_data.symmetric) { - Assert( - n_eigenvalues <= eigenvectors.size(), - PArpackExcInvalidEigenvectorSize(n_eigenvalues, eigenvectors.size())); + Assert(n_eigenvalues <= eigenvectors.size(), + PArpackExcInvalidEigenvectorSize(n_eigenvalues, + eigenvectors.size())); } else Assert(n_eigenvalues + 1 <= eigenvectors.size(), @@ -1091,8 +1092,9 @@ PArpackSolver::solve(const MatrixType1 &system_matrix, // implemented modes // store the result - dst.extract_subvector_to( - local_indices.begin(), local_indices.end(), workd.data() + shift_y); + dst.extract_subvector_to(local_indices.begin(), + local_indices.end(), + workd.data() + shift_y); } // end of pd*aupd_ loop // 1 - compute eigenvectors, diff --git a/include/deal.II/lac/petsc_matrix_base.h b/include/deal.II/lac/petsc_matrix_base.h index 786dad8861..0f6364e611 100644 --- a/include/deal.II/lac/petsc_matrix_base.h +++ b/include/deal.II/lac/petsc_matrix_base.h @@ -1085,10 +1085,10 @@ namespace PETScWrappers { inline const_iterator::Accessor::Accessor(const MatrixBase *matrix, const size_type row, - const size_type index) : - matrix(const_cast(matrix)), - a_row(row), - a_index(index) + const size_type index) + : matrix(const_cast(matrix)) + , a_row(row) + , a_index(index) { visit_present_row(); } @@ -1129,8 +1129,8 @@ namespace PETScWrappers inline const_iterator::const_iterator(const MatrixBase *matrix, const size_type row, - const size_type index) : - accessor(matrix, row, index) + const size_type index) + : accessor(matrix, row, index) {} diff --git a/include/deal.II/lac/petsc_parallel_block_vector.h b/include/deal.II/lac/petsc_parallel_block_vector.h index e42df0b4d4..fec1b75008 100644 --- a/include/deal.II/lac/petsc_parallel_block_vector.h +++ b/include/deal.II/lac/petsc_parallel_block_vector.h @@ -309,8 +309,8 @@ namespace PETScWrappers } - inline BlockVector::BlockVector(const BlockVector &v) : - BlockVectorBase() + inline BlockVector::BlockVector(const BlockVector &v) + : BlockVectorBase() { this->components.resize(v.n_blocks()); this->block_indices = v.block_indices; @@ -388,8 +388,10 @@ namespace PETScWrappers this->components.resize(this->n_blocks()); for (unsigned int i = 0; i < this->n_blocks(); ++i) - this->components[i].reinit( - communicator, block_sizes[i], local_sizes[i], omit_zeroing_entries); + this->components[i].reinit(communicator, + block_sizes[i], + local_sizes[i], + omit_zeroing_entries); } @@ -434,8 +436,9 @@ namespace PETScWrappers this->components.resize(this->n_blocks()); for (unsigned int i = 0; i < this->n_blocks(); ++i) - block(i).reinit( - parallel_partitioning[i], ghost_entries[i], communicator); + block(i).reinit(parallel_partitioning[i], + ghost_entries[i], + communicator); } diff --git a/include/deal.II/lac/petsc_parallel_vector.h b/include/deal.II/lac/petsc_parallel_vector.h index bea846097c..d55969f180 100644 --- a/include/deal.II/lac/petsc_parallel_vector.h +++ b/include/deal.II/lac/petsc_parallel_vector.h @@ -441,8 +441,8 @@ namespace PETScWrappers template Vector::Vector(const MPI_Comm & communicator, const dealii::Vector &v, - const size_type local_size) : - communicator(communicator) + const size_type local_size) + : communicator(communicator) { Vector::create_vector(v.size(), local_size); diff --git a/include/deal.II/lac/petsc_vector_base.h b/include/deal.II/lac/petsc_vector_base.h index 8e9809489d..5dde843a66 100644 --- a/include/deal.II/lac/petsc_vector_base.h +++ b/include/deal.II/lac/petsc_vector_base.h @@ -839,9 +839,9 @@ namespace PETScWrappers namespace internal { inline VectorReference::VectorReference(const VectorBase &vector, - const size_type index) : - vector(vector), - index(index) + const size_type index) + : vector(vector) + , index(index) {} @@ -1132,8 +1132,9 @@ namespace PETScWrappers VectorBase::extract_subvector_to(const std::vector &indices, std::vector & values) const { - extract_subvector_to( - &(indices[0]), &(indices[0]) + indices.size(), &(values[0])); + extract_subvector_to(&(indices[0]), + &(indices[0]) + indices.size(), + &(values[0])); } template diff --git a/include/deal.II/lac/pointer_matrix.h b/include/deal.II/lac/pointer_matrix.h index d392407360..59c6cf4607 100644 --- a/include/deal.II/lac/pointer_matrix.h +++ b/include/deal.II/lac/pointer_matrix.h @@ -630,21 +630,21 @@ new_pointer_matrix_base(const TridiagonalMatrix &matrix, template -PointerMatrix::PointerMatrix(const MatrixType *M) : - m(M, typeid(*this).name()) +PointerMatrix::PointerMatrix(const MatrixType *M) + : m(M, typeid(*this).name()) {} template -PointerMatrix::PointerMatrix(const char *name) : - m(nullptr, name) +PointerMatrix::PointerMatrix(const char *name) + : m(nullptr, name) {} template PointerMatrix::PointerMatrix(const MatrixType *M, - const char * name) : - m(M, name) + const char * name) + : m(M, name) {} @@ -721,9 +721,9 @@ PointerMatrix::Tvmult_add(VectorType & dst, template PointerMatrixAux::PointerMatrixAux( VectorMemory *mem, - const MatrixType * M) : - mem(mem, typeid(*this).name()), - m(M, typeid(*this).name()) + const MatrixType * M) + : mem(mem, typeid(*this).name()) + , m(M, typeid(*this).name()) { if (mem == 0) mem = &my_memory; @@ -733,9 +733,9 @@ PointerMatrixAux::PointerMatrixAux( template PointerMatrixAux::PointerMatrixAux( VectorMemory *mem, - const char * name) : - mem(mem, name), - m(0, name) + const char * name) + : mem(mem, name) + , m(0, name) { if (mem == 0) mem = &my_memory; @@ -746,9 +746,9 @@ template PointerMatrixAux::PointerMatrixAux( VectorMemory *mem, const MatrixType * M, - const char * name) : - mem(mem, name), - m(M, name) + const char * name) + : mem(mem, name) + , m(M, name) { if (mem == nullptr) mem = &my_memory; @@ -857,20 +857,21 @@ PointerMatrixAux::Tvmult_add( template -PointerMatrixVector::PointerMatrixVector(const Vector *M) : - m(M, typeid(*this).name()) +PointerMatrixVector::PointerMatrixVector(const Vector *M) + : m(M, typeid(*this).name()) {} template -PointerMatrixVector::PointerMatrixVector(const char *name) : m(0, name) +PointerMatrixVector::PointerMatrixVector(const char *name) + : m(0, name) {} template PointerMatrixVector::PointerMatrixVector(const Vector *M, - const char * name) : - m(M, name) + const char * name) + : m(M, name) {} diff --git a/include/deal.II/lac/precondition.h b/include/deal.II/lac/precondition.h index ba61c5a903..1776ec2cd6 100644 --- a/include/deal.II/lac/precondition.h +++ b/include/deal.II/lac/precondition.h @@ -1207,7 +1207,9 @@ private: #ifndef DOXYGEN -inline PreconditionIdentity::PreconditionIdentity() : n_rows(0), n_columns(0) +inline PreconditionIdentity::PreconditionIdentity() + : n_rows(0) + , n_columns(0) {} template @@ -1269,15 +1271,15 @@ PreconditionIdentity::n() const //--------------------------------------------------------------------------- inline PreconditionRichardson::AdditionalData::AdditionalData( - const double relaxation) : - relaxation(relaxation) + const double relaxation) + : relaxation(relaxation) {} -inline PreconditionRichardson::PreconditionRichardson() : - relaxation(0), - n_rows(0), - n_columns(0) +inline PreconditionRichardson::PreconditionRichardson() + : relaxation(0) + , n_rows(0) + , n_columns(0) { AdditionalData add_data; relaxation = add_data.relaxation; @@ -1706,11 +1708,10 @@ template PreconditionPSOR::AdditionalData::AdditionalData( const std::vector &permutation, const std::vector &inverse_permutation, - const typename PreconditionRelaxation::AdditionalData - ¶meters) : - permutation(permutation), - inverse_permutation(inverse_permutation), - parameters(parameters) + const typename PreconditionRelaxation::AdditionalData ¶meters) + : permutation(permutation) + , inverse_permutation(inverse_permutation) + , parameters(parameters) {} @@ -1720,9 +1721,9 @@ PreconditionPSOR::AdditionalData::AdditionalData( template PreconditionUseMatrix::PreconditionUseMatrix( const MatrixType & M, - const function_ptr method) : - matrix(M), - precondition(method) + const function_ptr method) + : matrix(M) + , precondition(method) {} @@ -1740,8 +1741,8 @@ PreconditionUseMatrix::vmult( template inline PreconditionRelaxation::AdditionalData::AdditionalData( - const double relaxation) : - relaxation(relaxation) + const double relaxation) + : relaxation(relaxation) {} @@ -1802,16 +1803,16 @@ namespace internal const Number factor2, Number * update1, Number * update2, - Number * dst) : - src(src), - matrix_diagonal_inverse(matrix_diagonal_inverse), - do_startup(factor1 == Number()), - start_zero(start_zero), - factor1(factor1), - factor2(factor2), - update1(update1), - update2(update2), - dst(dst) + Number * dst) + : src(src) + , matrix_diagonal_inverse(matrix_diagonal_inverse) + , do_startup(factor1 == Number()) + , start_zero(start_zero) + , factor1(factor1) + , factor2(factor2) + , update1(update1) + , update2(update2) + , dst(dst) {} void @@ -1867,8 +1868,8 @@ namespace internal struct VectorUpdatesRange : public parallel::ParallelForInteger { VectorUpdatesRange(const VectorUpdater &updater, - const std::size_t size) : - updater(updater) + const std::size_t size) + : updater(updater) { if (size < internal::VectorImplementation::minimum_parallel_grain_size) apply_to_subrange(0, size); @@ -2059,23 +2060,23 @@ inline PreconditionChebyshev:: const bool nonzero_starting, const unsigned int eig_cg_n_iterations, const double eig_cg_residual, - const double max_eigenvalue) : - degree(degree), - smoothing_range(smoothing_range), - nonzero_starting(nonzero_starting), - eig_cg_n_iterations(eig_cg_n_iterations), - eig_cg_residual(eig_cg_residual), - max_eigenvalue(max_eigenvalue) + const double max_eigenvalue) + : degree(degree) + , smoothing_range(smoothing_range) + , nonzero_starting(nonzero_starting) + , eig_cg_n_iterations(eig_cg_n_iterations) + , eig_cg_residual(eig_cg_residual) + , max_eigenvalue(max_eigenvalue) {} template inline PreconditionChebyshev:: - PreconditionChebyshev() : - theta(1.), - delta(1.), - eigenvalues_are_initialized(false) + PreconditionChebyshev() + : theta(1.) + , delta(1.) + , eigenvalues_are_initialized(false) { static_assert( std::is_same::value, @@ -2137,9 +2138,9 @@ PreconditionChebyshev:: double max_eigenvalue, min_eigenvalue; if (data.eig_cg_n_iterations > 0) { - Assert( - data.eig_cg_n_iterations > 2, - ExcMessage("Need to set at least two iterations to find eigenvalues.")); + Assert(data.eig_cg_n_iterations > 2, + ExcMessage( + "Need to set at least two iterations to find eigenvalues.")); // set a very strict tolerance to force at least two iterations ReductionControl control( diff --git a/include/deal.II/lac/precondition_block.h b/include/deal.II/lac/precondition_block.h index 5a8df53aaa..a48b27553d 100644 --- a/include/deal.II/lac/precondition_block.h +++ b/include/deal.II/lac/precondition_block.h @@ -939,10 +939,10 @@ template inline PreconditionBlockJacobi::const_iterator:: Accessor::Accessor( const PreconditionBlockJacobi *matrix, - const size_type row) : - matrix(matrix), - b_iterator(&matrix->inverse(0), 0, 0), - b_end(&matrix->inverse(0), 0, 0) + const size_type row) + : matrix(matrix) + , b_iterator(&matrix->inverse(0), 0, 0) + , b_end(&matrix->inverse(0), 0, 0) { bs = matrix->block_size(); a_block = row / bs; @@ -998,8 +998,8 @@ template inline PreconditionBlockJacobi::const_iterator:: const_iterator( const PreconditionBlockJacobi *matrix, - const size_type row) : - accessor(matrix, row) + const size_type row) + : accessor(matrix, row) {} diff --git a/include/deal.II/lac/precondition_block.templates.h b/include/deal.II/lac/precondition_block.templates.h index 1e5ad0c05c..5ba63438cb 100644 --- a/include/deal.II/lac/precondition_block.templates.h +++ b/include/deal.II/lac/precondition_block.templates.h @@ -36,23 +36,23 @@ PreconditionBlock::AdditionalData::AdditionalData( const size_type block_size, const double relaxation, const bool invert_diagonal, - const bool same_diagonal) : - relaxation(relaxation), - block_size(block_size), - invert_diagonal(invert_diagonal), - same_diagonal(same_diagonal), - inversion(PreconditionBlockBase::gauss_jordan), - threshold(0.) + const bool same_diagonal) + : relaxation(relaxation) + , block_size(block_size) + , invert_diagonal(invert_diagonal) + , same_diagonal(same_diagonal) + , inversion(PreconditionBlockBase::gauss_jordan) + , threshold(0.) {} template -PreconditionBlock::PreconditionBlock(bool store) : - PreconditionBlockBase(store), - blocksize(0), - A(nullptr, typeid(*this).name()), - relaxation(1.0) +PreconditionBlock::PreconditionBlock(bool store) + : PreconditionBlockBase(store) + , blocksize(0) + , A(nullptr, typeid(*this).name()) + , relaxation(1.0) {} @@ -83,8 +83,10 @@ PreconditionBlock::initialize( blocksize = bsize; relaxation = parameters.relaxation; const unsigned int nblocks = A->m() / bsize; - this->reinit( - nblocks, blocksize, parameters.same_diagonal, parameters.inversion); + this->reinit(nblocks, + blocksize, + parameters.same_diagonal, + parameters.inversion); if (parameters.invert_diagonal) { @@ -698,15 +700,14 @@ PreconditionBlockJacobi::Tstep( template -PreconditionBlockSOR::PreconditionBlockSOR() : - PreconditionBlock(false) +PreconditionBlockSOR::PreconditionBlockSOR() + : PreconditionBlock(false) {} template -PreconditionBlockSOR::PreconditionBlockSOR( - bool store) : - PreconditionBlock(store) +PreconditionBlockSOR::PreconditionBlockSOR(bool store) + : PreconditionBlock(store) {} @@ -966,8 +967,8 @@ PreconditionBlockSOR::Tstep( template -PreconditionBlockSSOR::PreconditionBlockSSOR() : - PreconditionBlockSOR(true) +PreconditionBlockSSOR::PreconditionBlockSSOR() + : PreconditionBlockSOR(true) {} diff --git a/include/deal.II/lac/precondition_block_base.h b/include/deal.II/lac/precondition_block_base.h index 1163eff7a6..a6afe45769 100644 --- a/include/deal.II/lac/precondition_block_base.h +++ b/include/deal.II/lac/precondition_block_base.h @@ -301,12 +301,12 @@ private: template inline PreconditionBlockBase::PreconditionBlockBase(bool store, - Inversion method) : - inversion(method), - n_diagonal_blocks(0), - var_store_diagonals(store), - var_same_diagonal(false), - var_inverses_ready(false) + Inversion method) + : inversion(method) + , n_diagonal_blocks(0) + , var_store_diagonals(store) + , var_same_diagonal(false) + , var_inverses_ready(false) {} diff --git a/include/deal.II/lac/precondition_selector.h b/include/deal.II/lac/precondition_selector.h index b762b1e0a6..694028a02b 100644 --- a/include/deal.II/lac/precondition_selector.h +++ b/include/deal.II/lac/precondition_selector.h @@ -203,9 +203,9 @@ private: template PreconditionSelector::PreconditionSelector( const std::string & preconditioning, - const typename VectorType::value_type &omega) : - preconditioning(preconditioning), - omega(omega) + const typename VectorType::value_type &omega) + : preconditioning(preconditioning) + , omega(omega) {} diff --git a/include/deal.II/lac/read_write_vector.h b/include/deal.II/lac/read_write_vector.h index d063c54f3d..40ca5f91b2 100644 --- a/include/deal.II/lac/read_write_vector.h +++ b/include/deal.II/lac/read_write_vector.h @@ -710,9 +710,9 @@ namespace LinearAlgebra #ifndef DOXYGEN template - inline ReadWriteVector::ReadWriteVector() : - Subscriptor(), - values(nullptr, free) + inline ReadWriteVector::ReadWriteVector() + : Subscriptor() + , values(nullptr, free) { // virtual functions called in constructors and destructors never use the // override in a derived class @@ -724,9 +724,9 @@ namespace LinearAlgebra template inline ReadWriteVector::ReadWriteVector( - const ReadWriteVector &v) : - Subscriptor(), - values(nullptr, free) + const ReadWriteVector &v) + : Subscriptor() + , values(nullptr, free) { this->operator=(v); } @@ -734,9 +734,9 @@ namespace LinearAlgebra template - inline ReadWriteVector::ReadWriteVector(const size_type size) : - Subscriptor(), - values(nullptr, free) + inline ReadWriteVector::ReadWriteVector(const size_type size) + : Subscriptor() + , values(nullptr, free) { // virtual functions called in constructors and destructors never use the // override in a derived class @@ -748,9 +748,9 @@ namespace LinearAlgebra template inline ReadWriteVector::ReadWriteVector( - const IndexSet &locally_stored_indices) : - Subscriptor(), - values(nullptr, free) + const IndexSet &locally_stored_indices) + : Subscriptor() + , values(nullptr, free) { // virtual functions called in constructors and destructors never use the // override in a derived class @@ -966,9 +966,9 @@ namespace LinearAlgebra template inline ReadWriteVector::FunctorTemplate::FunctorTemplate( ReadWriteVector &parent, - const Functor & functor) : - parent(parent), - functor(functor) + const Functor & functor) + : parent(parent) + , functor(functor) {} diff --git a/include/deal.II/lac/read_write_vector.templates.h b/include/deal.II/lac/read_write_vector.templates.h index 602e121fbb..d577e4c7c7 100644 --- a/include/deal.II/lac/read_write_vector.templates.h +++ b/include/deal.II/lac/read_write_vector.templates.h @@ -64,8 +64,9 @@ namespace LinearAlgebra else { Number *new_values; - Utilities::System::posix_memalign( - (void **)&new_values, 64, sizeof(Number) * new_alloc_size); + Utilities::System::posix_memalign((void **)&new_values, + 64, + sizeof(Number) * new_alloc_size); values.reset(new_values); if (new_alloc_size >= 4 * dealii::internal::VectorImplementation:: @@ -177,8 +178,10 @@ namespace LinearAlgebra ReadWriteVector::apply(const Functor &func) { FunctorTemplate functor(*this, func); - internal::VectorOperations::parallel_for( - functor, 0, n_elements(), thread_loop_partitioner); + internal::VectorOperations::parallel_for(functor, + 0, + n_elements(), + thread_loop_partitioner); } @@ -196,8 +199,10 @@ namespace LinearAlgebra dealii::internal::VectorOperations::Vector_copy copier( in_vector.values.get(), values.get()); - dealii::internal::VectorOperations::parallel_for( - copier, 0, n_elements(), thread_loop_partitioner); + dealii::internal::VectorOperations::parallel_for(copier, + 0, + n_elements(), + thread_loop_partitioner); return *this; } @@ -215,8 +220,10 @@ namespace LinearAlgebra dealii::internal::VectorOperations::Vector_copy copier( in_vector.values.get(), values.get()); - dealii::internal::VectorOperations::parallel_for( - copier, 0, n_elements(), thread_loop_partitioner); + dealii::internal::VectorOperations::parallel_for(copier, + 0, + n_elements(), + thread_loop_partitioner); return *this; } @@ -391,10 +398,10 @@ namespace LinearAlgebra epetra_comm_pattern = std::dynamic_pointer_cast( communication_pattern); - AssertThrow( - epetra_comm_pattern != nullptr, - ExcMessage(std::string("The communication pattern is not of type ") + - "LinearAlgebra::EpetraWrappers::CommunicationPattern.")); + AssertThrow(epetra_comm_pattern != nullptr, + ExcMessage( + std::string("The communication pattern is not of type ") + + "LinearAlgebra::EpetraWrappers::CommunicationPattern.")); } Epetra_Import import(epetra_comm_pattern->get_epetra_import()); diff --git a/include/deal.II/lac/relaxation_block.templates.h b/include/deal.II/lac/relaxation_block.templates.h index 950751c0a2..ea8e13934b 100644 --- a/include/deal.II/lac/relaxation_block.templates.h +++ b/include/deal.II/lac/relaxation_block.templates.h @@ -32,13 +32,13 @@ inline RelaxationBlock:: const typename PreconditionBlockBase::Inversion inversion, const double threshold, - VectorType * temp_ghost_vector) : - relaxation(relaxation), - invert_diagonal(invert_diagonal), - same_diagonal(same_diagonal), - inversion(inversion), - threshold(threshold), - temp_ghost_vector(temp_ghost_vector) + VectorType * temp_ghost_vector) + : relaxation(relaxation) + , invert_diagonal(invert_diagonal) + , same_diagonal(same_diagonal) + , inversion(inversion) + , threshold(threshold) + , temp_ghost_vector(temp_ghost_vector) {} diff --git a/include/deal.II/lac/slepc_solver.h b/include/deal.II/lac/slepc_solver.h index e86e8f1690..ac75ad2668 100644 --- a/include/deal.II/lac/slepc_solver.h +++ b/include/deal.II/lac/slepc_solver.h @@ -681,9 +681,9 @@ namespace SLEPcWrappers if (n_converged > n_eigenpairs) n_converged = n_eigenpairs; - AssertThrow( - n_converged == n_eigenpairs, - ExcSLEPcEigenvectorConvergenceMismatchError(n_converged, n_eigenpairs)); + AssertThrow(n_converged == n_eigenpairs, + ExcSLEPcEigenvectorConvergenceMismatchError(n_converged, + n_eigenpairs)); AssertThrow(eigenvectors.size() != 0, ExcSLEPcWrappersUsageError()); eigenvectors.resize(n_converged, eigenvectors.front()); @@ -719,9 +719,9 @@ namespace SLEPcWrappers if (n_converged >= n_eigenpairs) n_converged = n_eigenpairs; - AssertThrow( - n_converged == n_eigenpairs, - ExcSLEPcEigenvectorConvergenceMismatchError(n_converged, n_eigenpairs)); + AssertThrow(n_converged == n_eigenpairs, + ExcSLEPcEigenvectorConvergenceMismatchError(n_converged, + n_eigenpairs)); AssertThrow(eigenvectors.size() != 0, ExcSLEPcWrappersUsageError()); eigenvectors.resize(n_converged, eigenvectors.front()); @@ -746,12 +746,12 @@ namespace SLEPcWrappers AssertThrow(A.n() == B.n(), ExcDimensionMismatch(A.n(), B.n())); // and incompatible eigenvalue/eigenvector sizes - AssertThrow( - real_eigenvalues.size() == imag_eigenvalues.size(), - ExcDimensionMismatch(real_eigenvalues.size(), imag_eigenvalues.size())); - AssertThrow( - real_eigenvectors.size() == imag_eigenvectors.size(), - ExcDimensionMismatch(real_eigenvectors.size(), imag_eigenvectors.size())); + AssertThrow(real_eigenvalues.size() == imag_eigenvalues.size(), + ExcDimensionMismatch(real_eigenvalues.size(), + imag_eigenvalues.size())); + AssertThrow(real_eigenvectors.size() == imag_eigenvectors.size(), + ExcDimensionMismatch(real_eigenvectors.size(), + imag_eigenvectors.size())); // Panic if the number of eigenpairs wanted is out of bounds. AssertThrow((n_eigenpairs > 0) && (n_eigenpairs <= A.m()), @@ -767,9 +767,9 @@ namespace SLEPcWrappers if (n_converged >= n_eigenpairs) n_converged = n_eigenpairs; - AssertThrow( - n_converged == n_eigenpairs, - ExcSLEPcEigenvectorConvergenceMismatchError(n_converged, n_eigenpairs)); + AssertThrow(n_converged == n_eigenpairs, + ExcSLEPcEigenvectorConvergenceMismatchError(n_converged, + n_eigenpairs)); AssertThrow((real_eigenvectors.size() != 0) && (imag_eigenvectors.size() != 0), ExcSLEPcWrappersUsageError()); diff --git a/include/deal.II/lac/solver.h b/include/deal.II/lac/solver.h index 4f56a6d476..6d258a5d55 100644 --- a/include/deal.II/lac/solver.h +++ b/include/deal.II/lac/solver.h @@ -449,11 +449,11 @@ protected: * signal is called, but not the vector that will be returned if the * signal's return value indicates that the iteration should be terminated. */ - boost::signals2::signal + boost::signals2::signal< + SolverControl::State(const unsigned int iteration, + const double check_value, + const VectorType & current_iterate), + StateCombiner> iteration_status; }; @@ -499,8 +499,8 @@ Solver::StateCombiner::operator()(const Iterator begin, template inline Solver::Solver(SolverControl & solver_control, - VectorMemory &vector_memory) : - memory(vector_memory) + VectorMemory &vector_memory) + : memory(vector_memory) { // connect the solver control object to the signal. SolverControl::check // only takes two arguments, the iteration and the check_value, and so @@ -515,8 +515,8 @@ inline Solver::Solver(SolverControl & solver_control, template -inline Solver::Solver(SolverControl &solver_control) : - // use the static memory object this class owns +inline Solver::Solver(SolverControl &solver_control) + : // use the static memory object this class owns memory(static_vector_memory) { // connect the solver control object to the signal. SolverControl::check diff --git a/include/deal.II/lac/solver_bicgstab.h b/include/deal.II/lac/solver_bicgstab.h index 5993d0d3de..3f06dc941b 100644 --- a/include/deal.II/lac/solver_bicgstab.h +++ b/include/deal.II/lac/solver_bicgstab.h @@ -144,9 +144,9 @@ public: * parameter 1e-10. */ explicit AdditionalData(const bool exact_residual = true, - const double breakdown = 1.e-10) : - exact_residual(exact_residual), - breakdown(breakdown) + const double breakdown = 1.e-10) + : exact_residual(exact_residual) + , breakdown(breakdown) {} /** * Flag for exact computation of residual. @@ -301,11 +301,11 @@ SolverBicgstab::IterationResult::IterationResult( const bool breakdown, const SolverControl::State state, const unsigned int last_step, - const double last_residual) : - breakdown(breakdown), - state(state), - last_step(last_step), - last_residual(last_residual) + const double last_residual) + : breakdown(breakdown) + , state(state) + , last_step(last_step) + , last_residual(last_residual) {} @@ -313,22 +313,22 @@ SolverBicgstab::IterationResult::IterationResult( template SolverBicgstab::SolverBicgstab(SolverControl & cn, VectorMemory &mem, - const AdditionalData & data) : - Solver(cn, mem), - Vx(nullptr), - Vb(nullptr), - additional_data(data) + const AdditionalData & data) + : Solver(cn, mem) + , Vx(nullptr) + , Vb(nullptr) + , additional_data(data) {} template SolverBicgstab::SolverBicgstab(SolverControl & cn, - const AdditionalData &data) : - Solver(cn), - Vx(nullptr), - Vb(nullptr), - additional_data(data) + const AdditionalData &data) + : Solver(cn) + , Vx(nullptr) + , Vb(nullptr) + , additional_data(data) {} @@ -515,9 +515,9 @@ SolverBicgstab::solve(const MatrixType & A, while (state.breakdown == true); // in case of failure: throw exception - AssertThrow( - state.state == SolverControl::success, - SolverControl::NoConvergence(state.last_step, state.last_residual)); + AssertThrow(state.state == SolverControl::success, + SolverControl::NoConvergence(state.last_step, + state.last_residual)); // otherwise exit as normal } diff --git a/include/deal.II/lac/solver_cg.h b/include/deal.II/lac/solver_cg.h index 05aeba2cd7..658645bd76 100644 --- a/include/deal.II/lac/solver_cg.h +++ b/include/deal.II/lac/solver_cg.h @@ -241,17 +241,17 @@ protected: template SolverCG::SolverCG(SolverControl & cn, VectorMemory &mem, - const AdditionalData & data) : - Solver(cn, mem), - additional_data(data) + const AdditionalData & data) + : Solver(cn, mem) + , additional_data(data) {} template -SolverCG::SolverCG(SolverControl &cn, const AdditionalData &data) : - Solver(cn), - additional_data(data) +SolverCG::SolverCG(SolverControl &cn, const AdditionalData &data) + : Solver(cn) + , additional_data(data) {} @@ -445,8 +445,10 @@ SolverCG::solve(const MatrixType & A, all_condition_numbers_signal); } - compute_eigs_and_cond( - diagonal, offdiagonal, eigenvalues_signal, condition_number_signal); + compute_eigs_and_cond(diagonal, + offdiagonal, + eigenvalues_signal, + condition_number_signal); // in case of failure: throw exception if (conv != SolverControl::success) diff --git a/include/deal.II/lac/solver_control.h b/include/deal.II/lac/solver_control.h index a6880a1042..905b887c40 100644 --- a/include/deal.II/lac/solver_control.h +++ b/include/deal.II/lac/solver_control.h @@ -94,9 +94,9 @@ public: class NoConvergence : public dealii::ExceptionBase { public: - NoConvergence(const unsigned int last_step, const double last_residual) : - last_step(last_step), - last_residual(last_residual) + NoConvergence(const unsigned int last_step, const double last_residual) + : last_step(last_step) + , last_residual(last_residual) {} virtual ~NoConvergence() noexcept override = default; diff --git a/include/deal.II/lac/solver_fire.h b/include/deal.II/lac/solver_fire.h index cac4144874..580f06b945 100644 --- a/include/deal.II/lac/solver_fire.h +++ b/include/deal.II/lac/solver_fire.h @@ -195,10 +195,10 @@ template SolverFIRE::AdditionalData::AdditionalData( const double initial_timestep, const double maximum_timestep, - const double maximum_linfty_norm) : - initial_timestep(initial_timestep), - maximum_timestep(maximum_timestep), - maximum_linfty_norm(maximum_linfty_norm) + const double maximum_linfty_norm) + : initial_timestep(initial_timestep) + , maximum_timestep(maximum_timestep) + , maximum_linfty_norm(maximum_linfty_norm) { AssertThrow(initial_timestep > 0. && maximum_timestep > 0. && maximum_linfty_norm > 0., @@ -212,18 +212,18 @@ SolverFIRE::AdditionalData::AdditionalData( template SolverFIRE::SolverFIRE(SolverControl & solver_control, VectorMemory &vector_memory, - const AdditionalData & data) : - Solver(solver_control, vector_memory), - additional_data(data) + const AdditionalData & data) + : Solver(solver_control, vector_memory) + , additional_data(data) {} template SolverFIRE::SolverFIRE(SolverControl & solver_control, - const AdditionalData &data) : - Solver(solver_control), - additional_data(data) + const AdditionalData &data) + : Solver(solver_control) + , additional_data(data) {} diff --git a/include/deal.II/lac/solver_gmres.h b/include/deal.II/lac/solver_gmres.h index 14863394e6..8fb6ce7786 100644 --- a/include/deal.II/lac/solver_gmres.h +++ b/include/deal.II/lac/solver_gmres.h @@ -474,8 +474,8 @@ public: * Constructor. By default, set the maximum basis size to 30. */ explicit AdditionalData(const unsigned int max_basis_size = 30, - const bool /*use_default_residual*/ = true) : - max_basis_size(max_basis_size) + const bool /*use_default_residual*/ = true) + : max_basis_size(max_basis_size) {} /** @@ -536,9 +536,9 @@ namespace internal { template inline TmpVectors::TmpVectors(const unsigned int max_size, - VectorMemory &vmem) : - mem(vmem), - data(max_size) + VectorMemory &vmem) + : mem(vmem) + , data(max_size) {} @@ -598,11 +598,11 @@ inline SolverGMRES::AdditionalData::AdditionalData( const unsigned int max_n_tmp_vectors, const bool right_preconditioning, const bool use_default_residual, - const bool force_re_orthogonalization) : - max_n_tmp_vectors(max_n_tmp_vectors), - right_preconditioning(right_preconditioning), - use_default_residual(use_default_residual), - force_re_orthogonalization(force_re_orthogonalization) + const bool force_re_orthogonalization) + : max_n_tmp_vectors(max_n_tmp_vectors) + , right_preconditioning(right_preconditioning) + , use_default_residual(use_default_residual) + , force_re_orthogonalization(force_re_orthogonalization) { Assert(3 <= max_n_tmp_vectors, ExcMessage("SolverGMRES needs at least three " @@ -614,18 +614,18 @@ inline SolverGMRES::AdditionalData::AdditionalData( template SolverGMRES::SolverGMRES(SolverControl & cn, VectorMemory &mem, - const AdditionalData & data) : - Solver(cn, mem), - additional_data(data) + const AdditionalData & data) + : Solver(cn, mem) + , additional_data(data) {} template SolverGMRES::SolverGMRES(SolverControl & cn, - const AdditionalData &data) : - Solver(cn), - additional_data(data) + const AdditionalData &data) + : Solver(cn) + , additional_data(data) {} @@ -682,8 +682,9 @@ SolverGMRES::modified_gram_schmidt( // Orthogonalization h(0) = vv * orthogonal_vectors[0]; for (unsigned int i = 1; i < dim; ++i) - h(i) = vv.add_and_dot( - -h(i - 1), orthogonal_vectors[i - 1], orthogonal_vectors[i]); + h(i) = vv.add_and_dot(-h(i - 1), + orthogonal_vectors[i - 1], + orthogonal_vectors[i]); double norm_vv = std::sqrt(vv.add_and_dot(-h(dim - 1), orthogonal_vectors[dim - 1], vv)); @@ -716,8 +717,9 @@ SolverGMRES::modified_gram_schmidt( h(0) += htmp; for (unsigned int i = 1; i < dim; ++i) { - htmp = vv.add_and_dot( - -htmp, orthogonal_vectors[i - 1], orthogonal_vectors[i]); + htmp = vv.add_and_dot(-htmp, + orthogonal_vectors[i - 1], + orthogonal_vectors[i]); h(i) += htmp; } norm_vv = @@ -1025,8 +1027,10 @@ SolverGMRES::solve(const MatrixType & A, const double preconditioned_res = x_->l2_norm(); last_res = preconditioned_res; - iteration_state = this->iteration_status( - accumulated_iterations, preconditioned_res, x); + iteration_state = + this->iteration_status(accumulated_iterations, + preconditioned_res, + x); } } }; @@ -1170,18 +1174,18 @@ SolverGMRES::criterion() template SolverFGMRES::SolverFGMRES(SolverControl & cn, VectorMemory &mem, - const AdditionalData & data) : - Solver(cn, mem), - additional_data(data) + const AdditionalData & data) + : Solver(cn, mem) + , additional_data(data) {} template SolverFGMRES::SolverFGMRES(SolverControl & cn, - const AdditionalData &data) : - Solver(cn), - additional_data(data) + const AdditionalData &data) + : Solver(cn) + , additional_data(data) {} diff --git a/include/deal.II/lac/solver_minres.h b/include/deal.II/lac/solver_minres.h index 7b477224ca..309efd3255 100644 --- a/include/deal.II/lac/solver_minres.h +++ b/include/deal.II/lac/solver_minres.h @@ -154,18 +154,18 @@ protected: template SolverMinRes::SolverMinRes(SolverControl & cn, VectorMemory &mem, - const AdditionalData &) : - Solver(cn, mem), - res2(numbers::signaling_nan()) + const AdditionalData &) + : Solver(cn, mem) + , res2(numbers::signaling_nan()) {} template SolverMinRes::SolverMinRes(SolverControl &cn, - const AdditionalData &) : - Solver(cn), - res2(numbers::signaling_nan()) + const AdditionalData &) + : Solver(cn) + , res2(numbers::signaling_nan()) {} diff --git a/include/deal.II/lac/solver_qmrs.h b/include/deal.II/lac/solver_qmrs.h index 9e849960b4..7edd90ca64 100644 --- a/include/deal.II/lac/solver_qmrs.h +++ b/include/deal.II/lac/solver_qmrs.h @@ -130,11 +130,11 @@ public: explicit AdditionalData(const bool left_preconditioning = false, const double solver_tolerance = 1.e-9, const bool breakdown_testing = true, - const double breakdown_threshold = 1.e-16) : - left_preconditioning(left_preconditioning), - solver_tolerance(solver_tolerance), - breakdown_testing(breakdown_testing), - breakdown_threshold(breakdown_threshold) + const double breakdown_threshold = 1.e-16) + : left_preconditioning(left_preconditioning) + , solver_tolerance(solver_tolerance) + , breakdown_testing(breakdown_testing) + , breakdown_threshold(breakdown_threshold) {} /** @@ -244,9 +244,9 @@ private: template SolverQMRS::IterationResult::IterationResult( const SolverControl::State state, - const double last_residual) : - state(state), - last_residual(last_residual) + const double last_residual) + : state(state) + , last_residual(last_residual) {} @@ -254,18 +254,18 @@ SolverQMRS::IterationResult::IterationResult( template SolverQMRS::SolverQMRS(SolverControl & cn, VectorMemory &mem, - const AdditionalData & data) : - Solver(cn, mem), - additional_data(data), - step(0) + const AdditionalData & data) + : Solver(cn, mem) + , additional_data(data) + , step(0) {} template SolverQMRS::SolverQMRS(SolverControl & cn, - const AdditionalData &data) : - Solver(cn), - additional_data(data), - step(0) + const AdditionalData &data) + : Solver(cn) + , additional_data(data) + , step(0) {} template diff --git a/include/deal.II/lac/solver_relaxation.h b/include/deal.II/lac/solver_relaxation.h index 25b5723511..dfa17fa1f6 100644 --- a/include/deal.II/lac/solver_relaxation.h +++ b/include/deal.II/lac/solver_relaxation.h @@ -94,8 +94,8 @@ public: template SolverRelaxation::SolverRelaxation(SolverControl &cn, - const AdditionalData &) : - Solver(cn) + const AdditionalData &) + : Solver(cn) {} diff --git a/include/deal.II/lac/solver_richardson.h b/include/deal.II/lac/solver_richardson.h index c3492e4097..b2a59fc349 100644 --- a/include/deal.II/lac/solver_richardson.h +++ b/include/deal.II/lac/solver_richardson.h @@ -165,27 +165,27 @@ protected: template inline SolverRichardson::AdditionalData::AdditionalData( const double omega, - const bool use_preconditioned_residual) : - omega(omega), - use_preconditioned_residual(use_preconditioned_residual) + const bool use_preconditioned_residual) + : omega(omega) + , use_preconditioned_residual(use_preconditioned_residual) {} template SolverRichardson::SolverRichardson(SolverControl & cn, VectorMemory &mem, - const AdditionalData & data) : - Solver(cn, mem), - additional_data(data) + const AdditionalData & data) + : Solver(cn, mem) + , additional_data(data) {} template SolverRichardson::SolverRichardson(SolverControl & cn, - const AdditionalData &data) : - Solver(cn), - additional_data(data) + const AdditionalData &data) + : Solver(cn) + , additional_data(data) {} diff --git a/include/deal.II/lac/sparse_decomposition.h b/include/deal.II/lac/sparse_decomposition.h index 16dc72af56..d89d692319 100644 --- a/include/deal.II/lac/sparse_decomposition.h +++ b/include/deal.II/lac/sparse_decomposition.h @@ -420,11 +420,11 @@ SparseLUDecomposition::AdditionalData::AdditionalData( const double strengthen_diag, const unsigned int extra_off_diag, const bool use_prev_sparsity, - const SparsityPattern *use_this_spars) : - strengthen_diagonal(strengthen_diag), - extra_off_diagonals(extra_off_diag), - use_previous_sparsity(use_prev_sparsity), - use_this_sparsity(use_this_spars) + const SparsityPattern *use_this_spars) + : strengthen_diagonal(strengthen_diag) + , extra_off_diagonals(extra_off_diag) + , use_previous_sparsity(use_prev_sparsity) + , use_this_sparsity(use_this_spars) {} diff --git a/include/deal.II/lac/sparse_decomposition.templates.h b/include/deal.II/lac/sparse_decomposition.templates.h index aa8be1a824..ba396f8cd5 100644 --- a/include/deal.II/lac/sparse_decomposition.templates.h +++ b/include/deal.II/lac/sparse_decomposition.templates.h @@ -30,10 +30,10 @@ DEAL_II_NAMESPACE_OPEN template -SparseLUDecomposition::SparseLUDecomposition() : - SparseMatrix(), - strengthen_diagonal(0), - own_sparsity(nullptr) +SparseLUDecomposition::SparseLUDecomposition() + : SparseMatrix() + , strengthen_diagonal(0) + , own_sparsity(nullptr) {} @@ -123,10 +123,10 @@ SparseLUDecomposition::initialize( } // now use this sparsity pattern - Assert( - sparsity_pattern_to_use->n_rows() == sparsity_pattern_to_use->n_cols(), - ExcMessage("It is not possible to compute this matrix decomposition for " - "matrices that are not square.")); + Assert(sparsity_pattern_to_use->n_rows() == sparsity_pattern_to_use->n_cols(), + ExcMessage( + "It is not possible to compute this matrix decomposition for " + "matrices that are not square.")); { std::vector tmp; tmp.swap(prebuilt_lower_bound); @@ -170,8 +170,9 @@ SparseLUDecomposition::copy_from(const SparseMatrix &matrix) number * this_ptr = this->val.get(); const number *const end_ptr = this_ptr + this->n_nonzero_elements(); if (std::is_same::value == true) - std::memcpy( - this_ptr, input_ptr, this->n_nonzero_elements() * sizeof(number)); + std::memcpy(this_ptr, + input_ptr, + this->n_nonzero_elements() * sizeof(number)); else for (; this_ptr != end_ptr; ++input_ptr, ++this_ptr) *this_ptr = *input_ptr; diff --git a/include/deal.II/lac/sparse_matrix.h b/include/deal.II/lac/sparse_matrix.h index 74c9a3f853..9b67d8c24b 100644 --- a/include/deal.II/lac/sparse_matrix.h +++ b/include/deal.II/lac/sparse_matrix.h @@ -2083,29 +2083,28 @@ SparseMatrix::copy_from(const ForwardIterator begin, namespace SparseMatrixIterators { template - inline Accessor::Accessor( - const MatrixType *matrix, - const std::size_t index_within_matrix) : - SparsityPatternIterators::Accessor(&matrix->get_sparsity_pattern(), - index_within_matrix), - matrix(matrix) + inline Accessor::Accessor(const MatrixType *matrix, + const std::size_t index_within_matrix) + : SparsityPatternIterators::Accessor(&matrix->get_sparsity_pattern(), + index_within_matrix) + , matrix(matrix) {} template - inline Accessor::Accessor(const MatrixType *matrix) : - SparsityPatternIterators::Accessor(&matrix->get_sparsity_pattern()), - matrix(matrix) + inline Accessor::Accessor(const MatrixType *matrix) + : SparsityPatternIterators::Accessor(&matrix->get_sparsity_pattern()) + , matrix(matrix) {} template inline Accessor::Accessor( - const SparseMatrixIterators::Accessor &a) : - SparsityPatternIterators::Accessor(a), - matrix(&a.get_matrix()) + const SparseMatrixIterators::Accessor &a) + : SparsityPatternIterators::Accessor(a) + , matrix(&a.get_matrix()) {} @@ -2131,8 +2130,8 @@ namespace SparseMatrixIterators template inline Accessor::Reference::Reference(const Accessor *accessor, - const bool) : - accessor(accessor) + const bool) + : accessor(accessor) {} @@ -2208,17 +2207,17 @@ namespace SparseMatrixIterators template inline Accessor::Accessor(MatrixType * matrix, - const std::size_t index) : - SparsityPatternIterators::Accessor(&matrix->get_sparsity_pattern(), index), - matrix(matrix) + const std::size_t index) + : SparsityPatternIterators::Accessor(&matrix->get_sparsity_pattern(), index) + , matrix(matrix) {} template - inline Accessor::Accessor(MatrixType *matrix) : - SparsityPatternIterators::Accessor(&matrix->get_sparsity_pattern()), - matrix(matrix) + inline Accessor::Accessor(MatrixType *matrix) + : SparsityPatternIterators::Accessor(&matrix->get_sparsity_pattern()) + , matrix(matrix) {} @@ -2243,23 +2242,23 @@ namespace SparseMatrixIterators template inline Iterator::Iterator(MatrixType * matrix, - const std::size_t index) : - accessor(matrix, index) + const std::size_t index) + : accessor(matrix, index) {} template - inline Iterator::Iterator(MatrixType *matrix) : - accessor(matrix) + inline Iterator::Iterator(MatrixType *matrix) + : accessor(matrix) {} template inline Iterator::Iterator( - const SparseMatrixIterators::Iterator &i) : - accessor(*i) + const SparseMatrixIterators::Iterator &i) + : accessor(*i) {} diff --git a/include/deal.II/lac/sparse_matrix.templates.h b/include/deal.II/lac/sparse_matrix.templates.h index b73efb2f23..273a25abcf 100644 --- a/include/deal.II/lac/sparse_matrix.templates.h +++ b/include/deal.II/lac/sparse_matrix.templates.h @@ -46,37 +46,37 @@ DEAL_II_NAMESPACE_OPEN template -SparseMatrix::SparseMatrix() : - cols(nullptr, "SparseMatrix"), - val(nullptr), - max_len(0) +SparseMatrix::SparseMatrix() + : cols(nullptr, "SparseMatrix") + , val(nullptr) + , max_len(0) {} template -SparseMatrix::SparseMatrix(const SparseMatrix &m) : - Subscriptor(m), - cols(nullptr, "SparseMatrix"), - val(nullptr), - max_len(0) +SparseMatrix::SparseMatrix(const SparseMatrix &m) + : Subscriptor(m) + , cols(nullptr, "SparseMatrix") + , val(nullptr) + , max_len(0) { - Assert( - m.cols == nullptr && m.val == nullptr && m.max_len == 0, - ExcMessage("This constructor can only be called if the provided argument " - "is an empty matrix. This constructor can not be used to " - "copy-construct a non-empty matrix. Use the " - "SparseMatrix::copy_from() function for that purpose.")); + Assert(m.cols == nullptr && m.val == nullptr && m.max_len == 0, + ExcMessage( + "This constructor can only be called if the provided argument " + "is an empty matrix. This constructor can not be used to " + "copy-construct a non-empty matrix. Use the " + "SparseMatrix::copy_from() function for that purpose.")); } template -SparseMatrix::SparseMatrix(SparseMatrix &&m) noexcept : - Subscriptor(std::move(m)), - cols(m.cols), - val(std::move(m.val)), - max_len(m.max_len) +SparseMatrix::SparseMatrix(SparseMatrix &&m) noexcept + : Subscriptor(std::move(m)) + , cols(m.cols) + , val(std::move(m.val)) + , max_len(m.max_len) { m.cols = nullptr; m.val = nullptr; @@ -119,10 +119,10 @@ SparseMatrix::operator=(SparseMatrix &&m) noexcept template -SparseMatrix::SparseMatrix(const SparsityPattern &c) : - cols(nullptr, "SparseMatrix"), - val(nullptr), - max_len(0) +SparseMatrix::SparseMatrix(const SparsityPattern &c) + : cols(nullptr, "SparseMatrix") + , val(nullptr) + , max_len(0) { // virtual functions called in constructors and destructors never use the // override in a derived class @@ -134,10 +134,10 @@ SparseMatrix::SparseMatrix(const SparsityPattern &c) : template SparseMatrix::SparseMatrix(const SparsityPattern &c, - const IdentityMatrix & id) : - cols(nullptr, "SparseMatrix"), - val(nullptr), - max_len(0) + const IdentityMatrix & id) + : cols(nullptr, "SparseMatrix") + , val(nullptr) + , max_len(0) { (void)id; Assert(c.n_rows() == id.m(), ExcDimensionMismatch(c.n_rows(), id.m())); @@ -385,8 +385,9 @@ SparseMatrix::copy_from(const SparseMatrix &matrix) Assert(val != nullptr, ExcNotInitialized()); Assert(cols == matrix.cols, ExcDifferentSparsityPatterns()); - std::copy( - matrix.val.get(), matrix.val.get() + cols->n_nonzero_elements(), val.get()); + std::copy(matrix.val.get(), + matrix.val.get() + cols->n_nonzero_elements(), + val.get()); return *this; } @@ -553,9 +554,9 @@ SparseMatrix::add(const size_type row, // really sorted #ifdef DEBUG for (size_type i = 1; i < n_cols; ++i) - Assert( - col_indices[i] > col_indices[i - 1], - ExcMessage("List of indices is unsorted or contains duplicates.")); + Assert(col_indices[i] > col_indices[i - 1], + ExcMessage( + "List of indices is unsorted or contains duplicates.")); #endif const size_type *this_cols = &cols->colnums[cols->rowstart[row]]; @@ -605,9 +606,9 @@ SparseMatrix::add(const size_type row, val_ptr[counter] += values[i]; } - Assert( - counter < cols->row_length(row), - ExcMessage("Specified invalid column indices in add function.")); + Assert(counter < cols->row_length(row), + ExcMessage( + "Specified invalid column indices in add function.")); } else { @@ -624,9 +625,9 @@ SparseMatrix::add(const size_type row, val_ptr[counter] += values[i]; } - Assert( - counter < cols->row_length(row), - ExcMessage("Specified invalid column indices in add function.")); + Assert(counter < cols->row_length(row), + ExcMessage( + "Specified invalid column indices in add function.")); } return; } @@ -1077,12 +1078,12 @@ SparseMatrix::mmult(SparseMatrix & C, // special treatment for diagonal if (sp_B.n_rows() == sp_B.n_cols()) { - C.add( - i, - *new_cols, - numberC(A_val) * - numberC(B.val[new_cols - &sp_B.colnums[sp_B.rowstart[0]]]) * - numberC(use_vector ? V(col) : 1)); + C.add(i, + *new_cols, + numberC(A_val) * + numberC( + B.val[new_cols - &sp_B.colnums[sp_B.rowstart[0]]]) * + numberC(use_vector ? V(col) : 1)); ++new_cols; } @@ -1216,12 +1217,12 @@ SparseMatrix::Tmmult(SparseMatrix & C, // special treatment for diagonal if (sp_B.n_rows() == sp_B.n_cols()) - C.add( - row, - i, - numberC(A_val) * - numberC(B.val[new_cols - 1 - &sp_B.colnums[sp_B.rowstart[0]]]) * - numberC(use_vector ? V(i) : 1)); + C.add(row, + i, + numberC(A_val) * + numberC( + B.val[new_cols - 1 - &sp_B.colnums[sp_B.rowstart[0]]]) * + numberC(use_vector ? V(i) : 1)); // now the innermost loop that goes over all the elements in row // 'col' of matrix B. Cache the elements, and then write them into C diff --git a/include/deal.II/lac/sparse_matrix_ez.h b/include/deal.II/lac/sparse_matrix_ez.h index b78de57a4c..2b0871ae27 100644 --- a/include/deal.II/lac/sparse_matrix_ez.h +++ b/include/deal.II/lac/sparse_matrix_ez.h @@ -916,23 +916,25 @@ private: template inline SparseMatrixEZ::Entry::Entry(const size_type column, - const number & value) : - column(column), - value(value) + const number & value) + : column(column) + , value(value) {} template -inline SparseMatrixEZ::Entry::Entry() : column(invalid), value(0) +inline SparseMatrixEZ::Entry::Entry() + : column(invalid) + , value(0) {} template -inline SparseMatrixEZ::RowInfo::RowInfo(const size_type start) : - start(start), - length(0), - diagonal(invalid_diagonal) +inline SparseMatrixEZ::RowInfo::RowInfo(const size_type start) + : start(start) + , length(0) + , diagonal(invalid_diagonal) {} @@ -941,10 +943,10 @@ template inline SparseMatrixEZ::const_iterator::Accessor::Accessor( const SparseMatrixEZ *matrix, const size_type r, - const unsigned short i) : - matrix(matrix), - a_row(r), - a_index(i) + const unsigned short i) + : matrix(matrix) + , a_row(r) + , a_index(i) {} @@ -985,8 +987,8 @@ template inline SparseMatrixEZ::const_iterator::const_iterator( const SparseMatrixEZ *matrix, const size_type r, - const unsigned short i) : - accessor(matrix, r, i) + const unsigned short i) + : accessor(matrix, r, i) { // Finish if this is the end() if (r == accessor.matrix->m() && i == 0) diff --git a/include/deal.II/lac/sparse_matrix_ez.templates.h b/include/deal.II/lac/sparse_matrix_ez.templates.h index a9a21292bc..03b941ae6d 100644 --- a/include/deal.II/lac/sparse_matrix_ez.templates.h +++ b/include/deal.II/lac/sparse_matrix_ez.templates.h @@ -30,26 +30,26 @@ DEAL_II_NAMESPACE_OPEN //--------------------------------------------------------------------------- template -SparseMatrixEZ::SparseMatrixEZ() : - n_columns(0), - increment(1), - saved_default_row_length(0) +SparseMatrixEZ::SparseMatrixEZ() + : n_columns(0) + , increment(1) + , saved_default_row_length(0) {} template -SparseMatrixEZ::SparseMatrixEZ(const SparseMatrixEZ &m) : - Subscriptor(m), - n_columns(0), - increment(m.increment), - saved_default_row_length(m.saved_default_row_length) +SparseMatrixEZ::SparseMatrixEZ(const SparseMatrixEZ &m) + : Subscriptor(m) + , n_columns(0) + , increment(m.increment) + , saved_default_row_length(m.saved_default_row_length) { - Assert( - m.m() == 0 && m.n() == 0, - ExcMessage("This constructor can only be called if the provided argument " - "is an empty matrix. This constructor can not be used to " - "copy-construct a non-empty matrix. Use the " - "SparseMatrixEZ::copy_from() function for that purpose.")); + Assert(m.m() == 0 && m.n() == 0, + ExcMessage( + "This constructor can only be called if the provided argument " + "is an empty matrix. This constructor can not be used to " + "copy-construct a non-empty matrix. Use the " + "SparseMatrixEZ::copy_from() function for that purpose.")); } diff --git a/include/deal.II/lac/sparse_mic.templates.h b/include/deal.II/lac/sparse_mic.templates.h index 9919c7b051..2bfd3209ec 100644 --- a/include/deal.II/lac/sparse_mic.templates.h +++ b/include/deal.II/lac/sparse_mic.templates.h @@ -25,7 +25,10 @@ DEAL_II_NAMESPACE_OPEN template -SparseMIC::SparseMIC() : diag(0), inv_diag(0), inner_sums(0) +SparseMIC::SparseMIC() + : diag(0) + , inv_diag(0) + , inner_sums(0) {} diff --git a/include/deal.II/lac/sparse_vanka.templates.h b/include/deal.II/lac/sparse_vanka.templates.h index b70de93884..a83f567d50 100644 --- a/include/deal.II/lac/sparse_vanka.templates.h +++ b/include/deal.II/lac/sparse_vanka.templates.h @@ -31,28 +31,28 @@ DEAL_II_NAMESPACE_OPEN template -SparseVanka::SparseVanka() : - matrix(), - conserve_mem(false), - selected(), - n_threads(0), - inverses(), - _m(0), - _n(0) +SparseVanka::SparseVanka() + : matrix() + , conserve_mem(false) + , selected() + , n_threads(0) + , inverses() + , _m(0) + , _n(0) {} template SparseVanka::SparseVanka(const SparseMatrix &M, const std::vector & selected_dofs, const bool conserve_mem, - const unsigned int n_threads) : - matrix(&M, typeid(*this).name()), - conserve_mem(conserve_mem), - selected(&selected_dofs), - n_threads(n_threads), - inverses(M.m(), nullptr), - _m(M.m()), - _n(M.n()) + const unsigned int n_threads) + : matrix(&M, typeid(*this).name()) + , conserve_mem(conserve_mem) + , selected(&selected_dofs) + , n_threads(n_threads) + , inverses(M.m(), nullptr) + , _m(M.m()) + , _n(M.n()) { Assert(M.m() == M.n(), ExcNotQuadratic()); Assert(M.m() == selected->size(), @@ -158,8 +158,10 @@ SparseVanka::compute_inverses() // Now spawn the threads Threads::ThreadGroup<> threads; for (unsigned int i = 0; i < n_threads; ++i) - threads += Threads::new_thread( - fun_ptr, *this, blocking[i].first, blocking[i].second); + threads += Threads::new_thread(fun_ptr, + *this, + blocking[i].first, + blocking[i].second); threads.join_all(); #endif } @@ -308,8 +310,9 @@ SparseVanka::apply_preconditioner( // couple with @p row. local_index.clear(); for (size_type i = 0; i < row_length; ++i) - local_index.insert(std::pair( - structure.column_number(row, i), i)); + local_index.insert( + std::pair(structure.column_number(row, i), + i)); // Build local matrix and rhs for (std::map::const_iterator is = @@ -412,10 +415,10 @@ template SparseVanka::AdditionalData::AdditionalData( const std::vector &selected, const bool conserve_mem, - const unsigned int n_threads) : - selected(selected), - conserve_mem(conserve_mem), - n_threads(n_threads) + const unsigned int n_threads) + : selected(selected) + , conserve_mem(conserve_mem) + , n_threads(n_threads) {} @@ -429,10 +432,10 @@ SparseBlockVanka::SparseBlockVanka( const unsigned int n_blocks, const BlockingStrategy blocking_strategy, const bool conserve_memory, - const unsigned int n_threads) : - SparseVanka(M, selected, conserve_memory, n_threads), - n_blocks(n_blocks), - dof_masks(n_blocks, std::vector(M.m(), false)) + const unsigned int n_threads) + : SparseVanka(M, selected, conserve_memory, n_threads) + , n_blocks(n_blocks) + , dof_masks(n_blocks, std::vector(M.m(), false)) { compute_dof_masks(M, selected, blocking_strategy); } @@ -630,10 +633,10 @@ SparseBlockVanka::vmult(Vector & dst, // simpler for the compiler // by giving it the correct // type right away: - typedef void (SparseVanka::*mem_fun_p)( - Vector &, - const Vector &, - const std::vector *const) const; + typedef void ( + SparseVanka::*mem_fun_p)(Vector &, + const Vector &, + const std::vector *const) const; const mem_fun_p comp = &SparseVanka::template apply_preconditioner; Threads::ThreadGroup<> threads; diff --git a/include/deal.II/lac/sparsity_pattern.h b/include/deal.II/lac/sparsity_pattern.h index 7d4885faa4..3141362836 100644 --- a/include/deal.II/lac/sparsity_pattern.h +++ b/include/deal.II/lac/sparsity_pattern.h @@ -1193,16 +1193,16 @@ private: namespace SparsityPatternIterators { inline Accessor::Accessor(const SparsityPattern *sparsity_pattern, - const std::size_t i) : - sparsity_pattern(sparsity_pattern), - index_within_sparsity(i) + const std::size_t i) + : sparsity_pattern(sparsity_pattern) + , index_within_sparsity(i) {} - inline Accessor::Accessor(const SparsityPattern *sparsity_pattern) : - sparsity_pattern(sparsity_pattern), - index_within_sparsity(sparsity_pattern->rowstart[sparsity_pattern->rows]) + inline Accessor::Accessor(const SparsityPattern *sparsity_pattern) + : sparsity_pattern(sparsity_pattern) + , index_within_sparsity(sparsity_pattern->rowstart[sparsity_pattern->rows]) {} @@ -1223,10 +1223,11 @@ namespace SparsityPatternIterators { Assert(is_valid_entry() == true, ExcInvalidIterator()); - const std::size_t *insert_point = std::upper_bound( - sparsity_pattern->rowstart.get(), - sparsity_pattern->rowstart.get() + sparsity_pattern->rows + 1, - index_within_sparsity); + const std::size_t *insert_point = + std::upper_bound(sparsity_pattern->rowstart.get(), + sparsity_pattern->rowstart.get() + + sparsity_pattern->rows + 1, + index_within_sparsity); return insert_point - sparsity_pattern->rowstart.get() - 1; } @@ -1292,8 +1293,8 @@ namespace SparsityPatternIterators inline Iterator::Iterator(const SparsityPattern *sparsity_pattern, - const std::size_t i) : - accessor(sparsity_pattern, i) + const std::size_t i) + : accessor(sparsity_pattern, i) {} diff --git a/include/deal.II/lac/swappable_vector.templates.h b/include/deal.II/lac/swappable_vector.templates.h index b099f7d221..5b109df84a 100644 --- a/include/deal.II/lac/swappable_vector.templates.h +++ b/include/deal.II/lac/swappable_vector.templates.h @@ -27,16 +27,17 @@ DEAL_II_NAMESPACE_OPEN template -SwappableVector::SwappableVector() : data_is_preloaded(false) +SwappableVector::SwappableVector() + : data_is_preloaded(false) {} template -SwappableVector::SwappableVector(const SwappableVector &v) : - Vector(v), - filename(), - data_is_preloaded(false) +SwappableVector::SwappableVector(const SwappableVector &v) + : Vector(v) + , filename() + , data_is_preloaded(false) { Assert(v.filename == "", ExcInvalidCopyOperation()); } diff --git a/include/deal.II/lac/tensor_product_matrix.h b/include/deal.II/lac/tensor_product_matrix.h index 7883cfeb18..5d3c09e4bf 100644 --- a/include/deal.II/lac/tensor_product_matrix.h +++ b/include/deal.II/lac/tensor_product_matrix.h @@ -705,16 +705,18 @@ TensorProductMatrixSymmetricSum::reinit( std::array, dim> mass_copy; std::array, dim> deriv_copy; - std::transform( - mass_matrix.cbegin(), - mass_matrix.cend(), - mass_copy.begin(), - [](const FullMatrix &m) -> Table<2, Number> { return m; }); - std::transform( - derivative_matrix.cbegin(), - derivative_matrix.cend(), - deriv_copy.begin(), - [](const FullMatrix &m) -> Table<2, Number> { return m; }); + std::transform(mass_matrix.cbegin(), + mass_matrix.cend(), + mass_copy.begin(), + [](const FullMatrix &m) -> Table<2, Number> { + return m; + }); + std::transform(derivative_matrix.cbegin(), + derivative_matrix.cend(), + deriv_copy.begin(), + [](const FullMatrix &m) -> Table<2, Number> { + return m; + }); reinit_impl(std::move(mass_copy), std::move(deriv_copy)); } @@ -731,8 +733,9 @@ TensorProductMatrixSymmetricSum::reinit( std::array, dim> derivative_matrices; std::fill(mass_matrices.begin(), mass_matrices.end(), mass_matrix); - std::fill( - derivative_matrices.begin(), derivative_matrices.end(), derivative_matrix); + std::fill(derivative_matrices.begin(), + derivative_matrices.end(), + derivative_matrix); reinit_impl(std::move(mass_matrices), std::move(derivative_matrices)); } @@ -871,8 +874,9 @@ TensorProductMatrixSymmetricSum, size>::reinit( std::array>, dim> derivative_matrices; std::fill(mass_matrices.begin(), mass_matrices.end(), mass_matrix); - std::fill( - derivative_matrices.begin(), derivative_matrices.end(), derivative_matrix); + std::fill(derivative_matrices.begin(), + derivative_matrices.end(), + derivative_matrix); reinit_impl(std::move(mass_matrices), std::move(derivative_matrices)); } diff --git a/include/deal.II/lac/trilinos_parallel_block_vector.h b/include/deal.II/lac/trilinos_parallel_block_vector.h index 479f70e5df..ae356ac7e3 100644 --- a/include/deal.II/lac/trilinos_parallel_block_vector.h +++ b/include/deal.II/lac/trilinos_parallel_block_vector.h @@ -326,8 +326,10 @@ namespace TrilinosWrappers const MPI_Comm & communicator, const bool vector_writable) { - reinit( - parallel_partitioning, ghost_values, communicator, vector_writable); + reinit(parallel_partitioning, + ghost_values, + communicator, + vector_writable); } @@ -339,8 +341,8 @@ namespace TrilinosWrappers - inline BlockVector::BlockVector(const BlockVector &v) : - dealii::BlockVectorBase() + inline BlockVector::BlockVector(const BlockVector &v) + : dealii::BlockVectorBase() { this->components.resize(v.n_blocks()); this->block_indices = v.block_indices; diff --git a/include/deal.II/lac/trilinos_precondition.h b/include/deal.II/lac/trilinos_precondition.h index ce33b12619..316b245f28 100644 --- a/include/deal.II/lac/trilinos_precondition.h +++ b/include/deal.II/lac/trilinos_precondition.h @@ -2015,8 +2015,9 @@ namespace TrilinosWrappers preconditioner->OperatorDomainMap().NumMyElements()); AssertDimension(static_cast(src.size()), preconditioner->OperatorRangeMap().NumMyElements()); - Epetra_Vector tril_dst( - View, preconditioner->OperatorDomainMap(), dst.begin()); + Epetra_Vector tril_dst(View, + preconditioner->OperatorDomainMap(), + dst.begin()); Epetra_Vector tril_src(View, preconditioner->OperatorRangeMap(), const_cast(src.begin())); @@ -2034,8 +2035,9 @@ namespace TrilinosWrappers preconditioner->OperatorDomainMap().NumMyElements()); AssertDimension(static_cast(src.size()), preconditioner->OperatorRangeMap().NumMyElements()); - Epetra_Vector tril_dst( - View, preconditioner->OperatorDomainMap(), dst.begin()); + Epetra_Vector tril_dst(View, + preconditioner->OperatorDomainMap(), + dst.begin()); Epetra_Vector tril_src(View, preconditioner->OperatorRangeMap(), const_cast(src.begin())); @@ -2053,14 +2055,15 @@ namespace TrilinosWrappers LinearAlgebra::distributed::Vector & dst, const LinearAlgebra::distributed::Vector &src) const { - AssertDimension( - static_cast(dst.local_size()), - preconditioner->OperatorDomainMap().NumMyElements()); - AssertDimension( - static_cast(src.local_size()), - preconditioner->OperatorRangeMap().NumMyElements()); - Epetra_Vector tril_dst( - View, preconditioner->OperatorDomainMap(), dst.begin()); + AssertDimension(static_cast( + dst.local_size()), + preconditioner->OperatorDomainMap().NumMyElements()); + AssertDimension(static_cast( + src.local_size()), + preconditioner->OperatorRangeMap().NumMyElements()); + Epetra_Vector tril_dst(View, + preconditioner->OperatorDomainMap(), + dst.begin()); Epetra_Vector tril_src(View, preconditioner->OperatorRangeMap(), const_cast(src.begin())); @@ -2074,14 +2077,15 @@ namespace TrilinosWrappers LinearAlgebra::distributed::Vector & dst, const LinearAlgebra::distributed::Vector &src) const { - AssertDimension( - static_cast(dst.local_size()), - preconditioner->OperatorDomainMap().NumMyElements()); - AssertDimension( - static_cast(src.local_size()), - preconditioner->OperatorRangeMap().NumMyElements()); - Epetra_Vector tril_dst( - View, preconditioner->OperatorDomainMap(), dst.begin()); + AssertDimension(static_cast( + dst.local_size()), + preconditioner->OperatorDomainMap().NumMyElements()); + AssertDimension(static_cast( + src.local_size()), + preconditioner->OperatorRangeMap().NumMyElements()); + Epetra_Vector tril_dst(View, + preconditioner->OperatorDomainMap(), + dst.begin()); Epetra_Vector tril_src(View, preconditioner->OperatorRangeMap(), const_cast(src.begin())); diff --git a/include/deal.II/lac/trilinos_sparse_matrix.h b/include/deal.II/lac/trilinos_sparse_matrix.h index c41cc74318..ef7cff6901 100644 --- a/include/deal.II/lac/trilinos_sparse_matrix.h +++ b/include/deal.II/lac/trilinos_sparse_matrix.h @@ -2160,21 +2160,21 @@ namespace TrilinosWrappers { if (transpose == false) { - Assert( - src.Map().SameAs(mtrx.DomainMap()) == true, - ExcMessage("Column map of matrix does not fit with vector map!")); - Assert( - dst.Map().SameAs(mtrx.RangeMap()) == true, - ExcMessage("Row map of matrix does not fit with vector map!")); + Assert(src.Map().SameAs(mtrx.DomainMap()) == true, + ExcMessage( + "Column map of matrix does not fit with vector map!")); + Assert(dst.Map().SameAs(mtrx.RangeMap()) == true, + ExcMessage( + "Row map of matrix does not fit with vector map!")); } else { - Assert( - src.Map().SameAs(mtrx.RangeMap()) == true, - ExcMessage("Column map of matrix does not fit with vector map!")); - Assert( - dst.Map().SameAs(mtrx.DomainMap()) == true, - ExcMessage("Row map of matrix does not fit with vector map!")); + Assert(src.Map().SameAs(mtrx.RangeMap()) == true, + ExcMessage( + "Column map of matrix does not fit with vector map!")); + Assert(dst.Map().SameAs(mtrx.DomainMap()) == true, + ExcMessage( + "Row map of matrix does not fit with vector map!")); } (void)mtrx; // removes -Wunused-variable in optimized mode (void)src; @@ -2192,18 +2192,18 @@ namespace TrilinosWrappers Assert(src.Map().SameAs(op.OperatorDomainMap()) == true, ExcMessage( "Column map of operator does not fit with vector map!")); - Assert( - dst.Map().SameAs(op.OperatorRangeMap()) == true, - ExcMessage("Row map of operator does not fit with vector map!")); + Assert(dst.Map().SameAs(op.OperatorRangeMap()) == true, + ExcMessage( + "Row map of operator does not fit with vector map!")); } else { Assert(src.Map().SameAs(op.OperatorRangeMap()) == true, ExcMessage( "Column map of operator does not fit with vector map!")); - Assert( - dst.Map().SameAs(op.OperatorDomainMap()) == true, - ExcMessage("Row map of operator does not fit with vector map!")); + Assert(dst.Map().SameAs(op.OperatorDomainMap()) == true, + ExcMessage( + "Row map of operator does not fit with vector map!")); } (void)op; // removes -Wunused-variable in optimized mode (void)src; @@ -2643,10 +2643,10 @@ namespace TrilinosWrappers { inline AccessorBase::AccessorBase(SparseMatrix *matrix, size_type row, - size_type index) : - matrix(matrix), - a_row(row), - a_index(index) + size_type index) + : matrix(matrix) + , a_row(row) + , a_index(index) { visit_present_row(); } @@ -2678,14 +2678,14 @@ namespace TrilinosWrappers inline Accessor::Accessor(MatrixType * matrix, const size_type row, - const size_type index) : - AccessorBase(const_cast(matrix), row, index) + const size_type index) + : AccessorBase(const_cast(matrix), row, index) {} template - inline Accessor::Accessor(const Accessor &other) : - AccessorBase(other) + inline Accessor::Accessor(const Accessor &other) + : AccessorBase(other) {} @@ -2697,8 +2697,8 @@ namespace TrilinosWrappers } - inline Accessor::Reference::Reference(const Accessor &acc) : - accessor(const_cast &>(acc)) + inline Accessor::Reference::Reference(const Accessor &acc) + : accessor(const_cast &>(acc)) {} @@ -2711,8 +2711,9 @@ namespace TrilinosWrappers Accessor::Reference::operator=(const TrilinosScalar n) const { (*accessor.value_cache)[accessor.a_index] = n; - accessor.matrix->set( - accessor.row(), accessor.column(), static_cast(*this)); + accessor.matrix->set(accessor.row(), + accessor.column(), + static_cast(*this)); return *this; } @@ -2721,8 +2722,9 @@ namespace TrilinosWrappers Accessor::Reference::operator+=(const TrilinosScalar n) const { (*accessor.value_cache)[accessor.a_index] += n; - accessor.matrix->set( - accessor.row(), accessor.column(), static_cast(*this)); + accessor.matrix->set(accessor.row(), + accessor.column(), + static_cast(*this)); return *this; } @@ -2731,8 +2733,9 @@ namespace TrilinosWrappers Accessor::Reference::operator-=(const TrilinosScalar n) const { (*accessor.value_cache)[accessor.a_index] -= n; - accessor.matrix->set( - accessor.row(), accessor.column(), static_cast(*this)); + accessor.matrix->set(accessor.row(), + accessor.column(), + static_cast(*this)); return *this; } @@ -2741,8 +2744,9 @@ namespace TrilinosWrappers Accessor::Reference::operator*=(const TrilinosScalar n) const { (*accessor.value_cache)[accessor.a_index] *= n; - accessor.matrix->set( - accessor.row(), accessor.column(), static_cast(*this)); + accessor.matrix->set(accessor.row(), + accessor.column(), + static_cast(*this)); return *this; } @@ -2751,16 +2755,17 @@ namespace TrilinosWrappers Accessor::Reference::operator/=(const TrilinosScalar n) const { (*accessor.value_cache)[accessor.a_index] /= n; - accessor.matrix->set( - accessor.row(), accessor.column(), static_cast(*this)); + accessor.matrix->set(accessor.row(), + accessor.column(), + static_cast(*this)); return *this; } inline Accessor::Accessor(MatrixType * matrix, const size_type row, - const size_type index) : - AccessorBase(matrix, row, index) + const size_type index) + : AccessorBase(matrix, row, index) {} @@ -2776,15 +2781,15 @@ namespace TrilinosWrappers template inline Iterator::Iterator(MatrixType * matrix, const size_type row, - const size_type index) : - accessor(matrix, row, index) + const size_type index) + : accessor(matrix, row, index) {} template template - inline Iterator::Iterator(const Iterator &other) : - accessor(other.accessor) + inline Iterator::Iterator(const Iterator &other) + : accessor(other.accessor) {} @@ -3055,8 +3060,9 @@ namespace TrilinosWrappers if (last_action == Insert) { int ierr; - ierr = matrix->GlobalAssemble( - *column_space_map, matrix->RowMap(), false); + ierr = matrix->GlobalAssemble(*column_space_map, + matrix->RowMap(), + false); Assert(ierr == 0, ExcTrilinosError(ierr)); (void)ierr; // removes -Wunused-but-set-variable in optimized mode @@ -3250,8 +3256,10 @@ namespace TrilinosWrappers // as well as from TrilinosWrappers::SparseMatrix::Tvmult Assert(&tril_src != &tril_dst, TrilinosWrappers::SparseMatrix::ExcSourceEqualsDestination()); - internal::check_vector_map_equality( - payload, tril_src, tril_dst, !payload.UseTranspose()); + internal::check_vector_map_equality(payload, + tril_src, + tril_dst, + !payload.UseTranspose()); solver.solve(payload, tril_dst, tril_src, preconditioner); }; @@ -3262,8 +3270,10 @@ namespace TrilinosWrappers // as well as from TrilinosWrappers::SparseMatrix::Tvmult Assert(&tril_src != &tril_dst, TrilinosWrappers::SparseMatrix::ExcSourceEqualsDestination()); - internal::check_vector_map_equality( - payload, tril_src, tril_dst, payload.UseTranspose()); + internal::check_vector_map_equality(payload, + tril_src, + tril_dst, + payload.UseTranspose()); const_cast(payload).transpose(); solver.solve(payload, tril_dst, tril_src, preconditioner); diff --git a/include/deal.II/lac/trilinos_sparsity_pattern.h b/include/deal.II/lac/trilinos_sparsity_pattern.h index c73d0ae973..3d81c0d011 100644 --- a/include/deal.II/lac/trilinos_sparsity_pattern.h +++ b/include/deal.II/lac/trilinos_sparsity_pattern.h @@ -1241,10 +1241,10 @@ namespace TrilinosWrappers { inline Accessor::Accessor(const SparsityPattern *sp, const size_type row, - const size_type index) : - sparsity_pattern(const_cast(sp)), - a_row(row), - a_index(index) + const size_type index) + : sparsity_pattern(const_cast(sp)) + , a_row(row) + , a_index(index) { visit_present_row(); } @@ -1283,8 +1283,8 @@ namespace TrilinosWrappers inline Iterator::Iterator(const SparsityPattern *sp, const size_type row, - const size_type index) : - accessor(sp, row, index) + const size_type index) + : accessor(sp, row, index) {} diff --git a/include/deal.II/lac/trilinos_vector.h b/include/deal.II/lac/trilinos_vector.h index 8a862a3606..f2b6525a7b 100644 --- a/include/deal.II/lac/trilinos_vector.h +++ b/include/deal.II/lac/trilinos_vector.h @@ -1342,9 +1342,9 @@ namespace TrilinosWrappers namespace internal { inline VectorReference::VectorReference(MPI::Vector & vector, - const size_type index) : - vector(vector), - index(index) + const size_type index) + : vector(vector) + , index(index) {} @@ -1686,11 +1686,11 @@ namespace TrilinosWrappers const TrilinosWrappers::types::int_type my_row = nonlocal_vector->Map().LID( static_cast(row)); - Assert( - my_row != -1, - ExcMessage("Attempted to write into off-processor vector entry " - "that has not be specified as being writable upon " - "initialization")); + Assert(my_row != -1, + ExcMessage( + "Attempted to write into off-processor vector entry " + "that has not be specified as being writable upon " + "initialization")); (*nonlocal_vector)[0][my_row] += values[i]; compressed = false; } diff --git a/include/deal.II/lac/utilities.h b/include/deal.II/lac/utilities.h index a691968179..c6ce72361c 100644 --- a/include/deal.II/lac/utilities.h +++ b/include/deal.II/lac/utilities.h @@ -228,10 +228,10 @@ namespace Utilities { Assert(f != 0, ExcDivideByZero()); const NumberType tau = g / f; - AssertThrow( - std::abs(tau) < 1., - ExcMessage("real-valued Hyperbolic rotation does not exist for (" + - std::to_string(f) + "," + std::to_string(g) + ")")); + AssertThrow(std::abs(tau) < 1., + ExcMessage( + "real-valued Hyperbolic rotation does not exist for (" + + std::to_string(f) + "," + std::to_string(g) + ")")); const NumberType u = std::copysign(sqrt((1. - tau) * (1. + tau)), f); // <-- more stable than std::sqrt(1.-tau*tau) diff --git a/include/deal.II/lac/vector.h b/include/deal.II/lac/vector.h index 805810b281..8752c9142a 100644 --- a/include/deal.II/lac/vector.h +++ b/include/deal.II/lac/vector.h @@ -1037,10 +1037,10 @@ Vector::lp_norm(const real_type) const; //------------------------ inline functions template -inline Vector::Vector() : - vec_size(0), - max_vec_size(0), - values(nullptr, &free) +inline Vector::Vector() + : vec_size(0) + , max_vec_size(0) + , values(nullptr, &free) { // virtual functions called in constructors and destructors never use the // override in a derived class @@ -1052,10 +1052,10 @@ inline Vector::Vector() : template template -Vector::Vector(const InputIterator first, const InputIterator last) : - vec_size(0), - max_vec_size(0), - values(nullptr, &free) +Vector::Vector(const InputIterator first, const InputIterator last) + : vec_size(0) + , max_vec_size(0) + , values(nullptr, &free) { // allocate memory. do not initialize it, as we will copy over to it in a // second @@ -1066,10 +1066,10 @@ Vector::Vector(const InputIterator first, const InputIterator last) : template -inline Vector::Vector(const size_type n) : - vec_size(0), - max_vec_size(0), - values(nullptr, &free) +inline Vector::Vector(const size_type n) + : vec_size(0) + , max_vec_size(0) + , values(nullptr, &free) { // virtual functions called in constructors and destructors never use the // override in a derived class diff --git a/include/deal.II/lac/vector.templates.h b/include/deal.II/lac/vector.templates.h index 9aff7b77f2..c35616d887 100644 --- a/include/deal.II/lac/vector.templates.h +++ b/include/deal.II/lac/vector.templates.h @@ -44,11 +44,11 @@ DEAL_II_NAMESPACE_OPEN template -Vector::Vector(const Vector &v) : - Subscriptor(), - vec_size(v.size()), - max_vec_size(v.size()), - values(nullptr, &free) +Vector::Vector(const Vector &v) + : Subscriptor() + , vec_size(v.size()) + , max_vec_size(v.size()) + , values(nullptr, &free) { if (vec_size != 0) { @@ -60,12 +60,12 @@ Vector::Vector(const Vector &v) : template -Vector::Vector(Vector &&v) noexcept : - Subscriptor(std::move(v)), - vec_size(v.vec_size), - max_vec_size(v.max_vec_size), - values(std::move(v.values)), - thread_loop_partitioner(std::move(v.thread_loop_partitioner)) +Vector::Vector(Vector &&v) noexcept + : Subscriptor(std::move(v)) + , vec_size(v.vec_size) + , max_vec_size(v.max_vec_size) + , values(std::move(v.values)) + , thread_loop_partitioner(std::move(v.thread_loop_partitioner)) { v.vec_size = 0; v.max_vec_size = 0; @@ -76,11 +76,11 @@ Vector::Vector(Vector &&v) noexcept : template template -Vector::Vector(const Vector &v) : - Subscriptor(), - vec_size(v.size()), - max_vec_size(v.size()), - values(nullptr, &free) +Vector::Vector(const Vector &v) + : Subscriptor() + , vec_size(v.size()) + , max_vec_size(v.size()) + , values(nullptr, &free) { if (vec_size != 0) { @@ -123,8 +123,9 @@ namespace internal if (out.size() != v_size) out.reinit(v_size, true); - internal::VectorOperations::copy( - start_ptr, start_ptr + out.size(), out.begin()); + internal::VectorOperations::copy(start_ptr, + start_ptr + out.size(), + out.begin()); ierr = VecRestoreArray(sequential_vector, &start_ptr); AssertThrow(ierr == 0, ExcPETScError(ierr)); @@ -138,11 +139,11 @@ namespace internal template -Vector::Vector(const PETScWrappers::VectorBase &v) : - Subscriptor(), - vec_size(0), - max_vec_size(0), - values(nullptr, &free) +Vector::Vector(const PETScWrappers::VectorBase &v) + : Subscriptor() + , vec_size(0) + , max_vec_size(0) + , values(nullptr, &free) { if (v.size() != 0) { @@ -155,11 +156,11 @@ Vector::Vector(const PETScWrappers::VectorBase &v) : #ifdef DEAL_II_WITH_TRILINOS template -Vector::Vector(const TrilinosWrappers::MPI::Vector &v) : - Subscriptor(), - vec_size(v.size()), - max_vec_size(v.size()), - values(nullptr, &free) +Vector::Vector(const TrilinosWrappers::MPI::Vector &v) + : Subscriptor() + , vec_size(v.size()) + , max_vec_size(v.size()) + , values(nullptr, &free) { if (vec_size != 0) { @@ -209,8 +210,10 @@ Vector::operator=(const Vector &v) { dealii::internal::VectorOperations::Vector_copy copier( v.values.get(), values.get()); - internal::VectorOperations::parallel_for( - copier, 0, vec_size, thread_loop_partitioner); + internal::VectorOperations::parallel_for(copier, + 0, + vec_size, + thread_loop_partitioner); } return *this; @@ -248,8 +251,10 @@ Vector::operator=(const Vector &v) dealii::internal::VectorOperations::Vector_copy copier( v.values.get(), values.get()); - internal::VectorOperations::parallel_for( - copier, 0, vec_size, thread_loop_partitioner); + internal::VectorOperations::parallel_for(copier, + 0, + vec_size, + thread_loop_partitioner); return *this; } @@ -399,8 +404,10 @@ Vector::operator=(const Number s) if (vec_size > 0) { internal::VectorOperations::Vector_set setter(s, values.get()); - internal::VectorOperations::parallel_for( - setter, 0, vec_size, thread_loop_partitioner); + internal::VectorOperations::parallel_for(setter, + 0, + vec_size, + thread_loop_partitioner); } return *this; @@ -419,8 +426,10 @@ Vector::operator*=(const Number factor) internal::VectorOperations::Vectorization_multiply_factor vector_multiply(values.get(), factor); - internal::VectorOperations::parallel_for( - vector_multiply, 0, vec_size, thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_multiply, + 0, + vec_size, + thread_loop_partitioner); return *this; } @@ -438,8 +447,10 @@ Vector::add(const Number a, const Vector &v) internal::VectorOperations::Vectorization_add_av vector_add_av( values.get(), v.values.get(), a); - internal::VectorOperations::parallel_for( - vector_add_av, 0, vec_size, thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add_av, + 0, + vec_size, + thread_loop_partitioner); } @@ -456,8 +467,10 @@ Vector::sadd(const Number x, const Number a, const Vector &v) internal::VectorOperations::Vectorization_sadd_xav vector_sadd_xav( values.get(), v.values.get(), a, x); - internal::VectorOperations::parallel_for( - vector_sadd_xav, 0, vec_size, thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_sadd_xav, + 0, + vec_size, + thread_loop_partitioner); } @@ -649,8 +662,10 @@ Vector::add_and_dot(const Number a, AssertDimension(vec_size, W.size()); Number sum; - internal::VectorOperations::AddAndDot adder( - this->values.get(), V.values.get(), W.values.get(), a); + internal::VectorOperations::AddAndDot adder(this->values.get(), + V.values.get(), + W.values.get(), + a); internal::VectorOperations::parallel_reduce( adder, 0, vec_size, sum, thread_loop_partitioner); AssertIsFinite(sum); @@ -669,8 +684,10 @@ Vector::operator+=(const Vector &v) internal::VectorOperations::Vectorization_add_v vector_add( values.get(), v.values.get()); - internal::VectorOperations::parallel_for( - vector_add, 0, vec_size, thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add, + 0, + vec_size, + thread_loop_partitioner); return *this; } @@ -685,8 +702,10 @@ Vector::operator-=(const Vector &v) internal::VectorOperations::Vectorization_subtract_v vector_subtract( values.get(), v.values.get()); - internal::VectorOperations::parallel_for( - vector_subtract, 0, vec_size, thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_subtract, + 0, + vec_size, + thread_loop_partitioner); return *this; } @@ -701,8 +720,10 @@ Vector::add(const Number v) internal::VectorOperations::Vectorization_add_factor vector_add( values.get(), v); - internal::VectorOperations::parallel_for( - vector_add, 0, vec_size, thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add, + 0, + vec_size, + thread_loop_partitioner); } @@ -723,8 +744,10 @@ Vector::add(const Number a, internal::VectorOperations::Vectorization_add_avpbw vector_add( values.get(), v.values.get(), w.values.get(), a, b); - internal::VectorOperations::parallel_for( - vector_add, 0, vec_size, thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add, + 0, + vec_size, + thread_loop_partitioner); } @@ -740,8 +763,10 @@ Vector::sadd(const Number x, const Vector &v) internal::VectorOperations::Vectorization_sadd_xv vector_sadd( values.get(), v.values.get(), x); - internal::VectorOperations::parallel_for( - vector_sadd, 0, vec_size, thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_sadd, + 0, + vec_size, + thread_loop_partitioner); } @@ -755,8 +780,10 @@ Vector::scale(const Vector &s) internal::VectorOperations::Vectorization_scale vector_scale( values.get(), s.values.get()); - internal::VectorOperations::parallel_for( - vector_scale, 0, vec_size, thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_scale, + 0, + vec_size, + thread_loop_partitioner); } @@ -786,8 +813,10 @@ Vector::equ(const Number a, const Vector &u) internal::VectorOperations::Vectorization_equ_au vector_equ( values.get(), u.values.get(), a); - internal::VectorOperations::parallel_for( - vector_equ, 0, vec_size, thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_equ, + 0, + vec_size, + thread_loop_partitioner); } @@ -828,8 +857,10 @@ Vector::ratio(const Vector &a, const Vector &b) internal::VectorOperations::Vectorization_ratio vector_ratio( values.get(), a.values.get(), b.values.get()); - internal::VectorOperations::parallel_for( - vector_ratio, 0, vec_size, thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_ratio, + 0, + vec_size, + thread_loop_partitioner); } @@ -1085,8 +1116,9 @@ Vector::allocate(const size_type copy_n_el) { // allocate memory with the proper alignment requirements of 64 bytes Number *new_values; - Utilities::System::posix_memalign( - (void **)&new_values, 64, sizeof(Number) * max_vec_size); + Utilities::System::posix_memalign((void **)&new_values, + 64, + sizeof(Number) * max_vec_size); // copy: for (size_type i = 0; i < copy_n_el; ++i) new_values[i] = values[i]; diff --git a/include/deal.II/lac/vector_memory.h b/include/deal.II/lac/vector_memory.h index c5166397db..4a215f0da1 100644 --- a/include/deal.II/lac/vector_memory.h +++ b/include/deal.II/lac/vector_memory.h @@ -482,11 +482,10 @@ namespace internal template -inline VectorMemory::Pointer::Pointer( - VectorMemory &mem) : - std::unique_ptr>( - mem.alloc(), - [&mem](VectorType *v) { mem.free(v); }) +inline VectorMemory::Pointer::Pointer(VectorMemory &mem) + : std::unique_ptr>( + mem.alloc(), + [&mem](VectorType *v) { mem.free(v); }) {} diff --git a/include/deal.II/lac/vector_memory.templates.h b/include/deal.II/lac/vector_memory.templates.h index 75a9f8560f..87cebfc211 100644 --- a/include/deal.II/lac/vector_memory.templates.h +++ b/include/deal.II/lac/vector_memory.templates.h @@ -33,7 +33,8 @@ template Threads::Mutex GrowingVectorMemory::mutex; template -inline GrowingVectorMemory::Pool::Pool() : data(nullptr) +inline GrowingVectorMemory::Pool::Pool() + : data(nullptr) {} @@ -76,10 +77,9 @@ inline GrowingVectorMemory::GrowingVectorMemory( const size_type initial_size, const bool log_statistics) - : - total_alloc(0), - current_alloc(0), - log_statistics(log_statistics) + : total_alloc(0) + , current_alloc(0) + , log_statistics(log_statistics) { Threads::Mutex::ScopedLock lock(mutex); pool.initialize(initial_size); diff --git a/include/deal.II/lac/vector_operations_internal.h b/include/deal.II/lac/vector_operations_internal.h index dd10d06030..d8bf91cc91 100644 --- a/include/deal.II/lac/vector_operations_internal.h +++ b/include/deal.II/lac/vector_operations_internal.h @@ -118,10 +118,10 @@ namespace internal { TBBForFunctor(Functor & functor, const size_type start, - const size_type end) : - functor(functor), - start(start), - end(end) + const size_type end) + : functor(functor) + , start(start) + , end(end) { const size_type vec_size = end - start; // set chunk size for sub-tasks @@ -175,10 +175,10 @@ namespace internal 4 * internal::VectorImplementation::minimum_parallel_grain_size && MultithreadInfo::n_threads() > 1) { - Assert( - partitioner.get() != nullptr, - ExcInternalError("Unexpected initialization of Vector that does " - "not set the TBB partitioner to a usable state.")); + Assert(partitioner.get() != nullptr, + ExcInternalError( + "Unexpected initialization of Vector that does " + "not set the TBB partitioner to a usable state.")); std::shared_ptr tbb_partitioner = partitioner->acquire_one_partitioner(); @@ -204,7 +204,9 @@ namespace internal template struct Vector_set { - Vector_set(Number value, Number *dst) : value(value), dst(dst) + Vector_set(Number value, Number *dst) + : value(value) + , dst(dst) { Assert(dst != nullptr, ExcInternalError()); } @@ -236,7 +238,9 @@ namespace internal template struct Vector_copy { - Vector_copy(const OtherNumber *src, Number *dst) : src(src), dst(dst) + Vector_copy(const OtherNumber *src, Number *dst) + : src(src) + , dst(dst) { Assert(src != nullptr, ExcInternalError()); Assert(dst != nullptr, ExcInternalError()); @@ -275,9 +279,9 @@ namespace internal template struct Vectorization_multiply_factor { - Vectorization_multiply_factor(Number *val, Number factor) : - val(val), - factor(factor) + Vectorization_multiply_factor(Number *val, Number factor) + : val(val) + , factor(factor) {} void @@ -303,10 +307,10 @@ namespace internal template struct Vectorization_add_av { - Vectorization_add_av(Number *val, Number *v_val, Number factor) : - val(val), - v_val(v_val), - factor(factor) + Vectorization_add_av(Number *val, Number *v_val, Number factor) + : val(val) + , v_val(v_val) + , factor(factor) {} void @@ -333,11 +337,11 @@ namespace internal template struct Vectorization_sadd_xav { - Vectorization_sadd_xav(Number *val, Number *v_val, Number a, Number x) : - val(val), - v_val(v_val), - a(a), - x(x) + Vectorization_sadd_xav(Number *val, Number *v_val, Number a, Number x) + : val(val) + , v_val(v_val) + , a(a) + , x(x) {} void @@ -365,9 +369,9 @@ namespace internal template struct Vectorization_subtract_v { - Vectorization_subtract_v(Number *val, Number *v_val) : - val(val), - v_val(v_val) + Vectorization_subtract_v(Number *val, Number *v_val) + : val(val) + , v_val(v_val) {} void @@ -393,9 +397,9 @@ namespace internal template struct Vectorization_add_factor { - Vectorization_add_factor(Number *val, Number factor) : - val(val), - factor(factor) + Vectorization_add_factor(Number *val, Number factor) + : val(val) + , factor(factor) {} void @@ -421,7 +425,9 @@ namespace internal template struct Vectorization_add_v { - Vectorization_add_v(Number *val, Number *v_val) : val(val), v_val(v_val) + Vectorization_add_v(Number *val, Number *v_val) + : val(val) + , v_val(v_val) {} void @@ -451,12 +457,12 @@ namespace internal Number *v_val, Number *w_val, Number a, - Number b) : - val(val), - v_val(v_val), - w_val(w_val), - a(a), - b(b) + Number b) + : val(val) + , v_val(v_val) + , w_val(w_val) + , a(a) + , b(b) {} void @@ -485,10 +491,10 @@ namespace internal template struct Vectorization_sadd_xv { - Vectorization_sadd_xv(Number *val, Number *v_val, Number x) : - val(val), - v_val(v_val), - x(x) + Vectorization_sadd_xv(Number *val, Number *v_val, Number x) + : val(val) + , v_val(v_val) + , x(x) {} void @@ -520,13 +526,13 @@ namespace internal Number *w_val, Number x, Number a, - Number b) : - val(val), - v_val(v_val), - w_val(w_val), - x(x), - a(a), - b(b) + Number b) + : val(val) + , v_val(v_val) + , w_val(w_val) + , x(x) + , a(a) + , b(b) {} void @@ -556,7 +562,9 @@ namespace internal template struct Vectorization_scale { - Vectorization_scale(Number *val, Number *v_val) : val(val), v_val(v_val) + Vectorization_scale(Number *val, Number *v_val) + : val(val) + , v_val(v_val) {} void @@ -582,10 +590,10 @@ namespace internal template struct Vectorization_equ_au { - Vectorization_equ_au(Number *val, Number *u_val, Number a) : - val(val), - u_val(u_val), - a(a) + Vectorization_equ_au(Number *val, Number *u_val, Number a) + : val(val) + , u_val(u_val) + , a(a) {} void @@ -616,12 +624,12 @@ namespace internal Number *u_val, Number *v_val, Number a, - Number b) : - val(val), - u_val(u_val), - v_val(v_val), - a(a), - b(b) + Number b) + : val(val) + , u_val(u_val) + , v_val(v_val) + , a(a) + , b(b) {} void @@ -656,14 +664,14 @@ namespace internal Number *w_val, Number a, Number b, - Number c) : - val(val), - u_val(u_val), - v_val(v_val), - w_val(w_val), - a(a), - b(b), - c(c) + Number c) + : val(val) + , u_val(u_val) + , v_val(v_val) + , w_val(w_val) + , a(a) + , b(b) + , c(c) {} void @@ -694,10 +702,10 @@ namespace internal template struct Vectorization_ratio { - Vectorization_ratio(Number *val, Number *a_val, Number *b_val) : - val(val), - a_val(a_val), - b_val(b_val) + Vectorization_ratio(Number *val, Number *a_val, Number *b_val) + : val(val) + , a_val(a_val) + , b_val(b_val) {} void @@ -735,7 +743,9 @@ namespace internal std::is_same::value && (VectorizedArray::n_array_elements > 1); - Dot(const Number *X, const Number2 *Y) : X(X), Y(Y) + Dot(const Number *X, const Number2 *Y) + : X(X) + , Y(Y) {} Number @@ -774,7 +784,8 @@ namespace internal static const bool vectorizes = VectorizedArray::n_array_elements > 1; - Norm2(const Number *X) : X(X) + Norm2(const Number *X) + : X(X) {} RealType @@ -800,7 +811,8 @@ namespace internal static const bool vectorizes = VectorizedArray::n_array_elements > 1; - Norm1(const Number *X) : X(X) + Norm1(const Number *X) + : X(X) {} RealType @@ -826,7 +838,9 @@ namespace internal static const bool vectorizes = VectorizedArray::n_array_elements > 1; - NormP(const Number *X, RealType p) : X(X), p(p) + NormP(const Number *X, RealType p) + : X(X) + , p(p) {} RealType @@ -853,7 +867,8 @@ namespace internal static const bool vectorizes = VectorizedArray::n_array_elements > 1; - MeanValue(const Number *X) : X(X) + MeanValue(const Number *X) + : X(X) {} Number @@ -879,11 +894,11 @@ namespace internal static const bool vectorizes = VectorizedArray::n_array_elements > 1; - AddAndDot(Number *X, const Number *V, const Number *W, Number a) : - X(X), - V(V), - W(W), - a(a) + AddAndDot(Number *X, const Number *V, const Number *W, Number a) + : X(X) + , V(V) + , W(W) + , a(a) {} Number @@ -1089,8 +1104,10 @@ namespace internal ResultType r0, r1, r2, r3; accumulate_recursive(op, first, first + new_size, r0); accumulate_recursive(op, first + new_size, first + 2 * new_size, r1); - accumulate_recursive( - op, first + 2 * new_size, first + 3 * new_size, r2); + accumulate_recursive(op, + first + 2 * new_size, + first + 3 * new_size, + r2); accumulate_recursive(op, first + 3 * new_size, last, r3); r0 += r1; r2 += r3; @@ -1244,10 +1261,10 @@ namespace internal TBBReduceFunctor(const Operation &op, const size_type start, - const size_type end) : - op(op), - start(start), - end(end) + const size_type end) + : op(op) + , start(start) + , end(end) { const size_type vec_size = end - start; // set chunk size for sub-tasks @@ -1344,15 +1361,16 @@ namespace internal 4 * internal::VectorImplementation::minimum_parallel_grain_size && MultithreadInfo::n_threads() > 1) { - Assert( - partitioner.get() != nullptr, - ExcInternalError("Unexpected initialization of Vector that does " - "not set the TBB partitioner to a usable state.")); + Assert(partitioner.get() != nullptr, + ExcInternalError( + "Unexpected initialization of Vector that does " + "not set the TBB partitioner to a usable state.")); std::shared_ptr tbb_partitioner = partitioner->acquire_one_partitioner(); - TBBReduceFunctor generic_functor( - op, start, end); + TBBReduceFunctor generic_functor(op, + start, + end); tbb::parallel_for( tbb::blocked_range(0, generic_functor.n_chunks, 1), generic_functor, diff --git a/include/deal.II/matrix_free/cuda_fe_evaluation.h b/include/deal.II/matrix_free/cuda_fe_evaluation.h index e9d44928cf..9c9e124f1f 100644 --- a/include/deal.II/matrix_free/cuda_fe_evaluation.h +++ b/include/deal.II/matrix_free/cuda_fe_evaluation.h @@ -200,11 +200,11 @@ namespace CUDAWrappers FEEvaluation:: FEEvaluation(int cell_id, const data_type * data, - SharedData *shdata) : - n_cells(data->n_cells), - padding_length(data->padding_length), - constraint_mask(data->constraint_mask[cell_id]), - values(shdata->values) + SharedData *shdata) + : n_cells(data->n_cells) + , padding_length(data->padding_length) + , constraint_mask(data->constraint_mask[cell_id]) + , values(shdata->values) { local_to_global = data->local_to_global + padding_length * cell_id; inv_jac = data->inv_jacobian + padding_length * cell_id; diff --git a/include/deal.II/matrix_free/cuda_matrix_free.h b/include/deal.II/matrix_free/cuda_matrix_free.h index fdbc94b801..22b339e3f0 100644 --- a/include/deal.II/matrix_free/cuda_matrix_free.h +++ b/include/deal.II/matrix_free/cuda_matrix_free.h @@ -101,9 +101,9 @@ namespace CUDAWrappers AdditionalData( const ParallelizationScheme parallelization_scheme = parallel_in_elem, const UpdateFlags mapping_update_flags = update_gradients | - update_JxW_values) : - parallelization_scheme(parallelization_scheme), - mapping_update_flags(mapping_update_flags) + update_JxW_values) + : parallelization_scheme(parallelization_scheme) + , mapping_update_flags(mapping_update_flags) {} /** @@ -294,8 +294,8 @@ namespace CUDAWrappers struct SharedData { __device__ - SharedData(Number *vd, Number *gq[dim]) : - values(vd) + SharedData(Number *vd, Number *gq[dim]) + : values(vd) { for (int d = 0; d < dim; ++d) gradients[d] = gq[d]; diff --git a/include/deal.II/matrix_free/cuda_matrix_free.templates.h b/include/deal.II/matrix_free/cuda_matrix_free.templates.h index 1923b582f9..a35b69434d 100644 --- a/include/deal.II/matrix_free/cuda_matrix_free.templates.h +++ b/include/deal.II/matrix_free/cuda_matrix_free.templates.h @@ -172,19 +172,19 @@ namespace CUDAWrappers const Quadrature<1> & quad, const ::dealii::internal::MatrixFreeFunctions::ShapeInfo & shape_info, - const UpdateFlags &update_flags) : - data(data), - fe_degree(data->fe_degree), - dofs_per_cell(data->dofs_per_cell), - q_points_per_cell(data->q_points_per_cell), - fe_values(mapping, - fe, - Quadrature(quad), - update_inverse_jacobians | update_quadrature_points | - update_values | update_gradients | update_JxW_values), - lexicographic_inv(shape_info.lexicographic_numbering), - update_flags(update_flags), - padding_length(data->get_padding_length()) + const UpdateFlags &update_flags) + : data(data) + , fe_degree(data->fe_degree) + , dofs_per_cell(data->dofs_per_cell) + , q_points_per_cell(data->q_points_per_cell) + , fe_values(mapping, + fe, + Quadrature(quad), + update_inverse_jacobians | update_quadrature_points | + update_values | update_gradients | update_JxW_values) + , lexicographic_inv(shape_info.lexicographic_numbering) + , update_flags(update_flags) + , padding_length(data->get_padding_length()) { local_dof_indices.resize(data->dofs_per_cell); lexicographic_dof_indices.resize(dofs_per_cell); @@ -323,8 +323,9 @@ namespace CUDAWrappers // Local-to-global mapping if (data->parallelization_scheme == MatrixFree::parallel_over_elem) - internal::transpose_in_place( - local_to_global_host, n_cells, padding_length); + internal::transpose_in_place(local_to_global_host, + n_cells, + padding_length); alloc_and_copy(&data->local_to_global[color], local_to_global_host, @@ -335,11 +336,13 @@ namespace CUDAWrappers { if (data->parallelization_scheme == MatrixFree::parallel_over_elem) - internal::transpose_in_place( - q_points_host, n_cells, padding_length); + internal::transpose_in_place(q_points_host, + n_cells, + padding_length); - alloc_and_copy( - &data->q_points[color], q_points_host, n_cells * padding_length); + alloc_and_copy(&data->q_points[color], + q_points_host, + n_cells * padding_length); } // Jacobian determinants/quadrature weights @@ -359,24 +362,27 @@ namespace CUDAWrappers // are together, etc., i.e., reorder indices from // cell_id*q_points_per_cell*dim*dim + q*dim*dim +i to // i*q_points_per_cell*n_cells + cell_id*q_points_per_cell+q - internal::transpose_in_place( - inv_jacobian_host, padding_length * n_cells, dim * dim); + internal::transpose_in_place(inv_jacobian_host, + padding_length * n_cells, + dim * dim); // Transpose second time means we get the following index order: // q*n_cells*dim*dim + i*n_cells + cell_id which is good for an // element-level parallelization if (data->parallelization_scheme == MatrixFree::parallel_over_elem) - internal::transpose_in_place( - inv_jacobian_host, n_cells * dim * dim, padding_length); + internal::transpose_in_place(inv_jacobian_host, + n_cells * dim * dim, + padding_length); alloc_and_copy(&data->inv_jacobian[color], inv_jacobian_host, n_cells * dim * dim * padding_length); } - alloc_and_copy( - &data->constraint_mask[color], constraint_mask_host, n_cells); + alloc_and_copy(&data->constraint_mask[color], + constraint_mask_host, + n_cells); } @@ -467,9 +473,9 @@ namespace CUDAWrappers template - MatrixFree::MatrixFree() : - constrained_dofs(nullptr), - padding_length(0) + MatrixFree::MatrixFree() + : constrained_dofs(nullptr) + , padding_length(0) {} @@ -736,8 +742,10 @@ namespace CUDAWrappers CUDAVector &dst) const { internal::set_constrained_dofs - <<>>( - constrained_dofs, n_constrained_dofs, val, dst.get_values()); + <<>>(constrained_dofs, + n_constrained_dofs, + val, + dst.get_values()); } @@ -760,8 +768,10 @@ namespace CUDAWrappers { for (unsigned int i = 0; i < n_colors; ++i) internal::apply_kernel_shmem - <<>>( - func, get_data(i), src.get_values(), dst.get_values()); + <<>>(func, + get_data(i), + src.get_values(), + dst.get_values()); } diff --git a/include/deal.II/matrix_free/cuda_tensor_product_kernels.h b/include/deal.II/matrix_free/cuda_tensor_product_kernels.h index 5a5f976990..ef39036149 100644 --- a/include/deal.II/matrix_free/cuda_tensor_product_kernels.h +++ b/include/deal.II/matrix_free/cuda_tensor_product_kernels.h @@ -152,8 +152,9 @@ namespace CUDAWrappers n_q_points_1d, Number>::values(const Number *in, Number *out) const { - apply( - global_shape_values, in, out); + apply(global_shape_values, + in, + out); } @@ -168,8 +169,9 @@ namespace CUDAWrappers Number>::gradients(const Number *in, Number * out) const { - apply( - global_shape_gradients, in, out); + apply(global_shape_gradients, + in, + out); } diff --git a/include/deal.II/matrix_free/dof_info.templates.h b/include/deal.II/matrix_free/dof_info.templates.h index 6d0af7c7dd..9ea2cde975 100644 --- a/include/deal.II/matrix_free/dof_info.templates.h +++ b/include/deal.II/matrix_free/dof_info.templates.h @@ -80,8 +80,8 @@ namespace internal template - ConstraintValues::ConstraintValues() : - constraints(FPArrayComparator(1.)) + ConstraintValues::ConstraintValues() + : constraints(FPArrayComparator(1.)) {} template @@ -522,9 +522,10 @@ namespace internal new_constraint_indicator.reserve(constraint_indicator.size()); if (store_plain_indices == true) { - new_rowstart_plain.resize( - vectorization_length * task_info.cell_partition_data.back() + 1, - numbers::invalid_unsigned_int); + new_rowstart_plain.resize(vectorization_length * + task_info.cell_partition_data.back() + + 1, + numbers::invalid_unsigned_int); new_plain_indices.reserve(plain_dof_indices.size()); } @@ -1140,8 +1141,9 @@ namespace internal if (sp->column() != block) row_entries.insert(renumbering[sp->column()], insert_pos); } - connectivity.add_entries( - renumbering[block], row_entries.begin(), row_entries.end()); + connectivity.add_entries(renumbering[block], + row_entries.begin(), + row_entries.end()); } } } // namespace @@ -1184,8 +1186,9 @@ namespace internal // Create a temporary sparsity pattern that holds to each degree of // freedom on which cells it appears, i.e., store the connectivity // between cells and dofs - SparsityPattern connectivity_dof( - n_rows, task_info.n_active_cells, row_lengths); + SparsityPattern connectivity_dof(n_rows, + task_info.n_active_cells, + row_lengths); parallel::apply_to_subranges(0, task_info.n_active_cells, std::bind(&fill_connectivity_dofs, @@ -1300,8 +1303,9 @@ namespace internal const TaskInfo &task_info) const { out << " Memory row starts indices: "; - task_info.print_memory_statistics( - out, (row_starts.capacity() * sizeof(*row_starts.begin()))); + task_info.print_memory_statistics(out, + (row_starts.capacity() * + sizeof(*row_starts.begin()))); out << " Memory dof indices: "; task_info.print_memory_statistics( out, MemoryConsumption::memory_consumption(dof_indices)); diff --git a/include/deal.II/matrix_free/evaluation_kernels.h b/include/deal.II/matrix_free/evaluation_kernels.h index d0fbbef60a..af495f46ea 100644 --- a/include/deal.II/matrix_free/evaluation_kernels.h +++ b/include/deal.II/matrix_free/evaluation_kernels.h @@ -266,8 +266,9 @@ namespace internal // grad xy if (evaluate_gradients == false) eval.template gradients<0, true, false>(values_dofs, temp1); - eval.template gradients<1, true, false>( - temp1, hessians_quad + 2 * n_q_points); + eval.template gradients<1, true, false>(temp1, + hessians_quad + + 2 * n_q_points); // grad xx eval.template hessians<0, true, false>(values_dofs, temp1); @@ -277,13 +278,15 @@ namespace internal // grad y eval.template values<0, true, false>(values_dofs, temp1); if (evaluate_gradients == true) - eval.template gradients<1, true, false>( - temp1, gradients_quad + n_q_points); + eval.template gradients<1, true, false>(temp1, + gradients_quad + + n_q_points); // grad yy if (evaluate_hessians == true) - eval.template hessians<1, true, false>( - temp1, hessians_quad + n_q_points); + eval.template hessians<1, true, false>(temp1, + hessians_quad + + n_q_points); // val: can use values applied in x if (evaluate_values == true) @@ -317,13 +320,15 @@ namespace internal temp1); eval.template values<1, true, false>(temp1, temp2); } - eval.template gradients<2, true, false>( - temp2, hessians_quad + 4 * n_q_points); + eval.template gradients<2, true, false>(temp2, + hessians_quad + + 4 * n_q_points); // grad xy eval.template gradients<1, true, false>(temp1, temp2); - eval.template values<2, true, false>( - temp2, hessians_quad + 3 * n_q_points); + eval.template values<2, true, false>(temp2, + hessians_quad + + 3 * n_q_points); // grad xx eval.template hessians<0, true, false>(values_dofs, temp1); @@ -336,8 +341,9 @@ namespace internal if (evaluate_gradients == true) { eval.template gradients<1, true, false>(temp1, temp2); - eval.template values<2, true, false>( - temp2, gradients_quad + n_q_points); + eval.template values<2, true, false>(temp2, + gradients_quad + + n_q_points); } if (evaluate_hessians == true) @@ -345,27 +351,31 @@ namespace internal // grad yz if (evaluate_gradients == false) eval.template gradients<1, true, false>(temp1, temp2); - eval.template gradients<2, true, false>( - temp2, hessians_quad + 5 * n_q_points); + eval.template gradients<2, true, false>(temp2, + hessians_quad + + 5 * n_q_points); // grad yy eval.template hessians<1, true, false>(temp1, temp2); - eval.template values<2, true, false>( - temp2, hessians_quad + n_q_points); + eval.template values<2, true, false>(temp2, + hessians_quad + + n_q_points); } // grad z: can use the values applied in x direction stored in // temp1 eval.template values<1, true, false>(temp1, temp2); if (evaluate_gradients == true) - eval.template gradients<2, true, false>( - temp2, gradients_quad + 2 * n_q_points); + eval.template gradients<2, true, false>(temp2, + gradients_quad + + 2 * n_q_points); // grad zz: can use the values applied in x and y direction stored // in temp2 if (evaluate_hessians == true) - eval.template hessians<2, true, false>( - temp2, hessians_quad + 2 * n_q_points); + eval.template hessians<2, true, false>(temp2, + hessians_quad + + 2 * n_q_points); // val: can use the values applied in x & y direction stored in // temp2 @@ -512,8 +522,9 @@ namespace internal } if (integrate_gradients == true) { - eval.template gradients<1, false, false>( - gradients_quad + n_q_points, temp1); + eval.template gradients<1, false, false>(gradients_quad + + n_q_points, + temp1); if (integrate_values) eval.template values<1, false, true>(values_quad, temp1); if (add_into_values_array == false) @@ -545,13 +556,15 @@ namespace internal } if (integrate_gradients == true) { - eval.template gradients<2, false, false>( - gradients_quad + 2 * n_q_points, temp1); + eval.template gradients<2, false, false>(gradients_quad + + 2 * n_q_points, + temp1); if (integrate_values) eval.template values<2, false, true>(values_quad, temp1); eval.template values<1, false, false>(temp1, temp2); - eval.template values<2, false, false>( - gradients_quad + n_q_points, temp1); + eval.template values<2, false, false>(gradients_quad + + n_q_points, + temp1); eval.template gradients<1, false, true>(temp1, temp2); if (add_into_values_array == false) eval.template values<0, false, false>(temp2, values_dofs); @@ -724,19 +737,22 @@ namespace internal values_out -= Utilities::fixed_power(np_2); if (next_dim < dim) for (unsigned int q = np_1; q != 0; --q) - FEEvaluationImplBasisChange:: - do_forward( - transformation_matrix, - values_in + (q - 1) * Utilities::fixed_power(np_1), - values_out + (q - 1) * Utilities::fixed_power(np_2), - basis_size_1_variable, - basis_size_2_variable); + FEEvaluationImplBasisChange< + variant, + next_dim, + basis_size_1, + basis_size_2, + 1, + Number, + Number2>::do_forward(transformation_matrix, + values_in + + (q - 1) * + Utilities::fixed_power(np_1), + values_out + + (q - 1) * + Utilities::fixed_power(np_2), + basis_size_1_variable, + basis_size_2_variable); // the recursion stops if dim==1 or if dim==2 and // basis_size_1==basis_size_2 (the latter is used because the @@ -799,10 +815,10 @@ namespace internal Assert( basis_size_1 != 0 || basis_size_1_variable <= basis_size_2_variable, ExcMessage("The second dimension must not be smaller than the first")); - Assert( - add_into_result == false || values_in != values_out, - ExcMessage("Input and output cannot alias with each other when " - "adding the result of the basis change to existing data")); + Assert(add_into_result == false || values_in != values_out, + ExcMessage( + "Input and output cannot alias with each other when " + "adding the result of the basis change to existing data")); constexpr int next_dim = (dim > 2 || @@ -860,13 +876,14 @@ namespace internal 1, Number, Number2>:: - do_backward( - transformation_matrix, - add_into_result, - values_in + q * Utilities::fixed_power(np_2), - values_out + q * Utilities::fixed_power(np_1), - basis_size_1_variable, - basis_size_2_variable); + do_backward(transformation_matrix, + add_into_result, + values_in + + q * Utilities::fixed_power(np_2), + values_out + + q * Utilities::fixed_power(np_1), + basis_size_1_variable, + basis_size_2_variable); values_in += Utilities::fixed_power(np_2); values_out += Utilities::fixed_power(np_1); @@ -911,10 +928,12 @@ namespace internal n_components, Number, Number2>::do_forward(transformation_matrix, - values_in + (q - 1) * Utilities::pow( - basis_size_1, dim - 1), - my_scratch + (q - 1) * Utilities::pow( - basis_size_2, dim - 1)); + values_in + + (q - 1) * + Utilities::pow(basis_size_1, dim - 1), + my_scratch + + (q - 1) * + Utilities::pow(basis_size_2, dim - 1)); EvaluatorTensorProduct::do_backward(transformation_matrix, - false, - my_scratch + - q * Utilities::pow( - basis_size_2, - dim - 1), - values_out + - q * Utilities::pow( - basis_size_1, - dim - 1)); + FEEvaluationImplBasisChange< + variant, + next_dim, + basis_size_1, + basis_size_2, + n_components, + Number, + Number2>::do_backward(transformation_matrix, + false, + my_scratch + + q * Utilities::pow(basis_size_2, dim - 1), + values_out + + q * Utilities::pow(basis_size_1, dim - 1)); } }; @@ -1037,30 +1053,36 @@ namespace internal eval.template gradients<0, true, false>(values_dofs, gradients_quad); if (dim > 1) - eval.template gradients<1, true, false>( - values_dofs, gradients_quad + n_q_points); + eval.template gradients<1, true, false>(values_dofs, + gradients_quad + + n_q_points); if (dim > 2) - eval.template gradients<2, true, false>( - values_dofs, gradients_quad + 2 * n_q_points); + eval.template gradients<2, true, false>(values_dofs, + gradients_quad + + 2 * n_q_points); } if (evaluate_hessians == true) { eval.template hessians<0, true, false>(values_dofs, hessians_quad); if (dim > 1) { - eval.template gradients<1, true, false>( - gradients_quad, hessians_quad + dim * n_q_points); - eval.template hessians<1, true, false>( - values_dofs, hessians_quad + n_q_points); + eval.template gradients<1, true, false>(gradients_quad, + hessians_quad + + dim * n_q_points); + eval.template hessians<1, true, false>(values_dofs, + hessians_quad + + n_q_points); } if (dim > 2) { - eval.template gradients<2, true, false>( - gradients_quad, hessians_quad + 4 * n_q_points); + eval.template gradients<2, true, false>(gradients_quad, + hessians_quad + + 4 * n_q_points); eval.template gradients<2, true, false>( gradients_quad + n_q_points, hessians_quad + 5 * n_q_points); - eval.template hessians<2, true, false>( - values_dofs, hessians_quad + 2 * n_q_points); + eval.template hessians<2, true, false>(values_dofs, + hessians_quad + + 2 * n_q_points); } hessians_quad += (dim * (dim + 1)) / 2 * n_q_points; } @@ -1114,11 +1136,13 @@ namespace internal eval.template gradients<0, false, false>(gradients_quad, values_dofs); if (dim > 1) - eval.template gradients<1, false, true>( - gradients_quad + n_q_points, values_dofs); + eval.template gradients<1, false, true>(gradients_quad + + n_q_points, + values_dofs); if (dim > 2) - eval.template gradients<2, false, true>( - gradients_quad + 2 * n_q_points, values_dofs); + eval.template gradients<2, false, true>(gradients_quad + + 2 * n_q_points, + values_dofs); } gradients_quad += dim * n_q_points; values_quad += n_q_points; @@ -1428,8 +1452,9 @@ namespace internal eval1.template values<0, true, false>(values_dofs, scratch_data); - eval2.template gradients<1, true, false>( - scratch_data, gradients_quad + n_q_points); + eval2.template gradients<1, true, false>(scratch_data, + gradients_quad + + n_q_points); if (evaluate_val == true) eval2.template values<1, true, false>(scratch_data, @@ -1442,9 +1467,10 @@ namespace internal break; case 2: - eval1.template values<0, true, false>( - values_dofs + size_deg, - gradients_quad + (dim - 1) * n_q_points); + eval1.template values<0, true, false>(values_dofs + size_deg, + gradients_quad + + (dim - 1) * + n_q_points); eval1.template gradients<0, true, false>(values_dofs, gradients_quad); if (evaluate_val == true) @@ -1551,9 +1577,10 @@ namespace internal switch (dim) { case 3: - eval2.template values<1, false, false>( - gradients_quad + 2 * n_q_points, - gradients_quad + 2 * n_q_points); + eval2.template values<1, false, false>(gradients_quad + + 2 * n_q_points, + gradients_quad + + 2 * n_q_points); eval1.template values<0, false, false>( gradients_quad + 2 * n_q_points, values_dofs + size_deg); if (symmetric_evaluate && n_q_points_1d > fe_degree) diff --git a/include/deal.II/matrix_free/face_setup_internal.h b/include/deal.II/matrix_free/face_setup_internal.h index 5a18b87567..833dea7e74 100644 --- a/include/deal.II/matrix_free/face_setup_internal.h +++ b/include/deal.II/matrix_free/face_setup_internal.h @@ -44,9 +44,9 @@ namespace internal */ struct FaceIdentifier { - FaceIdentifier() : - n_hanging_faces_smaller_subdomain(0), - n_hanging_faces_larger_subdomain(0) + FaceIdentifier() + : n_hanging_faces_smaller_subdomain(0) + , n_hanging_faces_larger_subdomain(0) {} std::vector> shared_faces; @@ -154,7 +154,8 @@ namespace internal #ifndef DOXYGEN template - FaceSetup::FaceSetup() : use_active_cells(true) + FaceSetup::FaceSetup() + : use_active_cells(true) {} @@ -973,9 +974,9 @@ namespace internal if (left_face_orientation != 0) { info.face_orientation = 8 + left_face_orientation; - Assert( - right_face_orientation == 0, - ExcMessage("Face seems to be wrongly oriented from both sides")); + Assert(right_face_orientation == 0, + ExcMessage( + "Face seems to be wrongly oriented from both sides")); } else info.face_orientation = right_face_orientation; @@ -1136,8 +1137,9 @@ namespace internal is_contiguous = false; if (is_contiguous) { - AssertIndexRange( - f, faces_type[type].size() - vectorization_width + 1); + AssertIndexRange(f, + faces_type[type].size() - + vectorization_width + 1); for (unsigned int v = 0; v < vectorization_width; ++v) { macro_face.cells_interior[v] = diff --git a/include/deal.II/matrix_free/fe_evaluation.h b/include/deal.II/matrix_free/fe_evaluation.h index bd7152da8c..b6f8680764 100644 --- a/include/deal.II/matrix_free/fe_evaluation.h +++ b/include/deal.II/matrix_free/fe_evaluation.h @@ -2867,71 +2867,71 @@ inline FEEvaluationBase::FEEvaluationBase( const unsigned int quad_no_in, const unsigned int fe_degree, const unsigned int n_q_points, - const bool is_interior_face) : - scratch_data_array(data_in.acquire_scratch_data()), - quad_no(quad_no_in), - n_fe_components(data_in.get_dof_info(dof_no).start_components.back()), - active_fe_index(fe_degree != numbers::invalid_unsigned_int ? - data_in.get_dof_info(dof_no).fe_index_from_degree( - first_selected_component, - fe_degree) : - 0), - active_quad_index(fe_degree != numbers::invalid_unsigned_int ? - (is_face ? data_in.get_mapping_info() - .face_data[quad_no_in] - .quad_index_from_n_q_points(n_q_points) : - data_in.get_mapping_info() - .cell_data[quad_no_in] - .quad_index_from_n_q_points(n_q_points)) : - 0), - n_quadrature_points(fe_degree != numbers::invalid_unsigned_int ? - n_q_points : - (is_face ? data_in - .get_shape_info(dof_no, - quad_no_in, - active_fe_index, - active_quad_index) - .n_q_points_face : - data_in - .get_shape_info(dof_no, - quad_no_in, - active_fe_index, - active_quad_index) - .n_q_points)), - matrix_info(&data_in), - dof_info(&data_in.get_dof_info(dof_no)), - mapping_data(internal::MatrixFreeFunctions:: - MappingInfoCellsOrFaces::get( - data_in.get_mapping_info(), - quad_no)), - data(&data_in.get_shape_info( - dof_no, - quad_no_in, - dof_info->component_to_base_index[first_selected_component], - active_fe_index, - active_quad_index)), - jacobian(nullptr), - J_value(nullptr), - normal_vectors(nullptr), - normal_x_jacobian(nullptr), - quadrature_weights( - mapping_data->descriptor[active_quad_index].quadrature_weights.begin()), - cell(numbers::invalid_unsigned_int), - is_interior_face(is_interior_face), - dof_access_index( - is_face ? - (is_interior_face ? - internal::MatrixFreeFunctions::DoFInfo::dof_access_face_interior : - internal::MatrixFreeFunctions::DoFInfo::dof_access_face_exterior) : - internal::MatrixFreeFunctions::DoFInfo::dof_access_cell), - cell_type(internal::MatrixFreeFunctions::general), - dof_values_initialized(false), - values_quad_initialized(false), - gradients_quad_initialized(false), - hessians_quad_initialized(false), - values_quad_submitted(false), - gradients_quad_submitted(false), - first_selected_component(first_selected_component) + const bool is_interior_face) + : scratch_data_array(data_in.acquire_scratch_data()) + , quad_no(quad_no_in) + , n_fe_components(data_in.get_dof_info(dof_no).start_components.back()) + , active_fe_index(fe_degree != numbers::invalid_unsigned_int ? + data_in.get_dof_info(dof_no).fe_index_from_degree( + first_selected_component, + fe_degree) : + 0) + , active_quad_index(fe_degree != numbers::invalid_unsigned_int ? + (is_face ? data_in.get_mapping_info() + .face_data[quad_no_in] + .quad_index_from_n_q_points(n_q_points) : + data_in.get_mapping_info() + .cell_data[quad_no_in] + .quad_index_from_n_q_points(n_q_points)) : + 0) + , n_quadrature_points(fe_degree != numbers::invalid_unsigned_int ? + n_q_points : + (is_face ? data_in + .get_shape_info(dof_no, + quad_no_in, + active_fe_index, + active_quad_index) + .n_q_points_face : + data_in + .get_shape_info(dof_no, + quad_no_in, + active_fe_index, + active_quad_index) + .n_q_points)) + , matrix_info(&data_in) + , dof_info(&data_in.get_dof_info(dof_no)) + , mapping_data(internal::MatrixFreeFunctions:: + MappingInfoCellsOrFaces::get( + data_in.get_mapping_info(), + quad_no)) + , data(&data_in.get_shape_info( + dof_no, + quad_no_in, + dof_info->component_to_base_index[first_selected_component], + active_fe_index, + active_quad_index)) + , jacobian(nullptr) + , J_value(nullptr) + , normal_vectors(nullptr) + , normal_x_jacobian(nullptr) + , quadrature_weights( + mapping_data->descriptor[active_quad_index].quadrature_weights.begin()) + , cell(numbers::invalid_unsigned_int) + , is_interior_face(is_interior_face) + , dof_access_index( + is_face ? + (is_interior_face ? + internal::MatrixFreeFunctions::DoFInfo::dof_access_face_interior : + internal::MatrixFreeFunctions::DoFInfo::dof_access_face_exterior) : + internal::MatrixFreeFunctions::DoFInfo::dof_access_cell) + , cell_type(internal::MatrixFreeFunctions::general) + , dof_values_initialized(false) + , values_quad_initialized(false) + , gradients_quad_initialized(false) + , hessians_quad_initialized(false) + , values_quad_submitted(false) + , gradients_quad_submitted(false) + , first_selected_component(first_selected_component) { set_data_pointers(); Assert(matrix_info->mapping_initialized() == true, ExcNotInitialized()); @@ -2978,37 +2978,39 @@ inline FEEvaluationBase::FEEvaluationBase( const Quadrature<1> & quadrature, const UpdateFlags update_flags, const unsigned int first_selected_component, - const FEEvaluationBase *other) : - scratch_data_array(new AlignedVector>()), - quad_no(numbers::invalid_unsigned_int), - n_fe_components(n_components_), - active_fe_index(numbers::invalid_unsigned_int), - active_quad_index(numbers::invalid_unsigned_int), - n_quadrature_points( - Utilities::fixed_power < is_face ? dim - 1 : dim > (quadrature.size())), - matrix_info(nullptr), - dof_info(nullptr), - mapping_data(nullptr), + const FEEvaluationBase *other) + : scratch_data_array(new AlignedVector>()) + , quad_no(numbers::invalid_unsigned_int) + , n_fe_components(n_components_) + , active_fe_index(numbers::invalid_unsigned_int) + , active_quad_index(numbers::invalid_unsigned_int) + , n_quadrature_points( + Utilities::fixed_power < is_face ? dim - 1 : dim > (quadrature.size())) + , matrix_info(nullptr) + , dof_info(nullptr) + , mapping_data(nullptr) + , // select the correct base element from the given FE component data(new internal::MatrixFreeFunctions::ShapeInfo>( quadrature, fe, - fe.component_to_base_index(first_selected_component).first)), - jacobian(nullptr), - J_value(nullptr), - normal_vectors(nullptr), - normal_x_jacobian(nullptr), - quadrature_weights(nullptr), - cell(0), - cell_type(internal::MatrixFreeFunctions::general), - is_interior_face(true), - dof_access_index(internal::MatrixFreeFunctions::DoFInfo::dof_access_cell), - dof_values_initialized(false), - values_quad_initialized(false), - gradients_quad_initialized(false), - hessians_quad_initialized(false), - values_quad_submitted(false), - gradients_quad_submitted(false), + fe.component_to_base_index(first_selected_component).first)) + , jacobian(nullptr) + , J_value(nullptr) + , normal_vectors(nullptr) + , normal_x_jacobian(nullptr) + , quadrature_weights(nullptr) + , cell(0) + , cell_type(internal::MatrixFreeFunctions::general) + , is_interior_face(true) + , dof_access_index(internal::MatrixFreeFunctions::DoFInfo::dof_access_cell) + , dof_values_initialized(false) + , values_quad_initialized(false) + , gradients_quad_initialized(false) + , hessians_quad_initialized(false) + , values_quad_submitted(false) + , gradients_quad_submitted(false) + , // keep the number of the selected component within the current base element // for reading dof values first_selected_component(first_selected_component) @@ -3045,41 +3047,42 @@ inline FEEvaluationBase::FEEvaluationBase( template inline FEEvaluationBase::FEEvaluationBase( - const FEEvaluationBase &other) : - scratch_data_array(other.matrix_info == nullptr ? - new AlignedVector>() : - other.matrix_info->acquire_scratch_data()), - quad_no(other.quad_no), - n_fe_components(other.n_fe_components), - active_fe_index(other.active_fe_index), - active_quad_index(other.active_quad_index), - n_quadrature_points(other.n_quadrature_points), - matrix_info(other.matrix_info), - dof_info(other.dof_info), - mapping_data(other.mapping_data), - data(other.matrix_info == nullptr ? - new internal::MatrixFreeFunctions::ShapeInfo>( - *other.data) : - other.data), - jacobian(nullptr), - J_value(nullptr), - normal_vectors(nullptr), - normal_x_jacobian(nullptr), - quadrature_weights( - other.matrix_info == nullptr ? - nullptr : - mapping_data->descriptor[active_quad_index].quadrature_weights.begin()), - cell(numbers::invalid_unsigned_int), - cell_type(internal::MatrixFreeFunctions::general), - is_interior_face(other.is_interior_face), - dof_access_index(other.dof_access_index), - dof_values_initialized(false), - values_quad_initialized(false), - gradients_quad_initialized(false), - hessians_quad_initialized(false), - values_quad_submitted(false), - gradients_quad_submitted(false), - first_selected_component(other.first_selected_component) + const FEEvaluationBase &other) + : scratch_data_array(other.matrix_info == nullptr ? + new AlignedVector>() : + other.matrix_info->acquire_scratch_data()) + , quad_no(other.quad_no) + , n_fe_components(other.n_fe_components) + , active_fe_index(other.active_fe_index) + , active_quad_index(other.active_quad_index) + , n_quadrature_points(other.n_quadrature_points) + , matrix_info(other.matrix_info) + , dof_info(other.dof_info) + , mapping_data(other.mapping_data) + , data( + other.matrix_info == nullptr ? + new internal::MatrixFreeFunctions::ShapeInfo>( + *other.data) : + other.data) + , jacobian(nullptr) + , J_value(nullptr) + , normal_vectors(nullptr) + , normal_x_jacobian(nullptr) + , quadrature_weights( + other.matrix_info == nullptr ? + nullptr : + mapping_data->descriptor[active_quad_index].quadrature_weights.begin()) + , cell(numbers::invalid_unsigned_int) + , cell_type(internal::MatrixFreeFunctions::general) + , is_interior_face(other.is_interior_face) + , dof_access_index(other.dof_access_index) + , dof_values_initialized(false) + , values_quad_initialized(false) + , gradients_quad_initialized(false) + , hessians_quad_initialized(false) + , values_quad_submitted(false) + , gradients_quad_submitted(false) + , first_selected_component(other.first_selected_component) { set_data_pointers(); @@ -3431,12 +3434,12 @@ namespace internal { (void)vec; (void)dof_info; - Assert( - vec.partitioners_are_compatible(*dof_info.vector_partitioner), - ExcMessage("The parallel layout of the given vector is not " - "compatible with the parallel partitioning in MatrixFree. " - "Use MatrixFree::initialize_dof_vector to get a " - "compatible vector.")); + Assert(vec.partitioners_are_compatible(*dof_info.vector_partitioner), + ExcMessage( + "The parallel layout of the given vector is not " + "compatible with the parallel partitioning in MatrixFree. " + "Use MatrixFree::initialize_dof_vector to get a " + "compatible vector.")); } // A class to use the same code to read from and write to vector @@ -3458,8 +3461,10 @@ namespace internal VectorizedArray *dof_values, std::integral_constant) const { - dealii::vectorized_load_and_transpose( - dofs_per_cell, vec.begin(), dof_indices, dof_values); + dealii::vectorized_load_and_transpose(dofs_per_cell, + vec.begin(), + dof_indices, + dof_values); } @@ -4014,8 +4019,9 @@ FEEvaluationBase::read_write_operation( for (unsigned int v = 0; v < n_vectorization_actual; ++v) for (unsigned int i = 0; i < dofs_per_component; ++i) for (unsigned int comp = 0; comp < n_components; ++comp) - operation.process_dof( - dof_indices[v][i], *src[comp], values_dofs[comp][i][v]); + operation.process_dof(dof_indices[v][i], + *src[comp], + values_dofs[comp][i][v]); } else { @@ -4096,15 +4102,15 @@ FEEvaluationBase::read_write_operation( if (n_components == 1 || n_fe_components == 1) { for (unsigned int c = 0; c < n_components; ++c) - Assert( - src[c] != nullptr, - ExcMessage("The finite element underlying this FEEvaluation " - "object is scalar, but you requested " + - std::to_string(n_components) + - " components via the template argument in " - "FEEvaluation. In that case, you must pass an " - "std::vector or a BlockVector to " + - "read_dof_values and distribute_local_to_global.")); + Assert(src[c] != nullptr, + ExcMessage( + "The finite element underlying this FEEvaluation " + "object is scalar, but you requested " + + std::to_string(n_components) + + " components via the template argument in " + "FEEvaluation. In that case, you must pass an " + "std::vector or a BlockVector to " + + "read_dof_values and distribute_local_to_global.")); unsigned int ind_local = 0; for (; index_indicators != next_index_indicators; ++index_indicators) @@ -4134,8 +4140,10 @@ FEEvaluationBase::read_write_operation( matrix_info->constraint_pool_end(indicator.second); for (; data_val != end_pool; ++data_val, ++dof_indices[v]) for (unsigned int comp = 0; comp < n_components; ++comp) - operation.process_constraint( - *dof_indices[v], *data_val, *src[comp], value[comp]); + operation.process_constraint(*dof_indices[v], + *data_val, + *src[comp], + value[comp]); for (unsigned int comp = 0; comp < n_components; ++comp) operation.post_constraints(value[comp], @@ -4147,8 +4155,9 @@ FEEvaluationBase::read_write_operation( for (; ind_local < dofs_per_component; ++dof_indices[v], ++ind_local) for (unsigned int comp = 0; comp < n_components; ++comp) - operation.process_dof( - *dof_indices[v], *src[comp], values_dofs[comp][ind_local][v]); + operation.process_dof(*dof_indices[v], + *src[comp], + values_dofs[comp][ind_local][v]); } else { @@ -4188,8 +4197,10 @@ FEEvaluationBase::read_write_operation( matrix_info->constraint_pool_end(indicator.second); for (; data_val != end_pool; ++data_val, ++dof_indices[v]) - operation.process_constraint( - *dof_indices[v], *data_val, *src[0], value); + operation.process_constraint(*dof_indices[v], + *data_val, + *src[0], + value); operation.post_constraints(value, values_dofs[comp][ind_local][v]); @@ -4203,8 +4214,9 @@ FEEvaluationBase::read_write_operation( ++dof_indices[v], ++ind_local) { AssertIndexRange(*dof_indices[v], src[0]->size()); - operation.process_dof( - *dof_indices[v], *src[0], values_dofs[comp][ind_local][v]); + operation.process_dof(*dof_indices[v], + *src[0], + values_dofs[comp][ind_local][v]); } if (apply_constraints == true && comp + 1 < n_components) @@ -4322,8 +4334,9 @@ FEEvaluationBase:: if (n_components == 1 || n_fe_components == 1) for (unsigned int v = 0; v < vectorization_populated; ++v) for (unsigned int i = 0; i < data->dofs_per_component_on_cell; ++i) - operation.process_dof( - dof_indices[v] + i, *src[comp], values_dofs[comp][i][v]); + operation.process_dof(dof_indices[v] + i, + *src[comp], + values_dofs[comp][i][v]); else for (unsigned int v = 0; v < vectorization_populated; ++v) for (unsigned int i = 0; i < data->dofs_per_component_on_cell; ++i) @@ -4782,8 +4795,10 @@ FEEvaluationBase::get_hessian( // compute laplacian before the gradient because it needs to access // unscaled gradient data VectorizedArray tmp[dim][dim]; - internal::hessian_unit_times_jac( - jac, this->hessians_quad[comp], q_point, tmp); + internal::hessian_unit_times_jac(jac, + this->hessians_quad[comp], + q_point, + tmp); // compute first part of hessian, J * tmp = J * hess_unit(u) * J^T for (unsigned int d = 0; d < dim; ++d) @@ -4817,8 +4832,10 @@ FEEvaluationBase::get_hessian( // compute laplacian before the gradient because it needs to access // unscaled gradient data VectorizedArray tmp[dim][dim]; - internal::hessian_unit_times_jac( - jac, this->hessians_quad[comp], q_point, tmp); + internal::hessian_unit_times_jac(jac, + this->hessians_quad[comp], + q_point, + tmp); // compute first part of hessian, J * tmp = J * hess_unit(u) * J^T for (unsigned int d = 0; d < dim; ++d) @@ -4888,8 +4905,10 @@ FEEvaluationBase::get_hessian_diagonal( // compute laplacian before the gradient because it needs to access // unscaled gradient data VectorizedArray tmp[dim][dim]; - internal::hessian_unit_times_jac( - jac, this->hessians_quad[comp], q_point, tmp); + internal::hessian_unit_times_jac(jac, + this->hessians_quad[comp], + q_point, + tmp); // compute only the trace part of hessian, J * tmp = J * // hess_unit(u) * J^T @@ -4914,8 +4933,10 @@ FEEvaluationBase::get_hessian_diagonal( // compute laplacian before the gradient because it needs to access // unscaled gradient data VectorizedArray tmp[dim][dim]; - internal::hessian_unit_times_jac( - jac, this->hessians_quad[comp], q_point, tmp); + internal::hessian_unit_times_jac(jac, + this->hessians_quad[comp], + q_point, + tmp); // compute only the trace part of hessian, J * tmp = J * // hess_unit(u) * J^T @@ -5126,15 +5147,15 @@ inline FEEvaluationAccess:: const unsigned int quad_no_in, const unsigned int fe_degree, const unsigned int n_q_points, - const bool is_interior_face) : - FEEvaluationBase( - data_in, - dof_no, - first_selected_component, - quad_no_in, - fe_degree, - n_q_points, - is_interior_face) + const bool is_interior_face) + : FEEvaluationBase( + data_in, + dof_no, + first_selected_component, + quad_no_in, + fe_degree, + n_q_points, + is_interior_face) {} @@ -5148,14 +5169,14 @@ inline FEEvaluationAccess:: const Quadrature<1> & quadrature, const UpdateFlags update_flags, const unsigned int first_selected_component, - const FEEvaluationBase *other) : - FEEvaluationBase( - mapping, - fe, - quadrature, - update_flags, - first_selected_component, - other) + const FEEvaluationBase *other) + : FEEvaluationBase( + mapping, + fe, + quadrature, + update_flags, + first_selected_component, + other) {} @@ -5163,8 +5184,8 @@ inline FEEvaluationAccess:: template inline FEEvaluationAccess:: FEEvaluationAccess( - const FEEvaluationAccess &other) : - FEEvaluationBase(other) + const FEEvaluationAccess &other) + : FEEvaluationBase(other) {} @@ -5191,14 +5212,14 @@ inline FEEvaluationAccess::FEEvaluationAccess( const unsigned int quad_no_in, const unsigned int fe_degree, const unsigned int n_q_points, - const bool is_interior_face) : - FEEvaluationBase(data_in, - dof_no, - first_selected_component, - quad_no_in, - fe_degree, - n_q_points, - is_interior_face) + const bool is_interior_face) + : FEEvaluationBase(data_in, + dof_no, + first_selected_component, + quad_no_in, + fe_degree, + n_q_points, + is_interior_face) {} @@ -5211,21 +5232,21 @@ inline FEEvaluationAccess::FEEvaluationAccess( const Quadrature<1> & quadrature, const UpdateFlags update_flags, const unsigned int first_selected_component, - const FEEvaluationBase *other) : - FEEvaluationBase(mapping, - fe, - quadrature, - update_flags, - first_selected_component, - other) + const FEEvaluationBase *other) + : FEEvaluationBase(mapping, + fe, + quadrature, + update_flags, + first_selected_component, + other) {} template inline FEEvaluationAccess::FEEvaluationAccess( - const FEEvaluationAccess &other) : - FEEvaluationBase(other) + const FEEvaluationAccess &other) + : FEEvaluationBase(other) {} @@ -5476,14 +5497,14 @@ inline FEEvaluationAccess::FEEvaluationAccess( const unsigned int quad_no_in, const unsigned int fe_degree, const unsigned int n_q_points, - const bool is_interior_face) : - FEEvaluationBase(data_in, - dof_no, - first_selected_component, - quad_no_in, - fe_degree, - n_q_points, - is_interior_face) + const bool is_interior_face) + : FEEvaluationBase(data_in, + dof_no, + first_selected_component, + quad_no_in, + fe_degree, + n_q_points, + is_interior_face) {} @@ -5496,21 +5517,21 @@ inline FEEvaluationAccess::FEEvaluationAccess( const Quadrature<1> & quadrature, const UpdateFlags update_flags, const unsigned int first_selected_component, - const FEEvaluationBase *other) : - FEEvaluationBase(mapping, - fe, - quadrature, - update_flags, - first_selected_component, - other) + const FEEvaluationBase *other) + : FEEvaluationBase(mapping, + fe, + quadrature, + update_flags, + first_selected_component, + other) {} template inline FEEvaluationAccess::FEEvaluationAccess( - const FEEvaluationAccess &other) : - FEEvaluationBase(other) + const FEEvaluationAccess &other) + : FEEvaluationBase(other) {} @@ -5623,9 +5644,9 @@ inline DEAL_II_ALWAYS_INLINE switch (dim) { case 1: - Assert( - false, - ExcMessage("Computing the curl in 1d is not a useful operation")); + Assert(false, + ExcMessage( + "Computing the curl in 1d is not a useful operation")); break; case 2: curl[0] = grad[1][0] - grad[0][1]; @@ -5817,9 +5838,9 @@ FEEvaluationAccess::submit_curl( switch (dim) { case 1: - Assert( - false, - ExcMessage("Testing by the curl in 1d is not a useful operation")); + Assert(false, + ExcMessage( + "Testing by the curl in 1d is not a useful operation")); break; case 2: grad[1][0] = curl[0]; @@ -5851,14 +5872,14 @@ inline FEEvaluationAccess<1, 1, Number, is_face>::FEEvaluationAccess( const unsigned int quad_no_in, const unsigned int fe_degree, const unsigned int n_q_points, - const bool is_interior_face) : - FEEvaluationBase<1, 1, Number, is_face>(data_in, - dof_no, - first_selected_component, - quad_no_in, - fe_degree, - n_q_points, - is_interior_face) + const bool is_interior_face) + : FEEvaluationBase<1, 1, Number, is_face>(data_in, + dof_no, + first_selected_component, + quad_no_in, + fe_degree, + n_q_points, + is_interior_face) {} @@ -5871,21 +5892,21 @@ inline FEEvaluationAccess<1, 1, Number, is_face>::FEEvaluationAccess( const Quadrature<1> & quadrature, const UpdateFlags update_flags, const unsigned int first_selected_component, - const FEEvaluationBase<1, n_components_other, Number, is_face> *other) : - FEEvaluationBase<1, 1, Number, is_face>(mapping, - fe, - quadrature, - update_flags, - first_selected_component, - other) + const FEEvaluationBase<1, n_components_other, Number, is_face> *other) + : FEEvaluationBase<1, 1, Number, is_face>(mapping, + fe, + quadrature, + update_flags, + first_selected_component, + other) {} template inline FEEvaluationAccess<1, 1, Number, is_face>::FEEvaluationAccess( - const FEEvaluationAccess<1, 1, Number, is_face> &other) : - FEEvaluationBase<1, 1, Number, is_face>(other) + const FEEvaluationAccess<1, 1, Number, is_face> &other) + : FEEvaluationBase<1, 1, Number, is_face>(other) {} @@ -6124,16 +6145,16 @@ inline FEEvaluation:: FEEvaluation(const MatrixFree &data_in, const unsigned int fe_no, const unsigned int quad_no, - const unsigned int first_selected_component) : - BaseClass(data_in, - fe_no, - first_selected_component, - quad_no, - fe_degree, - static_n_q_points), - dofs_per_component(this->data->dofs_per_component_on_cell), - dofs_per_cell(this->data->dofs_per_component_on_cell * n_components_), - n_q_points(this->data->n_q_points) + const unsigned int first_selected_component) + : BaseClass(data_in, + fe_no, + first_selected_component, + quad_no, + fe_degree, + static_n_q_points) + , dofs_per_component(this->data->dofs_per_component_on_cell) + , dofs_per_cell(this->data->dofs_per_component_on_cell * n_components_) + , n_q_points(this->data->n_q_points) { check_template_arguments(fe_no, 0); } @@ -6150,16 +6171,16 @@ inline FEEvaluation:: const FiniteElement &fe, const Quadrature<1> & quadrature, const UpdateFlags update_flags, - const unsigned int first_selected_component) : - BaseClass(mapping, - fe, - quadrature, - update_flags, - first_selected_component, - static_cast *>(nullptr)), - dofs_per_component(this->data->dofs_per_component_on_cell), - dofs_per_cell(this->data->dofs_per_component_on_cell * n_components_), - n_q_points(this->data->n_q_points) + const unsigned int first_selected_component) + : BaseClass(mapping, + fe, + quadrature, + update_flags, + first_selected_component, + static_cast *>(nullptr)) + , dofs_per_component(this->data->dofs_per_component_on_cell) + , dofs_per_cell(this->data->dofs_per_component_on_cell * n_components_) + , n_q_points(this->data->n_q_points) { check_template_arguments(numbers::invalid_unsigned_int, 0); } @@ -6175,16 +6196,16 @@ inline FEEvaluation:: FEEvaluation(const FiniteElement &fe, const Quadrature<1> & quadrature, const UpdateFlags update_flags, - const unsigned int first_selected_component) : - BaseClass(StaticMappingQ1::mapping, - fe, - quadrature, - update_flags, - first_selected_component, - static_cast *>(nullptr)), - dofs_per_component(this->data->dofs_per_component_on_cell), - dofs_per_cell(this->data->dofs_per_component_on_cell * n_components_), - n_q_points(this->data->n_q_points) + const unsigned int first_selected_component) + : BaseClass(StaticMappingQ1::mapping, + fe, + quadrature, + update_flags, + first_selected_component, + static_cast *>(nullptr)) + , dofs_per_component(this->data->dofs_per_component_on_cell) + , dofs_per_cell(this->data->dofs_per_component_on_cell * n_components_) + , n_q_points(this->data->n_q_points) { check_template_arguments(numbers::invalid_unsigned_int, 0); } @@ -6200,16 +6221,16 @@ template inline FEEvaluation:: FEEvaluation(const FiniteElement & fe, const FEEvaluationBase &other, - const unsigned int first_selected_component) : - BaseClass(other.mapped_geometry->get_fe_values().get_mapping(), - fe, - other.mapped_geometry->get_quadrature(), - other.mapped_geometry->get_fe_values().get_update_flags(), - first_selected_component, - &other), - dofs_per_component(this->data->dofs_per_component_on_cell), - dofs_per_cell(this->data->dofs_per_component_on_cell * n_components_), - n_q_points(this->data->n_q_points) + const unsigned int first_selected_component) + : BaseClass(other.mapped_geometry->get_fe_values().get_mapping(), + fe, + other.mapped_geometry->get_quadrature(), + other.mapped_geometry->get_fe_values().get_update_flags(), + first_selected_component, + &other) + , dofs_per_component(this->data->dofs_per_component_on_cell) + , dofs_per_cell(this->data->dofs_per_component_on_cell * n_components_) + , n_q_points(this->data->n_q_points) { check_template_arguments(numbers::invalid_unsigned_int, 0); } @@ -6222,11 +6243,11 @@ template inline FEEvaluation:: - FEEvaluation(const FEEvaluation &other) : - BaseClass(other), - dofs_per_component(this->data->dofs_per_component_on_cell), - dofs_per_cell(this->data->dofs_per_component_on_cell * n_components_), - n_q_points(this->data->n_q_points) + FEEvaluation(const FEEvaluation &other) + : BaseClass(other) + , dofs_per_component(this->data->dofs_per_component_on_cell) + , dofs_per_cell(this->data->dofs_per_component_on_cell * n_components_) + , n_q_points(this->data->n_q_points) { check_template_arguments(numbers::invalid_unsigned_int, 0); } @@ -6725,17 +6746,17 @@ inline FEFaceEvaluation:: const bool is_interior_face, const unsigned int dof_no, const unsigned int quad_no, - const unsigned int first_selected_component) : - BaseClass(matrix_free, - dof_no, - first_selected_component, - quad_no, - fe_degree, - static_n_q_points, - is_interior_face), - dofs_per_component(this->data->dofs_per_component_on_cell), - dofs_per_cell(this->data->dofs_per_component_on_cell * n_components_), - n_q_points(this->data->n_q_points_face) + const unsigned int first_selected_component) + : BaseClass(matrix_free, + dof_no, + first_selected_component, + quad_no, + fe_degree, + static_n_q_points, + is_interior_face) + , dofs_per_component(this->data->dofs_per_component_on_cell) + , dofs_per_cell(this->data->dofs_per_component_on_cell * n_components_) + , n_q_points(this->data->n_q_points_face) {} @@ -6845,10 +6866,10 @@ FEFaceEvaluation::reinit( Assert(this->mapped_geometry == nullptr, ExcMessage("FEEvaluation was initialized without a matrix-free object." " Integer indexing is not possible")); - Assert( - this->is_interior_face == true, - ExcMessage("Cell-based FEFaceEvaluation::reinit only possible for the " - "interior face with second argument to constructor as true")); + Assert(this->is_interior_face == true, + ExcMessage( + "Cell-based FEFaceEvaluation::reinit only possible for the " + "interior face with second argument to constructor as true")); if (this->mapped_geometry != nullptr) return; Assert(this->matrix_info != nullptr, ExcNotInitialized()); diff --git a/include/deal.II/matrix_free/mapping_data_on_the_fly.h b/include/deal.II/matrix_free/mapping_data_on_the_fly.h index 5daa285da9..f42bc67008 100644 --- a/include/deal.II/matrix_free/mapping_data_on_the_fly.h +++ b/include/deal.II/matrix_free/mapping_data_on_the_fly.h @@ -160,12 +160,12 @@ namespace internal inline MappingDataOnTheFly::MappingDataOnTheFly( const Mapping & mapping, const Quadrature<1> &quadrature, - const UpdateFlags update_flags) : - fe_values(mapping, - fe_dummy, - Quadrature(quadrature), - MappingInfo::compute_update_flags(update_flags)), - quadrature_1d(quadrature) + const UpdateFlags update_flags) + : fe_values(mapping, + fe_dummy, + Quadrature(quadrature), + MappingInfo::compute_update_flags(update_flags)) + , quadrature_1d(quadrature) { mapping_info_storage.descriptor.resize(1); mapping_info_storage.descriptor[0].initialize(quadrature); @@ -194,10 +194,10 @@ namespace internal template inline MappingDataOnTheFly::MappingDataOnTheFly( const Quadrature<1> &quadrature, - const UpdateFlags update_flags) : - MappingDataOnTheFly(::dealii::StaticMappingQ1::mapping, - quadrature, - update_flags) + const UpdateFlags update_flags) + : MappingDataOnTheFly(::dealii::StaticMappingQ1::mapping, + quadrature, + update_flags) {} diff --git a/include/deal.II/matrix_free/mapping_info.templates.h b/include/deal.II/matrix_free/mapping_info.templates.h index 5e1f2d749d..c67600eee1 100644 --- a/include/deal.II/matrix_free/mapping_info.templates.h +++ b/include/deal.II/matrix_free/mapping_info.templates.h @@ -39,8 +39,8 @@ namespace internal template MappingInfoStorage::QuadratureDescriptor :: - QuadratureDescriptor() : - n_q_points(numbers::invalid_unsigned_int) + QuadratureDescriptor() + : n_q_points(numbers::invalid_unsigned_int) {} @@ -312,8 +312,8 @@ namespace internal template struct CompressedCellData { - CompressedCellData(const double expected_size) : - data(FPArrayComparator(expected_size)) + CompressedCellData(const double expected_size) + : data(FPArrayComparator(expected_size)) {} std::map< @@ -347,8 +347,8 @@ namespace internal template - LocalData::LocalData(const double jac_size_in) : - jac_size(jac_size_in) + LocalData::LocalData(const double jac_size_in) + : jac_size(jac_size_in) {} @@ -1176,9 +1176,9 @@ namespace internal // select the inverse of the Jacobian (not the Jacobian as in the // CompressedCellData) and add another factor of 512 to account for // some roundoff effects. - CompressedFaceData(const Number jacobian_size) : - data(FPArrayComparator(512. / jacobian_size)), - jacobian_size(jacobian_size) + CompressedFaceData(const Number jacobian_size) + : data(FPArrayComparator(512. / jacobian_size)) + , jacobian_size(jacobian_size) {} // Store the Jacobians on both sides of a face (2*(dim*dim) entries), @@ -1223,9 +1223,9 @@ namespace internal else if (dim == 1) return 0; else - Assert( - false, - ExcNotImplemented("Not possible in dim=" + std::to_string(dim))); + Assert(false, + ExcNotImplemented("Not possible in dim=" + + std::to_string(dim))); return numbers::invalid_unsigned_int; } @@ -1848,13 +1848,14 @@ namespace internal // finally compute the normal times the jacobian for (unsigned int i = 0; i < data_faces_local.size(); ++i) - tasks += Threads::new_task( - &compute_normal_times_jacobian, - work_per_chunk * i, - std::min(work_per_chunk * (i + 1), (unsigned int)faces.size()), - face_type, - faces, - face_data[my_q]); + tasks += + Threads::new_task(&compute_normal_times_jacobian, + work_per_chunk * i, + std::min(work_per_chunk * (i + 1), + (unsigned int)faces.size()), + face_type, + faces, + face_data[my_q]); tasks.join_all(); } } @@ -2098,11 +2099,13 @@ namespace internal const SizeInfo &task_info) const { out << " Cell types: "; - task_info.print_memory_statistics( - out, cell_type.capacity() * sizeof(GeometryType)); + task_info.print_memory_statistics(out, + cell_type.capacity() * + sizeof(GeometryType)); out << " Face types: "; - task_info.print_memory_statistics( - out, face_type.capacity() * sizeof(GeometryType)); + task_info.print_memory_statistics(out, + face_type.capacity() * + sizeof(GeometryType)); for (unsigned int j = 0; j < cell_data.size(); ++j) { out << " Data component " << j << std::endl; @@ -2116,8 +2119,8 @@ namespace internal /* ------------------------------------------------------------------ */ template - FPArrayComparator::FPArrayComparator(const Number scaling) : - tolerance(scaling * std::numeric_limits::epsilon() * 1024.) + FPArrayComparator::FPArrayComparator(const Number scaling) + : tolerance(scaling * std::numeric_limits::epsilon() * 1024.) {} diff --git a/include/deal.II/matrix_free/matrix_free.h b/include/deal.II/matrix_free/matrix_free.h index efac0ef568..d8a4fd883b 100644 --- a/include/deal.II/matrix_free/matrix_free.h +++ b/include/deal.II/matrix_free/matrix_free.h @@ -217,20 +217,21 @@ public: const bool initialize_mapping = true, const bool overlap_communication_computation = true, const bool hold_all_faces_to_owned_cells = false, - const bool cell_vectorization_categories_strict = false) : - tasks_parallel_scheme(tasks_parallel_scheme), - tasks_block_size(tasks_block_size), - mapping_update_flags(mapping_update_flags), - mapping_update_flags_boundary_faces(mapping_update_flags_boundary_faces), - mapping_update_flags_inner_faces(mapping_update_flags_inner_faces), - mapping_update_flags_faces_by_cells(mapping_update_flags_faces_by_cells), - level_mg_handler(level_mg_handler), - store_plain_indices(store_plain_indices), - initialize_indices(initialize_indices), - initialize_mapping(initialize_mapping), - overlap_communication_computation(overlap_communication_computation), - hold_all_faces_to_owned_cells(hold_all_faces_to_owned_cells), - cell_vectorization_categories_strict(cell_vectorization_categories_strict) + const bool cell_vectorization_categories_strict = false) + : tasks_parallel_scheme(tasks_parallel_scheme) + , tasks_block_size(tasks_block_size) + , mapping_update_flags(mapping_update_flags) + , mapping_update_flags_boundary_faces(mapping_update_flags_boundary_faces) + , mapping_update_flags_inner_faces(mapping_update_flags_inner_faces) + , mapping_update_flags_faces_by_cells(mapping_update_flags_faces_by_cells) + , level_mg_handler(level_mg_handler) + , store_plain_indices(store_plain_indices) + , initialize_indices(initialize_indices) + , initialize_mapping(initialize_mapping) + , overlap_communication_computation(overlap_communication_computation) + , hold_all_faces_to_owned_cells(hold_all_faces_to_owned_cells) + , cell_vectorization_categories_strict( + cell_vectorization_categories_strict) {} /** @@ -1645,10 +1646,10 @@ private: */ struct DoFHandlers { - DoFHandlers() : - active_dof_handler(usual), - n_dof_handlers(0), - level(numbers::invalid_unsigned_int) + DoFHandlers() + : active_dof_handler(usual) + , n_dof_handlers(0) + , level(numbers::invalid_unsigned_int) {} std::vector>> dof_handler; @@ -2040,8 +2041,9 @@ MatrixFree::create_cell_subrange_hp( if (fe_index >= dof_info[dof_handler_component].max_fe_index) return std::pair(range.second, range.second); else - return create_cell_subrange_hp_by_index( - range, fe_index, dof_handler_component); + return create_cell_subrange_hp_by_index(range, + fe_index, + dof_handler_component); } @@ -2644,17 +2646,16 @@ namespace internal const dealii::MatrixFree &matrix_free, const typename dealii::MatrixFree::DataAccessOnFaces vector_face_access, - const unsigned int n_components) : - matrix_free(matrix_free), - vector_face_access( - matrix_free.get_task_info().face_partition_data.empty() ? - dealii::MatrixFree::DataAccessOnFaces::unspecified : - vector_face_access), - ghosts_were_set(false) + const unsigned int n_components) + : matrix_free(matrix_free) + , vector_face_access( + matrix_free.get_task_info().face_partition_data.empty() ? + dealii::MatrixFree::DataAccessOnFaces::unspecified : + vector_face_access) + , ghosts_were_set(false) # ifdef DEAL_II_WITH_MPI - , - tmp_data(n_components), - requests(n_components) + , tmp_data(n_components) + , requests(n_components) # endif { (void)n_components; @@ -3658,22 +3659,23 @@ namespace internal const typename MF::DataAccessOnFaces src_vector_face_access = MF::DataAccessOnFaces::none, const typename MF::DataAccessOnFaces dst_vector_face_access = - MF::DataAccessOnFaces::none) : - matrix_free(matrix_free), - container(const_cast(container)), - cell_function(cell_function), - face_function(face_function), - boundary_function(boundary_function), - src(src), - dst(dst), - src_data_exchanger(matrix_free, - src_vector_face_access, - n_components(src)), - dst_data_exchanger(matrix_free, - dst_vector_face_access, - n_components(dst)), - src_and_dst_are_same(PointerComparison::equal(&src, &dst)), - zero_dst_vector_setting(zero_dst_vector_setting && !src_and_dst_are_same) + MF::DataAccessOnFaces::none) + : matrix_free(matrix_free) + , container(const_cast(container)) + , cell_function(cell_function) + , face_function(face_function) + , boundary_function(boundary_function) + , src(src) + , dst(dst) + , src_data_exchanger(matrix_free, + src_vector_face_access, + n_components(src)) + , dst_data_exchanger(matrix_free, + dst_vector_face_access, + n_components(dst)) + , src_and_dst_are_same(PointerComparison::equal(&src, &dst)) + , zero_dst_vector_setting(zero_dst_vector_setting && + !src_and_dst_are_same) {} // Runs the cell work. If no function is given, nothing is done @@ -3784,10 +3786,10 @@ namespace internal MFClassWrapper(const function_type cell, const function_type face, - const function_type boundary) : - cell(cell), - face(face), - boundary(boundary) + const function_type boundary) + : cell(cell) + , face(face) + , boundary(boundary) {} void diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index ee678aba73..c2e4550916 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -52,17 +52,17 @@ DEAL_II_NAMESPACE_OPEN // --------------------- MatrixFree ----------------------------------- template -MatrixFree::MatrixFree() : - Subscriptor(), - indices_are_initialized(false), - mapping_is_initialized(false) +MatrixFree::MatrixFree() + : Subscriptor() + , indices_are_initialized(false) + , mapping_is_initialized(false) {} template -MatrixFree::MatrixFree(const MatrixFree &other) : - Subscriptor() +MatrixFree::MatrixFree(const MatrixFree &other) + : Subscriptor() { copy_from(other); } @@ -175,8 +175,10 @@ MatrixFree::get_cell_iterator(const unsigned int macro_cell_number, std::pair index = cell_level_index[macro_cell_number * vectorization_length + vector_number]; - return typename DoFHandler::cell_iterator( - &dofh->get_triangulation(), index.first, index.second, dofh); + return typename DoFHandler::cell_iterator(&dofh->get_triangulation(), + index.first, + index.second, + dofh); } @@ -199,8 +201,10 @@ MatrixFree::get_hp_cell_iterator( const hp::DoFHandler *dofh = dof_handlers.hp_dof_handler[dof_index]; std::pair index = cell_level_index[macro_cell_number * vectorization_length + vector_number]; - return typename hp::DoFHandler::cell_iterator( - &dofh->get_triangulation(), index.first, index.second, dofh); + return typename hp::DoFHandler::cell_iterator(&dofh->get_triangulation(), + index.first, + index.second, + dofh); } @@ -653,8 +657,9 @@ MatrixFree::initialize_dof_handlers( my_pid : numbers::invalid_subdomain_id; for (; cell != end_cell; ++cell) - internal::MatrixFreeFunctions::resolve_cell( - cell, cell_level_index, subdomain_id); + internal::MatrixFreeFunctions::resolve_cell(cell, + cell_level_index, + subdomain_id); Assert(n_mpi_procs > 1 || cell_level_index.size() == tria.n_active_cells(), @@ -725,8 +730,9 @@ MatrixFree::initialize_dof_handlers( my_pid : numbers::invalid_subdomain_id; for (; cell != end_cell; ++cell) - internal::MatrixFreeFunctions::resolve_cell( - cell, cell_level_index, subdomain_id); + internal::MatrixFreeFunctions::resolve_cell(cell, + cell_level_index, + subdomain_id); Assert(n_mpi_procs > 1 || cell_level_index.size() == tria.n_active_cells(), ExcInternalError()); @@ -856,8 +862,9 @@ MatrixFree::initialize_indices( // set locally owned range for each component Assert(locally_owned_set[no].is_contiguous(), ExcNotImplemented()); - dof_info[no].vector_partitioner.reset(new Utilities::MPI::Partitioner( - locally_owned_set[no], task_info.communicator)); + dof_info[no].vector_partitioner.reset( + new Utilities::MPI::Partitioner(locally_owned_set[no], + task_info.communicator)); // initialize the arrays for indices const unsigned int n_components_total = @@ -1065,8 +1072,9 @@ MatrixFree::initialize_indices( // can parallelize by threads Assert(additional_data.cell_vectorization_category.empty(), ExcNotImplemented()); - task_info.initial_setup_blocks_tasks( - subdomain_boundary_cells, renumbering, irregular_cells); + task_info.initial_setup_blocks_tasks(subdomain_boundary_cells, + renumbering, + irregular_cells); task_info.guess_block_size(dof_info[0].dofs_per_cell[0]); unsigned int n_macro_cells_before = @@ -1187,8 +1195,9 @@ MatrixFree::initialize_indices( update_default) make_connectivity_graph_faces(connectivity); if (task_info.n_active_cells > 0) - dof_info[0].make_connectivity_graph( - task_info, renumbering, connectivity); + dof_info[0].make_connectivity_graph(task_info, + renumbering, + connectivity); task_info.make_thread_graph(dof_info[0].cell_active_fe_index, connectivity, @@ -1304,8 +1313,10 @@ MatrixFree::initialize_indices( AssertDimension(constraint_pool_data.size(), length); for (unsigned int no = 0; no < n_fe; ++no) - dof_info[no].reorder_cells( - task_info, renumbering, constraint_pool_row_index, irregular_cells); + dof_info[no].reorder_cells(task_info, + renumbering, + constraint_pool_row_index, + irregular_cells); // Finally resort the faces and collect several faces for vectorization if ((additional_data.mapping_update_flags_inner_faces | @@ -1465,9 +1476,9 @@ MatrixFree::initialize_indices( dof_info[no].plain_dof_indices[i])); } std::sort(ghost_indices.begin(), ghost_indices.end()); - ghost_indices.erase( - std::unique(ghost_indices.begin(), ghost_indices.end()), - ghost_indices.end()); + ghost_indices.erase(std::unique(ghost_indices.begin(), + ghost_indices.end()), + ghost_indices.end()); IndexSet compressed_set(part.size()); compressed_set.add_indices(ghost_indices.begin(), ghost_indices.end()); @@ -1560,8 +1571,9 @@ MatrixFree::initialize_indices( stride)); i += shape.dofs_per_component_on_cell * stride; } - AssertDimension( - i, dof_info[no].dofs_per_cell[0] * stride); + AssertDimension(i, + dof_info[no].dofs_per_cell[0] * + stride); } else if (dof_info[no].index_storage_variants [internal::MatrixFreeFunctions::DoFInfo:: @@ -1570,13 +1582,14 @@ MatrixFree::initialize_indices( IndexStorageVariants::contiguous) has_noncontiguous_cell = true; } - has_noncontiguous_cell = Utilities::MPI::min( - (int)has_noncontiguous_cell, task_info.communicator); + has_noncontiguous_cell = + Utilities::MPI::min((int)has_noncontiguous_cell, + task_info.communicator); std::sort(ghost_indices.begin(), ghost_indices.end()); - ghost_indices.erase( - std::unique(ghost_indices.begin(), ghost_indices.end()), - ghost_indices.end()); + ghost_indices.erase(std::unique(ghost_indices.begin(), + ghost_indices.end()), + ghost_indices.end()); IndexSet compressed_set(part.size()); compressed_set.add_indices(ghost_indices.begin(), ghost_indices.end()); @@ -1673,14 +1686,15 @@ MatrixFree::initialize_indices( stride)); i += shape.dofs_per_component_on_cell * stride; } - AssertDimension( - i, dof_info[no].dofs_per_cell[0] * stride); + AssertDimension(i, + dof_info[no].dofs_per_cell[0] * + stride); } } std::sort(ghost_indices.begin(), ghost_indices.end()); - ghost_indices.erase( - std::unique(ghost_indices.begin(), ghost_indices.end()), - ghost_indices.end()); + ghost_indices.erase(std::unique(ghost_indices.begin(), + ghost_indices.end()), + ghost_indices.end()); IndexSet compressed_set(part.size()); compressed_set.add_indices(ghost_indices.begin(), ghost_indices.end()); @@ -1798,10 +1812,10 @@ namespace internal } } std::sort(new_indices.begin(), new_indices.end()); - connectivity_direct.add_entries( - cell, - new_indices.begin(), - std::unique(new_indices.begin(), new_indices.end())); + connectivity_direct.add_entries(cell, + new_indices.begin(), + std::unique(new_indices.begin(), + new_indices.end())); } } @@ -1830,10 +1844,10 @@ namespace internal new_indices.push_back(it_neigh->column()); } std::sort(new_indices.begin(), new_indices.end()); - connectivity.add_entries( - block, - new_indices.begin(), - std::unique(new_indices.begin(), new_indices.end())); + connectivity.add_entries(block, + new_indices.begin(), + std::unique(new_indices.begin(), + new_indices.end())); } } } // namespace diff --git a/include/deal.II/matrix_free/operators.h b/include/deal.II/matrix_free/operators.h index 8d7570ec52..59b8054383 100644 --- a/include/deal.II/matrix_free/operators.h +++ b/include/deal.II/matrix_free/operators.h @@ -876,8 +876,8 @@ namespace MatrixFreeOperators template inline CellwiseInverseMassMatrix:: CellwiseInverseMassMatrix( - const FEEvaluationBase &fe_eval) : - fe_eval(fe_eval) + const FEEvaluationBase &fe_eval) + : fe_eval(fe_eval) { FullMatrix shapes_1d(fe_degree + 1, fe_degree + 1); for (unsigned int i = 0, c = 0; i < shapes_1d.m(); ++i) @@ -908,9 +908,9 @@ namespace MatrixFreeOperators AlignedVector> &inverse_jxw) const { constexpr unsigned int dofs_per_cell = Utilities::pow(fe_degree + 1, dim); - Assert( - inverse_jxw.size() > 0 && inverse_jxw.size() % dofs_per_cell == 0, - ExcMessage("Expected diagonal to be a multiple of scalar dof per cells")); + Assert(inverse_jxw.size() > 0 && inverse_jxw.size() % dofs_per_cell == 0, + ExcMessage( + "Expected diagonal to be a multiple of scalar dof per cells")); // temporarily reduce size of inverse_jxw to dofs_per_cell to get JxW values // from fe_eval (will not reallocate any memory) @@ -939,10 +939,10 @@ namespace MatrixFreeOperators VectorizedArray * out_array) const { constexpr unsigned int dofs_per_cell = Utilities::pow(fe_degree + 1, dim); - Assert( - inverse_coefficients.size() > 0 && - inverse_coefficients.size() % dofs_per_cell == 0, - ExcMessage("Expected diagonal to be a multiple of scalar dof per cells")); + Assert(inverse_coefficients.size() > 0 && + inverse_coefficients.size() % dofs_per_cell == 0, + ExcMessage( + "Expected diagonal to be a multiple of scalar dof per cells")); if (inverse_coefficients.size() != dofs_per_cell) AssertDimension(n_actual_components * dofs_per_cell, inverse_coefficients.size()); @@ -989,7 +989,9 @@ namespace MatrixFreeOperators //----------------- Base operator ----------------------------- template - Base::Base() : Subscriptor(), have_interface_matrices(false) + Base::Base() + : Subscriptor() + , have_interface_matrices(false) {} @@ -1539,9 +1541,9 @@ namespace MatrixFreeOperators //------------------------- MGInterfaceOperator ------------------------------ template - MGInterfaceOperator::MGInterfaceOperator() : - Subscriptor(), - mf_base_operator(nullptr) + MGInterfaceOperator::MGInterfaceOperator() + : Subscriptor() + , mf_base_operator(nullptr) {} @@ -1625,8 +1627,8 @@ namespace MatrixFreeOperators int n_components, typename VectorType> MassOperator:: - MassOperator() : - Base() + MassOperator() + : Base() {} @@ -1676,8 +1678,10 @@ namespace MatrixFreeOperators MassOperator:: apply_add(VectorType &dst, const VectorType &src) const { - Base::data->cell_loop( - &MassOperator::local_apply_cell, this, dst, src); + Base::data->cell_loop(&MassOperator::local_apply_cell, + this, + dst, + src); } @@ -1719,8 +1723,8 @@ namespace MatrixFreeOperators int n_components, typename VectorType> LaplaceOperator:: - LaplaceOperator() : - Base() + LaplaceOperator() + : Base() {} @@ -1799,8 +1803,10 @@ namespace MatrixFreeOperators this->initialize_dof_vector(inverse_diagonal_vector); this->initialize_dof_vector(diagonal_vector); - this->data->cell_loop( - &LaplaceOperator::local_diagonal_cell, this, diagonal_vector, dummy); + this->data->cell_loop(&LaplaceOperator::local_diagonal_cell, + this, + diagonal_vector, + dummy); this->set_constrained_entries_to_one(diagonal_vector); inverse_diagonal_vector = diagonal_vector; @@ -1828,8 +1834,10 @@ namespace MatrixFreeOperators LaplaceOperator:: apply_add(VectorType &dst, const VectorType &src) const { - Base::data->cell_loop( - &LaplaceOperator::local_apply_cell, this, dst, src); + Base::data->cell_loop(&LaplaceOperator::local_apply_cell, + this, + dst, + src); } namespace @@ -1871,8 +1879,9 @@ namespace MatrixFreeOperators { Assert(non_negative((*scalar_coefficient)(cell, q)), ExcMessage("Coefficient must be non-negative")); - phi.submit_gradient( - (*scalar_coefficient)(cell, q) * phi.get_gradient(q), q); + phi.submit_gradient((*scalar_coefficient)(cell, q) * + phi.get_gradient(q), + q); } } else diff --git a/include/deal.II/matrix_free/shape_info.h b/include/deal.II/matrix_free/shape_info.h index ae2810ab23..54f8dfa52f 100644 --- a/include/deal.II/matrix_free/shape_info.h +++ b/include/deal.II/matrix_free/shape_info.h @@ -363,18 +363,17 @@ namespace internal template template - inline ShapeInfo::ShapeInfo( - const Quadrature<1> & quad, - const FiniteElement &fe_in, - const unsigned int base_element_number) : - element_type(tensor_general), - fe_degree(0), - n_q_points_1d(0), - n_q_points(0), - dofs_per_component_on_cell(0), - n_q_points_face(0), - dofs_per_component_on_face(0), - nodal_at_cell_boundaries(false) + inline ShapeInfo::ShapeInfo(const Quadrature<1> & quad, + const FiniteElement &fe_in, + const unsigned int base_element_number) + : element_type(tensor_general) + , fe_degree(0) + , n_q_points_1d(0) + , n_q_points(0) + , dofs_per_component_on_cell(0) + , n_q_points_face(0) + , dofs_per_component_on_face(0) + , nodal_at_cell_boundaries(false) { reinit(quad, fe_in, base_element_number); } diff --git a/include/deal.II/matrix_free/shape_info.templates.h b/include/deal.II/matrix_free/shape_info.templates.h index 0e05a7d566..9637efb635 100644 --- a/include/deal.II/matrix_free/shape_info.templates.h +++ b/include/deal.II/matrix_free/shape_info.templates.h @@ -58,15 +58,15 @@ namespace internal } // namespace template - ShapeInfo::ShapeInfo() : - element_type(tensor_general), - fe_degree(numbers::invalid_unsigned_int), - n_q_points_1d(0), - n_q_points(0), - dofs_per_component_on_cell(0), - n_q_points_face(0), - dofs_per_component_on_face(0), - nodal_at_cell_boundaries(false) + ShapeInfo::ShapeInfo() + : element_type(tensor_general) + , fe_degree(numbers::invalid_unsigned_int) + , n_q_points_1d(0) + , n_q_points(0) + , dofs_per_component_on_cell(0) + , n_q_points_face(0) + , dofs_per_component_on_face(0) + , nodal_at_cell_boundaries(false) {} @@ -168,10 +168,10 @@ namespace internal // invert numbering again. Need to do it manually because we might // have undefined blocks - lexicographic_numbering.resize( - fe_in.element_multiplicity(base_element_number) * - fe->dofs_per_cell, - numbers::invalid_unsigned_int); + lexicographic_numbering.resize(fe_in.element_multiplicity( + base_element_number) * + fe->dofs_per_cell, + numbers::invalid_unsigned_int); for (unsigned int i = 0; i < lexicographic.size(); ++i) if (lexicographic[i] != numbers::invalid_unsigned_int) { diff --git a/include/deal.II/matrix_free/tensor_product_kernels.h b/include/deal.II/matrix_free/tensor_product_kernels.h index 1647b06a73..0b1d4e45f2 100644 --- a/include/deal.II/matrix_free/tensor_product_kernels.h +++ b/include/deal.II/matrix_free/tensor_product_kernels.h @@ -136,10 +136,10 @@ namespace internal * Empty constructor. Does nothing. Be careful when using 'values' and * related methods because they need to be filled with the other pointer */ - EvaluatorTensorProduct() : - shape_values(nullptr), - shape_gradients(nullptr), - shape_hessians(nullptr) + EvaluatorTensorProduct() + : shape_values(nullptr) + , shape_gradients(nullptr) + , shape_hessians(nullptr) {} /** @@ -149,10 +149,10 @@ namespace internal const AlignedVector &shape_gradients, const AlignedVector &shape_hessians, const unsigned int dummy1 = 0, - const unsigned int dummy2 = 0) : - shape_values(shape_values.begin()), - shape_gradients(shape_gradients.begin()), - shape_hessians(shape_hessians.begin()) + const unsigned int dummy2 = 0) + : shape_values(shape_values.begin()) + , shape_gradients(shape_gradients.begin()) + , shape_hessians(shape_hessians.begin()) { // We can enter this function either for the apply() path that has // n_rows * n_columns entries or for the apply_face() path that only has @@ -310,9 +310,9 @@ namespace internal { static_assert(one_line == false || direction == dim - 1, "Single-line evaluation only works for direction=dim-1."); - Assert( - shape_data != nullptr, - ExcMessage("The given array shape_data must not be the null pointer!")); + Assert(shape_data != nullptr, + ExcMessage( + "The given array shape_data must not be the null pointer!")); Assert(dim == direction + 1 || one_line == true || n_rows == n_columns || in != out, ExcMessage("In-place operation only supported for " @@ -393,9 +393,9 @@ namespace internal static_assert(dim > 0 && dim < 4, "Only dim=1,2,3 supported"); static_assert(max_derivative >= 0 && max_derivative < 3, "Only derivative orders 0-2 implemented"); - Assert( - shape_values != nullptr, - ExcMessage("The given array shape_values must not be the null pointer.")); + Assert(shape_values != nullptr, + ExcMessage( + "The given array shape_values must not be the null pointer.")); constexpr int n_blocks1 = dim > 1 ? n_rows : 1; constexpr int n_blocks2 = dim > 2 ? n_rows : 1; @@ -534,12 +534,12 @@ namespace internal * Empty constructor. Does nothing. Be careful when using 'values' and * related methods because they need to be filled with the other constructor */ - EvaluatorTensorProduct() : - shape_values(nullptr), - shape_gradients(nullptr), - shape_hessians(nullptr), - n_rows(numbers::invalid_unsigned_int), - n_columns(numbers::invalid_unsigned_int) + EvaluatorTensorProduct() + : shape_values(nullptr) + , shape_gradients(nullptr) + , shape_hessians(nullptr) + , n_rows(numbers::invalid_unsigned_int) + , n_columns(numbers::invalid_unsigned_int) {} /** @@ -549,12 +549,12 @@ namespace internal const AlignedVector &shape_gradients, const AlignedVector &shape_hessians, const unsigned int n_rows, - const unsigned int n_columns) : - shape_values(shape_values.begin()), - shape_gradients(shape_gradients.begin()), - shape_hessians(shape_hessians.begin()), - n_rows(n_rows), - n_columns(n_columns) + const unsigned int n_columns) + : shape_values(shape_values.begin()) + , shape_gradients(shape_gradients.begin()) + , shape_hessians(shape_hessians.begin()) + , n_rows(n_rows) + , n_columns(n_columns) { // We can enter this function either for the apply() path that has // n_rows * n_columns entries or for the apply_face() path that only has @@ -653,9 +653,9 @@ namespace internal { static_assert(one_line == false || direction == dim - 1, "Single-line evaluation only works for direction=dim-1."); - Assert( - shape_data != nullptr, - ExcMessage("The given array shape_data must not be the null pointer!")); + Assert(shape_data != nullptr, + ExcMessage( + "The given array shape_data must not be the null pointer!")); Assert(dim == direction + 1 || one_line == true || n_rows == n_columns || in != out, ExcMessage("In-place operation only supported for " @@ -727,9 +727,9 @@ namespace internal apply_face(const Number *DEAL_II_RESTRICT in, Number *DEAL_II_RESTRICT out) const { - Assert( - shape_values != nullptr, - ExcMessage("The given array shape_data must not be the null pointer!")); + Assert(shape_values != nullptr, + ExcMessage( + "The given array shape_data must not be the null pointer!")); static_assert(dim > 0 && dim < 4, "Only dim=1,2,3 supported"); const int n_blocks1 = dim > 1 ? n_rows : 1; const int n_blocks2 = dim > 2 ? n_rows : 1; @@ -888,10 +888,10 @@ namespace internal const AlignedVector &shape_gradients, const AlignedVector &shape_hessians, const unsigned int dummy1 = 0, - const unsigned int dummy2 = 0) : - shape_values(shape_values.begin()), - shape_gradients(shape_gradients.begin()), - shape_hessians(shape_hessians.begin()) + const unsigned int dummy2 = 0) + : shape_values(shape_values.begin()) + , shape_gradients(shape_gradients.begin()) + , shape_hessians(shape_hessians.begin()) { Assert(shape_values.size() == 0 || shape_values.size() == n_rows * n_columns, @@ -1466,20 +1466,20 @@ namespace internal * related methods because they need to be filled with the other * constructor passing in at least an array for the values. */ - EvaluatorTensorProduct() : - shape_values(nullptr), - shape_gradients(nullptr), - shape_hessians(nullptr) + EvaluatorTensorProduct() + : shape_values(nullptr) + , shape_gradients(nullptr) + , shape_hessians(nullptr) {} /** * Constructor, taking the data from ShapeInfo (using the even-odd * variants stored there) */ - EvaluatorTensorProduct(const AlignedVector &shape_values) : - shape_values(shape_values.begin()), - shape_gradients(nullptr), - shape_hessians(nullptr) + EvaluatorTensorProduct(const AlignedVector &shape_values) + : shape_values(shape_values.begin()) + , shape_gradients(nullptr) + , shape_hessians(nullptr) { AssertDimension(shape_values.size(), n_rows * ((n_columns + 1) / 2)); } @@ -1492,10 +1492,10 @@ namespace internal const AlignedVector &shape_gradients, const AlignedVector &shape_hessians, const unsigned int dummy1 = 0, - const unsigned int dummy2 = 0) : - shape_values(shape_values.begin()), - shape_gradients(shape_gradients.begin()), - shape_hessians(shape_hessians.begin()) + const unsigned int dummy2 = 0) + : shape_values(shape_values.begin()) + , shape_gradients(shape_gradients.begin()) + , shape_hessians(shape_hessians.begin()) { // In this function, we allow for dummy pointers if some of values, // gradients or hessians should not be computed @@ -1546,8 +1546,9 @@ namespace internal gradients_one_line(const Number in[], Number out[]) const { Assert(shape_gradients != nullptr, ExcNotInitialized()); - apply( - shape_gradients, in, out); + apply(shape_gradients, + in, + out); } template @@ -1555,8 +1556,9 @@ namespace internal hessians_one_line(const Number in[], Number out[]) const { Assert(shape_hessians != nullptr, ExcNotInitialized()); - apply( - shape_hessians, in, out); + apply(shape_hessians, + in, + out); } /** @@ -1853,20 +1855,20 @@ namespace internal * related methods because they need to be filled with the other * constructor passing in at least an array for the values. */ - EvaluatorTensorProduct() : - shape_values(nullptr), - shape_gradients(nullptr), - shape_hessians(nullptr) + EvaluatorTensorProduct() + : shape_values(nullptr) + , shape_gradients(nullptr) + , shape_hessians(nullptr) {} /** * Constructor, taking the data from ShapeInfo (using the even-odd * variants stored there) */ - EvaluatorTensorProduct(const AlignedVector &shape_values) : - shape_values(shape_values.begin()), - shape_gradients(nullptr), - shape_hessians(nullptr) + EvaluatorTensorProduct(const AlignedVector &shape_values) + : shape_values(shape_values.begin()) + , shape_gradients(nullptr) + , shape_hessians(nullptr) {} /** @@ -1877,10 +1879,10 @@ namespace internal const AlignedVector &shape_gradients, const AlignedVector &shape_hessians, const unsigned int dummy1 = 0, - const unsigned int dummy2 = 0) : - shape_values(shape_values.begin()), - shape_gradients(shape_gradients.begin()), - shape_hessians(shape_hessians.begin()) + const unsigned int dummy2 = 0) + : shape_values(shape_values.begin()) + , shape_gradients(shape_gradients.begin()) + , shape_hessians(shape_hessians.begin()) { (void)dummy1; (void)dummy2; @@ -1923,8 +1925,9 @@ namespace internal gradients_one_line(const Number in[], Number out[]) const { Assert(shape_gradients != nullptr, ExcNotInitialized()); - apply( - shape_gradients, in, out); + apply(shape_gradients, + in, + out); } template @@ -1932,8 +1935,9 @@ namespace internal hessians_one_line(const Number in[], Number out[]) const { Assert(shape_hessians != nullptr, ExcNotInitialized()); - apply( - shape_hessians, in, out); + apply(shape_hessians, + in, + out); } /** diff --git a/include/deal.II/meshworker/assembler.h b/include/deal.II/meshworker/assembler.h index b99fa9a8c1..0522d7f21f 100644 --- a/include/deal.II/meshworker/assembler.h +++ b/include/deal.II/meshworker/assembler.h @@ -593,8 +593,9 @@ namespace MeshWorker ResidualLocalBlocksToGlobalBlocks::assemble(const DOFINFO &info) { for (unsigned int i = 0; i < residuals.size(); ++i) - assemble( - *(residuals.entry(i)), info.vector(i), info.indices); + assemble(*(residuals.entry(i)), + info.vector(i), + info.indices); } @@ -607,10 +608,12 @@ namespace MeshWorker { for (unsigned int i = 0; i < residuals.size(); ++i) { - assemble( - *(residuals.entry(i)), info1.vector(i), info1.indices); - assemble( - *(residuals.entry(i)), info2.vector(i), info2.indices); + assemble(*(residuals.entry(i)), + info1.vector(i), + info1.indices); + assemble(*(residuals.entry(i)), + info2.vector(i), + info2.indices); } } @@ -619,8 +622,8 @@ namespace MeshWorker template inline MatrixLocalBlocksToGlobalBlocks:: - MatrixLocalBlocksToGlobalBlocks(double threshold) : - threshold(threshold) + MatrixLocalBlocksToGlobalBlocks(double threshold) + : threshold(threshold) {} @@ -703,8 +706,10 @@ namespace MeshWorker for (unsigned int i = 0; i < sliced_col_indices.size(); ++i) sliced_col_indices[i] = dof2[bi.block_start(block_col) + i]; - constraints->distribute_local_to_global( - local, sliced_row_indices, sliced_col_indices, global); + constraints->distribute_local_to_global(local, + sliced_row_indices, + sliced_col_indices, + global); } } @@ -778,8 +783,8 @@ namespace MeshWorker template inline MGMatrixLocalBlocksToGlobalBlocks:: - MGMatrixLocalBlocksToGlobalBlocks(double threshold) : - threshold(threshold) + MGMatrixLocalBlocksToGlobalBlocks(double threshold) + : threshold(threshold) {} diff --git a/include/deal.II/meshworker/dof_info.h b/include/deal.II/meshworker/dof_info.h index 7e57940208..34a54fe076 100644 --- a/include/deal.II/meshworker/dof_info.h +++ b/include/deal.II/meshworker/dof_info.h @@ -282,20 +282,20 @@ namespace MeshWorker //----------------------------------------------------------------------// template - DoFInfo::DoFInfo() : - face_number(numbers::invalid_unsigned_int), - sub_number(numbers::invalid_unsigned_int), - level_cell(false) + DoFInfo::DoFInfo() + : face_number(numbers::invalid_unsigned_int) + , sub_number(numbers::invalid_unsigned_int) + , level_cell(false) {} template DoFInfo::DoFInfo( - const DoFHandler &dof_handler) : - face_number(numbers::invalid_unsigned_int), - sub_number(numbers::invalid_unsigned_int), - level_cell(false) + const DoFHandler &dof_handler) + : face_number(numbers::invalid_unsigned_int) + , sub_number(numbers::invalid_unsigned_int) + , level_cell(false) { std::vector aux(1); aux[0] = dof_handler.get_fe().dofs_per_cell; @@ -421,9 +421,9 @@ namespace MeshWorker //----------------------------------------------------------------------// template - inline DoFInfoBox::DoFInfoBox(const DOFINFO &seed) : - cell(seed), - cell_valid(true) + inline DoFInfoBox::DoFInfoBox(const DOFINFO &seed) + : cell(seed) + , cell_valid(true) { for (unsigned int i = 0; i < GeometryInfo::faces_per_cell; ++i) { @@ -437,9 +437,9 @@ namespace MeshWorker template inline DoFInfoBox::DoFInfoBox( - const DoFInfoBox &other) : - cell(other.cell), - cell_valid(other.cell_valid) + const DoFInfoBox &other) + : cell(other.cell) + , cell_valid(other.cell_valid) { for (unsigned int i = 0; i < GeometryInfo::faces_per_cell; ++i) { diff --git a/include/deal.II/meshworker/dof_info.templates.h b/include/deal.II/meshworker/dof_info.templates.h index ada98e0b8d..4340fe1426 100644 --- a/include/deal.II/meshworker/dof_info.templates.h +++ b/include/deal.II/meshworker/dof_info.templates.h @@ -27,11 +27,11 @@ DEAL_II_NAMESPACE_OPEN namespace MeshWorker { template - DoFInfo::DoFInfo(const BlockInfo &info) : - face_number(numbers::invalid_unsigned_int), - sub_number(numbers::invalid_unsigned_int), - block_info(&info, typeid(*this).name()), - level_cell(false) + DoFInfo::DoFInfo(const BlockInfo &info) + : face_number(numbers::invalid_unsigned_int) + , sub_number(numbers::invalid_unsigned_int) + , block_info(&info, typeid(*this).name()) + , level_cell(false) { indices_by_block.resize(info.local().size()); for (unsigned int i = 0; i < indices_by_block.size(); ++i) diff --git a/include/deal.II/meshworker/functional.h b/include/deal.II/meshworker/functional.h index f5b097a886..69dab9eb79 100644 --- a/include/deal.II/meshworker/functional.h +++ b/include/deal.II/meshworker/functional.h @@ -217,7 +217,8 @@ namespace MeshWorker //----------------------------------------------------------------------// template - inline CellsAndFaces::CellsAndFaces() : separate_faces(true) + inline CellsAndFaces::CellsAndFaces() + : separate_faces(true) {} diff --git a/include/deal.II/meshworker/integration_info.h b/include/deal.II/meshworker/integration_info.h index 1e7dd74a13..2e9d083016 100644 --- a/include/deal.II/meshworker/integration_info.h +++ b/include/deal.II/meshworker/integration_info.h @@ -581,24 +581,24 @@ namespace MeshWorker //----------------------------------------------------------------------// template - inline IntegrationInfo::IntegrationInfo() : - fevalv(0), - multigrid(false), - global_data(std::make_shared>()), - n_components(numbers::invalid_unsigned_int) + inline IntegrationInfo::IntegrationInfo() + : fevalv(0) + , multigrid(false) + , global_data(std::make_shared>()) + , n_components(numbers::invalid_unsigned_int) {} template inline IntegrationInfo::IntegrationInfo( - const IntegrationInfo &other) : - multigrid(other.multigrid), - values(other.values), - gradients(other.gradients), - hessians(other.hessians), - global_data(other.global_data), - fe_pointer(other.fe_pointer), - n_components(other.n_components) + const IntegrationInfo &other) + : multigrid(other.multigrid) + , values(other.values) + , gradients(other.gradients) + , hessians(other.hessians) + , global_data(other.global_data) + , fe_pointer(other.fe_pointer) + , n_components(other.n_components) { fevalv.resize(other.fevalv.size()); for (unsigned int i = 0; i < other.fevalv.size(); ++i) @@ -656,8 +656,10 @@ namespace MeshWorker { fevalv.resize(el.n_base_elements()); for (unsigned int i = 0; i < fevalv.size(); ++i) - fevalv[i] = std::make_shared( - mapping, el.base_element(i), quadrature, flags); + fevalv[i] = std::make_shared(mapping, + el.base_element(i), + quadrature, + flags); } n_components = el.n_components(); } @@ -786,14 +788,16 @@ namespace MeshWorker const BlockInfo *block_info) { initialize_update_flags(); - initialize_gauss_quadrature( - (cell_flags & update_values) ? (el.tensor_degree() + 1) : - el.tensor_degree(), - (boundary_flags & update_values) ? (el.tensor_degree() + 1) : - el.tensor_degree(), - (face_flags & update_values) ? (el.tensor_degree() + 1) : - el.tensor_degree(), - false); + initialize_gauss_quadrature((cell_flags & update_values) ? + (el.tensor_degree() + 1) : + el.tensor_degree(), + (boundary_flags & update_values) ? + (el.tensor_degree() + 1) : + el.tensor_degree(), + (face_flags & update_values) ? + (el.tensor_degree() + 1) : + el.tensor_degree(), + false); cell.template initialize>( el, mapping, cell_quadrature, cell_flags, block_info); diff --git a/include/deal.II/meshworker/loop.h b/include/deal.II/meshworker/loop.h index 65e4978d2e..a25209108d 100644 --- a/include/deal.II/meshworker/loop.h +++ b/include/deal.II/meshworker/loop.h @@ -84,12 +84,12 @@ namespace MeshWorker /** * Constructor. */ - LoopControl() : - own_cells(true), - ghost_cells(false), - faces_to_ghost(LoopControl::one), - own_faces(LoopControl::one), - cells_first(true) + LoopControl() + : own_cells(true) + , ghost_cells(false) + , faces_to_ghost(LoopControl::one) + , own_faces(LoopControl::one) + , cells_first(true) {} /** @@ -390,10 +390,10 @@ namespace MeshWorker dof_info.exterior_face_available[face_no] = true; dof_info.interior[face_no].reinit(cell, face, face_no); info.face.reinit(dof_info.interior[face_no]); - dof_info.exterior[face_no].reinit( - neighbor, - neighbor->face(neighbor_face_no), - neighbor_face_no); + dof_info.exterior[face_no].reinit(neighbor, + neighbor->face( + neighbor_face_no), + neighbor_face_no); info.neighbor.reinit(dof_info.exterior[face_no]); face_worker(dof_info.interior[face_no], diff --git a/include/deal.II/meshworker/output.h b/include/deal.II/meshworker/output.h index c537d7a173..d04af1c9f6 100644 --- a/include/deal.II/meshworker/output.h +++ b/include/deal.II/meshworker/output.h @@ -162,10 +162,10 @@ namespace MeshWorker } - inline GnuplotPatch::GnuplotPatch() : - n_vectors(numbers::invalid_unsigned_int), - n_points(numbers::invalid_unsigned_int), - os(nullptr) + inline GnuplotPatch::GnuplotPatch() + : n_vectors(numbers::invalid_unsigned_int) + , n_points(numbers::invalid_unsigned_int) + , os(nullptr) {} diff --git a/include/deal.II/meshworker/simple.h b/include/deal.II/meshworker/simple.h index 3da87b8467..c557733659 100644 --- a/include/deal.II/meshworker/simple.h +++ b/include/deal.II/meshworker/simple.h @@ -572,8 +572,9 @@ namespace MeshWorker info.indices_by_block[i]; if (constraints != nullptr) - constraints->distribute_local_to_global( - info.vector(k).block(i), ldi, *v); + constraints->distribute_local_to_global(info.vector(k).block(i), + ldi, + *v); else v->add(ldi, info.vector(k).block(i)); } @@ -594,8 +595,8 @@ namespace MeshWorker //----------------------------------------------------------------------// template - inline MatrixSimple::MatrixSimple(double threshold) : - threshold(threshold) + inline MatrixSimple::MatrixSimple(double threshold) + : threshold(threshold) {} @@ -726,14 +727,22 @@ namespace MeshWorker { for (unsigned int m = 0; m < matrix.size(); ++m) { - assemble( - info1.matrix(m, false).matrix, m, info1.indices, info1.indices); - assemble( - info1.matrix(m, true).matrix, m, info1.indices, info2.indices); - assemble( - info2.matrix(m, false).matrix, m, info2.indices, info2.indices); - assemble( - info2.matrix(m, true).matrix, m, info2.indices, info1.indices); + assemble(info1.matrix(m, false).matrix, + m, + info1.indices, + info1.indices); + assemble(info1.matrix(m, true).matrix, + m, + info1.indices, + info2.indices); + assemble(info2.matrix(m, false).matrix, + m, + info2.indices, + info2.indices); + assemble(info2.matrix(m, true).matrix, + m, + info2.indices, + info1.indices); } } else @@ -769,8 +778,8 @@ namespace MeshWorker //----------------------------------------------------------------------// template - inline MGMatrixSimple::MGMatrixSimple(double threshold) : - threshold(threshold) + inline MGMatrixSimple::MGMatrixSimple(double threshold) + : threshold(threshold) {} @@ -1219,8 +1228,8 @@ namespace MeshWorker //----------------------------------------------------------------------// template - SystemSimple::SystemSimple(double t) : - MatrixSimple(t) + SystemSimple::SystemSimple(double t) + : MatrixSimple(t) {} @@ -1278,8 +1287,9 @@ namespace MeshWorker for (unsigned int j = 0; j < indices.size(); ++j) for (unsigned int k = 0; k < indices.size(); ++k) if (std::fabs(M(j, k)) >= MatrixSimple::threshold) - MatrixSimple::matrix[index]->add( - indices[j], indices[k], M(j, k)); + MatrixSimple::matrix[index]->add(indices[j], + indices[k], + M(j, k)); } else { @@ -1313,8 +1323,9 @@ namespace MeshWorker for (unsigned int j = 0; j < i1.size(); ++j) for (unsigned int k = 0; k < i2.size(); ++k) if (std::fabs(M(j, k)) >= MatrixSimple::threshold) - MatrixSimple::matrix[index]->add( - i1[j], i2[k], M(j, k)); + MatrixSimple::matrix[index]->add(i1[j], + i2[k], + M(j, k)); } else { diff --git a/include/deal.II/meshworker/vector_selector.templates.h b/include/deal.II/meshworker/vector_selector.templates.h index e05d01d91a..1efeaa4852 100644 --- a/include/deal.II/meshworker/vector_selector.templates.h +++ b/include/deal.II/meshworker/vector_selector.templates.h @@ -28,9 +28,8 @@ DEAL_II_NAMESPACE_OPEN namespace MeshWorker { template - VectorDataBase::VectorDataBase( - const VectorSelector &v) : - VectorSelector(v) + VectorDataBase::VectorDataBase(const VectorSelector &v) + : VectorSelector(v) {} @@ -82,8 +81,8 @@ namespace MeshWorker //----------------------------------------------------------------------// template - VectorData::VectorData(const VectorSelector &s) : - VectorDataBase(s) + VectorData::VectorData(const VectorSelector &s) + : VectorDataBase(s) {} @@ -145,8 +144,10 @@ namespace MeshWorker VectorSlice>>> dst(gradients[i], component, n_comp); - fe.get_function_gradients( - *src, make_slice(index, start, size), dst, true); + fe.get_function_gradients(*src, + make_slice(index, start, size), + dst, + true); } for (unsigned int i = 0; i < this->n_hessians(); ++i) @@ -156,8 +157,10 @@ namespace MeshWorker VectorSlice>>> dst(hessians[i], component, n_comp); - fe.get_function_hessians( - *src, make_slice(index, start, size), dst, true); + fe.get_function_hessians(*src, + make_slice(index, start, size), + dst, + true); } } @@ -174,9 +177,8 @@ namespace MeshWorker //----------------------------------------------------------------------// template - MGVectorData::MGVectorData( - const VectorSelector &s) : - VectorData(s) + MGVectorData::MGVectorData(const VectorSelector &s) + : VectorData(s) {} @@ -233,8 +235,10 @@ namespace MeshWorker data.read_ptr>(this->value_index(i)); VectorSlice>> dst(values[i], component, n_comp); - fe.get_function_values( - (*src)[level], make_slice(index, start, size), dst, true); + fe.get_function_values((*src)[level], + make_slice(index, start, size), + dst, + true); } for (unsigned int i = 0; i < this->n_gradients(); ++i) @@ -244,8 +248,10 @@ namespace MeshWorker VectorSlice>>> dst(gradients[i], component, n_comp); - fe.get_function_gradients( - (*src)[level], make_slice(index, start, size), dst, true); + fe.get_function_gradients((*src)[level], + make_slice(index, start, size), + dst, + true); } for (unsigned int i = 0; i < this->n_hessians(); ++i) @@ -255,8 +261,10 @@ namespace MeshWorker VectorSlice>>> dst(hessians[i], component, n_comp); - fe.get_function_hessians( - (*src)[level], make_slice(index, start, size), dst, true); + fe.get_function_hessians((*src)[level], + make_slice(index, start, size), + dst, + true); } } } // namespace MeshWorker diff --git a/include/deal.II/multigrid/mg_block_smoother.h b/include/deal.II/multigrid/mg_block_smoother.h index 455403b23d..50bd080268 100644 --- a/include/deal.II/multigrid/mg_block_smoother.h +++ b/include/deal.II/multigrid/mg_block_smoother.h @@ -156,10 +156,10 @@ inline MGSmootherBlock::MGSmootherBlock( const bool variable, const bool symmetric, const bool transpose, - const bool reverse) : - MGSmoother>(steps, variable, symmetric, transpose), - reverse(reverse), - mem(&mem) + const bool reverse) + : MGSmoother>(steps, variable, symmetric, transpose) + , reverse(reverse) + , mem(&mem) {} template @@ -168,10 +168,10 @@ inline MGSmootherBlock::MGSmootherBlock( const bool variable, const bool symmetric, const bool transpose, - const bool reverse) : - MGSmoother>(steps, variable, symmetric, transpose), - reverse(reverse), - mem(&this->vector_memory) + const bool reverse) + : MGSmoother>(steps, variable, symmetric, transpose) + , reverse(reverse) + , mem(&this->vector_memory) {} diff --git a/include/deal.II/multigrid/mg_coarse.h b/include/deal.II/multigrid/mg_coarse.h index 742565a80b..e93eb82f93 100644 --- a/include/deal.II/multigrid/mg_coarse.h +++ b/include/deal.II/multigrid/mg_coarse.h @@ -333,14 +333,14 @@ private: #ifndef DOXYGEN /* ------------------ Functions for MGCoarseGridApplySmoother -----------*/ template -MGCoarseGridApplySmoother::MGCoarseGridApplySmoother() : - coarse_smooth(nullptr) +MGCoarseGridApplySmoother::MGCoarseGridApplySmoother() + : coarse_smooth(nullptr) {} template MGCoarseGridApplySmoother::MGCoarseGridApplySmoother( - const MGSmootherBase &coarse_smooth) : - coarse_smooth(nullptr) + const MGSmootherBase &coarse_smooth) + : coarse_smooth(nullptr) { initialize(coarse_smooth); } @@ -351,9 +351,10 @@ void MGCoarseGridApplySmoother::initialize( const MGSmootherBase &coarse_smooth_) { - coarse_smooth = SmartPointer, - MGCoarseGridApplySmoother>( - &coarse_smooth_, typeid(*this).name()); + coarse_smooth = + SmartPointer, + MGCoarseGridApplySmoother>(&coarse_smooth_, + typeid(*this).name()); } @@ -378,10 +379,10 @@ MGCoarseGridApplySmoother::operator()(const unsigned int level, template -MGCoarseGridLACIteration::MGCoarseGridLACIteration() : - solver(0, typeid(*this).name()), - matrix(0), - precondition(0) +MGCoarseGridLACIteration::MGCoarseGridLACIteration() + : solver(0, typeid(*this).name()) + , matrix(0) + , precondition(0) {} @@ -390,8 +391,8 @@ template MGCoarseGridLACIteration::MGCoarseGridLACIteration( SolverType & s, const MatrixType & m, - const PreconditionerType &p) : - solver(&s, typeid(*this).name()) + const PreconditionerType &p) + : solver(&s, typeid(*this).name()) { // Workaround: Unfortunately, not every "m" object has a rich enough // interface to populate reinit_(domain|range)_vector. Thus, supply an @@ -470,10 +471,10 @@ template ::MGCoarseGridIterativeSolver() : - solver(0, typeid(*this).name()), - matrix(0, typeid(*this).name()), - preconditioner(0, typeid(*this).name()) + PreconditionerType>::MGCoarseGridIterativeSolver() + : solver(0, typeid(*this).name()) + , matrix(0, typeid(*this).name()) + , preconditioner(0, typeid(*this).name()) {} @@ -488,10 +489,10 @@ MGCoarseGridIterativeSolver:: MGCoarseGridIterativeSolver(SolverType & solver, const MatrixType & matrix, - const PreconditionerType &preconditioner) : - solver(&solver, typeid(*this).name()), - matrix(&matrix, typeid(*this).name()), - preconditioner(&preconditioner, typeid(*this).name()) + const PreconditionerType &preconditioner) + : solver(&solver, typeid(*this).name()) + , matrix(&matrix, typeid(*this).name()) + , preconditioner(&preconditioner, typeid(*this).name()) {} diff --git a/include/deal.II/multigrid/mg_constrained_dofs.h b/include/deal.II/multigrid/mg_constrained_dofs.h index 152ae6eec0..2bd38545a4 100644 --- a/include/deal.II/multigrid/mg_constrained_dofs.h +++ b/include/deal.II/multigrid/mg_constrained_dofs.h @@ -253,8 +253,9 @@ MGConstrainedDoFs::initialize(const DoFHandler &dof) !level_constraints[l].is_constrained(dofs_1[i])) { level_constraints[l].add_line(dofs_2[i]); - level_constraints[l].add_entry( - dofs_2[i], dofs_1[i], 1.); + level_constraints[l].add_entry(dofs_2[i], + dofs_1[i], + 1.); } } } @@ -283,8 +284,10 @@ MGConstrainedDoFs::initialize( // At this point boundary_indices is empty. boundary_indices.resize(n_levels); - MGTools::make_boundary_list( - dof, function_map, boundary_indices, component_mask); + MGTools::make_boundary_list(dof, + function_map, + boundary_indices, + component_mask); } @@ -302,8 +305,10 @@ MGConstrainedDoFs::make_zero_boundary_constraints( ExcInternalError()); boundary_indices.resize(n_levels); - MGTools::make_boundary_list( - dof, boundary_ids, boundary_indices, component_mask); + MGTools::make_boundary_list(dof, + boundary_ids, + boundary_indices, + component_mask); } diff --git a/include/deal.II/multigrid/mg_matrix.h b/include/deal.II/multigrid/mg_matrix.h index 18bc743a53..2463e3ca39 100644 --- a/include/deal.II/multigrid/mg_matrix.h +++ b/include/deal.II/multigrid/mg_matrix.h @@ -318,13 +318,12 @@ namespace mg /*----------------------------------------------------------------------*/ template -MGMatrixSelect::MGMatrixSelect( - const unsigned int row, - const unsigned int col, - MGLevelObject *p) : - matrix(p, typeid(*this).name()), - row(row), - col(col) +MGMatrixSelect::MGMatrixSelect(const unsigned int row, + const unsigned int col, + MGLevelObject *p) + : matrix(p, typeid(*this).name()) + , row(row) + , col(col) {} diff --git a/include/deal.II/multigrid/mg_smoother.h b/include/deal.II/multigrid/mg_smoother.h index 096d6cfb8e..1cc949174a 100644 --- a/include/deal.II/multigrid/mg_smoother.h +++ b/include/deal.II/multigrid/mg_smoother.h @@ -604,12 +604,12 @@ template inline MGSmoother::MGSmoother(const unsigned int steps, const bool variable, const bool symmetric, - const bool transpose) : - steps(steps), - variable(variable), - symmetric(symmetric), - transpose(transpose), - debug(0) + const bool transpose) + : steps(steps) + , variable(variable) + , symmetric(symmetric) + , transpose(transpose) + , debug(0) {} @@ -661,8 +661,8 @@ namespace mg const unsigned int steps, const bool variable, const bool symmetric, - const bool transpose) : - MGSmoother(steps, variable, symmetric, transpose) + const bool transpose) + : MGSmoother(steps, variable, symmetric, transpose) {} @@ -794,8 +794,8 @@ inline MGSmootherRelaxation:: MGSmootherRelaxation(const unsigned int steps, const bool variable, const bool symmetric, - const bool transpose) : - MGSmoother(steps, variable, symmetric, transpose) + const bool transpose) + : MGSmoother(steps, variable, symmetric, transpose) {} @@ -1006,8 +1006,8 @@ inline MGSmootherPrecondition:: MGSmootherPrecondition(const unsigned int steps, const bool variable, const bool symmetric, - const bool transpose) : - MGSmoother(steps, variable, symmetric, transpose) + const bool transpose) + : MGSmoother(steps, variable, symmetric, transpose) {} diff --git a/include/deal.II/multigrid/mg_transfer.templates.h b/include/deal.II/multigrid/mg_transfer.templates.h index d9b9422f7f..c7ee6d88aa 100644 --- a/include/deal.II/multigrid/mg_transfer.templates.h +++ b/include/deal.II/multigrid/mg_transfer.templates.h @@ -254,8 +254,9 @@ MGLevelGlobalTransfer::copy_to_mg( // adaptive refinement) and the numbering of the finest level DoFs and // the global DoFs are the same, we can do a plain copy AssertDimension(dst[dst.max_level()].size(), src.size()); - internal::copy_vector( - copy_indices[dst.max_level()], src, dst[dst.max_level()]); + internal::copy_vector(copy_indices[dst.max_level()], + src, + dst[dst.max_level()]); return; } @@ -313,8 +314,9 @@ MGLevelGlobalTransfer::copy_from_mg( if (perform_plain_copy) { AssertDimension(dst.size(), src[src.max_level()].size()); - internal::copy_vector( - copy_indices[src.max_level()], src[src.max_level()], dst); + internal::copy_vector(copy_indices[src.max_level()], + src[src.max_level()], + dst); return; } diff --git a/include/deal.II/multigrid/mg_transfer_component.templates.h b/include/deal.II/multigrid/mg_transfer_component.templates.h index 6f54f5a7df..e2a7f5270c 100644 --- a/include/deal.II/multigrid/mg_transfer_component.templates.h +++ b/include/deal.II/multigrid/mg_transfer_component.templates.h @@ -50,8 +50,9 @@ MGTransferSelect::copy_to_mg( MGLevelObject> & dst, const BlockVector & src) const { - do_copy_to_mg( - mg_dof_handler, dst, src.block(target_component[selected_component])); + do_copy_to_mg(mg_dof_handler, + dst, + src.block(target_component[selected_component])); } @@ -78,8 +79,9 @@ MGTransferSelect::copy_from_mg( const MGLevelObject> &src) const { dst = 0; - do_copy_from_mg( - mg_dof_handler, dst.block(target_component[selected_component]), src); + do_copy_from_mg(mg_dof_handler, + dst.block(target_component[selected_component]), + src); if (constraints != nullptr) constraints->condense(dst); } @@ -109,8 +111,9 @@ MGTransferSelect::copy_from_mg( const unsigned int n_blocks = *std::max_element(target_component.begin(), target_component.end()) + 1; std::vector dofs_per_block(n_blocks); - DoFTools::count_dofs_per_block( - mg_dof_handler, dofs_per_block, target_component); + DoFTools::count_dofs_per_block(mg_dof_handler, + dofs_per_block, + target_component); BlockVector tmp; tmp.reinit(n_blocks); for (unsigned int b = 0; b < n_blocks; ++b) diff --git a/include/deal.II/multigrid/mg_transfer_matrix_free.h b/include/deal.II/multigrid/mg_transfer_matrix_free.h index faab15f288..859514a4a3 100644 --- a/include/deal.II/multigrid/mg_transfer_matrix_free.h +++ b/include/deal.II/multigrid/mg_transfer_matrix_free.h @@ -492,8 +492,9 @@ MGTransferMatrixFree::interpolate_to_mg( MGLevelObject relevant_dofs(min_level, max_level); for (unsigned int level = min_level; level <= max_level; ++level) { - DoFTools::extract_locally_relevant_level_dofs( - dof_handler, level, relevant_dofs[level]); + DoFTools::extract_locally_relevant_level_dofs(dof_handler, + level, + relevant_dofs[level]); if (dst[level].size() != dof_handler.locally_owned_mg_dofs(level).size() || dst[level].local_size() != @@ -574,11 +575,11 @@ MGTransferBlockMatrixFree::copy_to_mg( const LinearAlgebra::distributed::BlockVector & src) const { AssertDimension(matrix_free_transfer_vector.size(), 1); - Assert( - same_for_all, - ExcMessage("This object was initialized with support for usage with one " - "DoFHandler for each block, but this method assumes that " - "the same DoFHandler is used for all the blocks!")); + Assert(same_for_all, + ExcMessage( + "This object was initialized with support for usage with one " + "DoFHandler for each block, but this method assumes that " + "the same DoFHandler is used for all the blocks!")); const std::vector *> mg_dofs(src.n_blocks(), &mg_dof); @@ -647,8 +648,9 @@ MGTransferBlockMatrixFree::copy_to_mg( for (unsigned int l = min_level; l <= max_level; ++l) dst_non_block[l].reinit(dst[l].block(b)); const unsigned int data_block = same_for_all ? 0 : b; - matrix_free_transfer_vector[data_block].copy_to_mg( - *mg_dof[b], dst_non_block, src.block(b)); + matrix_free_transfer_vector[data_block].copy_to_mg(*mg_dof[b], + dst_non_block, + src.block(b)); for (unsigned int l = min_level; l <= max_level; ++l) dst[l].block(b) = dst_non_block[l]; @@ -704,8 +706,9 @@ MGTransferBlockMatrixFree::copy_from_mg( src_non_block[l] = src[l].block(b); } const unsigned int data_block = same_for_all ? 0 : b; - matrix_free_transfer_vector[data_block].copy_from_mg( - *mg_dof[b], dst.block(b), src_non_block); + matrix_free_transfer_vector[data_block].copy_from_mg(*mg_dof[b], + dst.block(b), + src_non_block); } } diff --git a/include/deal.II/multigrid/multigrid.h b/include/deal.II/multigrid/multigrid.h index bdfdaafd5c..379eee70e4 100644 --- a/include/deal.II/multigrid/multigrid.h +++ b/include/deal.II/multigrid/multigrid.h @@ -644,17 +644,17 @@ Multigrid::Multigrid(const DoFHandler & mg_dof_handler, const MGSmootherBase &post_smooth, const unsigned int min_level, const unsigned int max_level, - Cycle cycle) : - cycle_type(cycle), - minlevel(min_level), - matrix(&matrix, typeid(*this).name()), - coarse(&coarse, typeid(*this).name()), - transfer(&transfer, typeid(*this).name()), - pre_smooth(&pre_smooth, typeid(*this).name()), - post_smooth(&post_smooth, typeid(*this).name()), - edge_down(nullptr, typeid(*this).name()), - edge_up(nullptr, typeid(*this).name()), - debug(0) + Cycle cycle) + : cycle_type(cycle) + , minlevel(min_level) + , matrix(&matrix, typeid(*this).name()) + , coarse(&coarse, typeid(*this).name()) + , transfer(&transfer, typeid(*this).name()) + , pre_smooth(&pre_smooth, typeid(*this).name()) + , post_smooth(&post_smooth, typeid(*this).name()) + , edge_down(nullptr, typeid(*this).name()) + , edge_up(nullptr, typeid(*this).name()) + , debug(0) { const unsigned int dof_handler_max_level = mg_dof_handler.get_triangulation().n_global_levels() - 1; @@ -676,18 +676,18 @@ Multigrid::Multigrid(const MGMatrixBase & matrix, const MGSmootherBase &post_smooth, const unsigned int min_level, const unsigned int max_level, - Cycle cycle) : - cycle_type(cycle), - matrix(&matrix, typeid(*this).name()), - coarse(&coarse, typeid(*this).name()), - transfer(&transfer, typeid(*this).name()), - pre_smooth(&pre_smooth, typeid(*this).name()), - post_smooth(&post_smooth, typeid(*this).name()), - edge_out(nullptr, typeid(*this).name()), - edge_in(nullptr, typeid(*this).name()), - edge_down(nullptr, typeid(*this).name()), - edge_up(nullptr, typeid(*this).name()), - debug(0) + Cycle cycle) + : cycle_type(cycle) + , matrix(&matrix, typeid(*this).name()) + , coarse(&coarse, typeid(*this).name()) + , transfer(&transfer, typeid(*this).name()) + , pre_smooth(&pre_smooth, typeid(*this).name()) + , post_smooth(&post_smooth, typeid(*this).name()) + , edge_out(nullptr, typeid(*this).name()) + , edge_in(nullptr, typeid(*this).name()) + , edge_down(nullptr, typeid(*this).name()) + , edge_up(nullptr, typeid(*this).name()) + , debug(0) { if (max_level == numbers::invalid_unsigned_int) maxlevel = matrix.get_maxlevel(); @@ -811,8 +811,9 @@ namespace internal if (uses_dof_handler_vector) transfer.copy_from_mg_add(dof_handler_vector, dst, multigrid.solution); else - transfer.copy_from_mg_add( - *dof_handler_vector[0], dst, multigrid.solution); + transfer.copy_from_mg_add(*dof_handler_vector[0], + dst, + multigrid.solution); signals.transfer_to_global(false); } @@ -841,8 +842,9 @@ namespace internal multigrid.cycle(); signals.transfer_to_global(true); - transfer.copy_from_mg_add( - *dof_handler_vector[0], dst, multigrid.solution); + transfer.copy_from_mg_add(*dof_handler_vector[0], + dst, + multigrid.solution); signals.transfer_to_global(false); } } // namespace PreconditionMGImplementation @@ -852,24 +854,24 @@ template PreconditionMG::PreconditionMG( const DoFHandler &dof_handler, Multigrid &mg, - const TRANSFER & transfer) : - dof_handler_vector(1, &dof_handler), - dof_handler_vector_raw(1, &dof_handler), - multigrid(&mg), - transfer(&transfer), - uses_dof_handler_vector(false) + const TRANSFER & transfer) + : dof_handler_vector(1, &dof_handler) + , dof_handler_vector_raw(1, &dof_handler) + , multigrid(&mg) + , transfer(&transfer) + , uses_dof_handler_vector(false) {} template PreconditionMG::PreconditionMG( const std::vector *> &dof_handler, Multigrid & mg, - const TRANSFER & transfer) : - dof_handler_vector(dof_handler.size()), - dof_handler_vector_raw(dof_handler.size()), - multigrid(&mg), - transfer(&transfer), - uses_dof_handler_vector(true) + const TRANSFER & transfer) + : dof_handler_vector(dof_handler.size()) + , dof_handler_vector_raw(dof_handler.size()) + , multigrid(&mg) + , transfer(&transfer) + , uses_dof_handler_vector(true) { for (unsigned int i = 0; i < dof_handler.size(); ++i) { diff --git a/include/deal.II/multigrid/sparse_matrix_collection.h b/include/deal.II/multigrid/sparse_matrix_collection.h index 1db0b4b473..5301a3c7a0 100644 --- a/include/deal.II/multigrid/sparse_matrix_collection.h +++ b/include/deal.II/multigrid/sparse_matrix_collection.h @@ -106,8 +106,9 @@ namespace mg DynamicSparsityPattern ci_sparsity; 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); + MGTools::make_flux_sparsity_pattern_edge(dof_handler, + ci_sparsity, + level); sparsity_edge[level].copy_from(ci_sparsity); matrix_up[level].reinit(sparsity_edge[level]); matrix_down[level].reinit(sparsity_edge[level]); diff --git a/include/deal.II/numerics/data_out_dof_data.templates.h b/include/deal.II/numerics/data_out_dof_data.templates.h index 609b5ea254..0b9bafe28d 100644 --- a/include/deal.II/numerics/data_out_dof_data.templates.h +++ b/include/deal.II/numerics/data_out_dof_data.templates.h @@ -67,13 +67,13 @@ namespace internal std::shared_ptr>> & finite_elements, const UpdateFlags update_flags, - const bool use_face_values) : - n_datasets(n_datasets), - n_subdivisions(n_subdivisions), - postprocessed_values(n_postprocessor_outputs.size()), - mapping_collection(mapping), - finite_elements(finite_elements), - update_flags(update_flags) + const bool use_face_values) + : n_datasets(n_datasets) + , n_subdivisions(n_subdivisions) + , postprocessed_values(n_postprocessor_outputs.size()) + , mapping_collection(mapping) + , finite_elements(finite_elements) + , update_flags(update_flags) { unsigned int n_q_points = 0; if (use_face_values == false) @@ -150,15 +150,15 @@ namespace internal // x_fe_values template ParallelDataBase::ParallelDataBase( - const ParallelDataBase &data) : - n_datasets(data.n_datasets), - n_subdivisions(data.n_subdivisions), - patch_values_scalar(data.patch_values_scalar), - patch_values_system(data.patch_values_system), - postprocessed_values(data.postprocessed_values), - mapping_collection(data.mapping_collection), - finite_elements(data.finite_elements), - update_flags(data.update_flags) + const ParallelDataBase &data) + : n_datasets(data.n_datasets) + , n_subdivisions(data.n_subdivisions) + , patch_values_scalar(data.patch_values_scalar) + , patch_values_system(data.patch_values_system) + , postprocessed_values(data.postprocessed_values) + , mapping_collection(data.mapping_collection) + , finite_elements(data.finite_elements) + , update_flags(data.update_flags) { if (data.x_fe_values.empty() == false) { @@ -388,17 +388,17 @@ namespace internal const std::vector &names_in, const std::vector< DataComponentInterpretation::DataComponentInterpretation> - &data_component_interpretation) : - dof_handler( - dofs, - typeid(dealii::DataOut_DoFData) - .name()), - names(names_in), - data_component_interpretation(data_component_interpretation), - postprocessor(nullptr, typeid(*this).name()), - n_output_variables(names.size()) + &data_component_interpretation) + : dof_handler(dofs, + typeid( + dealii::DataOut_DoFData) + .name()) + , names(names_in) + , data_component_interpretation(data_component_interpretation) + , postprocessor(nullptr, typeid(*this).name()) + , n_output_variables(names.size()) { Assert(names.size() == data_component_interpretation.size(), ExcDimensionMismatch(data_component_interpretation.size(), @@ -423,18 +423,18 @@ namespace internal DataEntryBase::DataEntryBase( const DoFHandlerType *dofs, const DataPostprocessor - *data_postprocessor) : - dof_handler( - dofs, - typeid(dealii::DataOut_DoFData) - .name()), - names(data_postprocessor->get_names()), - data_component_interpretation( - data_postprocessor->get_data_component_interpretation()), - postprocessor(data_postprocessor, typeid(*this).name()), - n_output_variables(names.size()) + *data_postprocessor) + : dof_handler(dofs, + typeid( + dealii::DataOut_DoFData) + .name()) + , names(data_postprocessor->get_names()) + , data_component_interpretation( + data_postprocessor->get_data_component_interpretation()) + , postprocessor(data_postprocessor, typeid(*this).name()) + , n_output_variables(names.size()) { Assert(data_postprocessor->get_names().size() == data_postprocessor->get_data_component_interpretation().size(), @@ -609,9 +609,11 @@ namespace internal const std::vector &names, const std::vector< DataComponentInterpretation::DataComponentInterpretation> - &data_component_interpretation) : - DataEntryBase(dofs, names, data_component_interpretation), - vector(data) + &data_component_interpretation) + : DataEntryBase(dofs, + names, + data_component_interpretation) + , vector(data) {} @@ -621,9 +623,9 @@ namespace internal const DoFHandlerType *dofs, const VectorType * data, const DataPostprocessor - *data_postprocessor) : - DataEntryBase(dofs, data_postprocessor), - vector(data) + *data_postprocessor) + : DataEntryBase(dofs, data_postprocessor) + , vector(data) {} @@ -1001,9 +1003,9 @@ namespace internal template -DataOut_DoFData::DataOut_DoFData() : - triangulation(nullptr, typeid(*this).name()), - dofs(nullptr, typeid(*this).name()) +DataOut_DoFData::DataOut_DoFData() + : triangulation(nullptr, typeid(*this).name()) + , dofs(nullptr, typeid(*this).name()) {} diff --git a/include/deal.II/numerics/data_postprocessor.h b/include/deal.II/numerics/data_postprocessor.h index 7f3bce18b2..d33862632b 100644 --- a/include/deal.II/numerics/data_postprocessor.h +++ b/include/deal.II/numerics/data_postprocessor.h @@ -1103,11 +1103,11 @@ namespace DataPostprocessorInputs typename DoFHandlerType::cell_iterator CommonInputs::get_cell() const { - Assert( - cell.empty() == false, - ExcMessage("You are trying to access the cell associated with a " - "DataPostprocessorInputs::Scalar object for which no cell has " - "been set.")); + Assert(cell.empty() == false, + ExcMessage( + "You are trying to access the cell associated with a " + "DataPostprocessorInputs::Scalar object for which no cell has " + "been set.")); Assert(boost::any_cast(&cell) != nullptr, ExcMessage( diff --git a/include/deal.II/numerics/dof_output_operator.templates.h b/include/deal.II/numerics/dof_output_operator.templates.h index 384404bbca..0dbcbeb54b 100644 --- a/include/deal.II/numerics/dof_output_operator.templates.h +++ b/include/deal.II/numerics/dof_output_operator.templates.h @@ -26,9 +26,9 @@ namespace Algorithms template DoFOutputOperator::DoFOutputOperator( const std::string &filename_base, - const unsigned int digits) : - filename_base(filename_base), - digits(digits) + const unsigned int digits) + : filename_base(filename_base) + , digits(digits) { out.set_default_format(DataOutBase::gnuplot); } diff --git a/include/deal.II/numerics/dof_print_solver_step.h b/include/deal.II/numerics/dof_print_solver_step.h index d9a26f40b8..1c043d2383 100644 --- a/include/deal.II/numerics/dof_print_solver_step.h +++ b/include/deal.II/numerics/dof_print_solver_step.h @@ -97,10 +97,10 @@ DoFPrintSolverStep::DoFPrintSolverStep( SolverControl & control, VectorMemory &mem, DataOut & data_out, - const std::string & basename) : - SolverType(control, mem), - out(data_out), - basename(basename) + const std::string & basename) + : SolverType(control, mem) + , out(data_out) + , basename(basename) {} diff --git a/include/deal.II/numerics/error_estimator.templates.h b/include/deal.II/numerics/error_estimator.templates.h index c4a864579d..e4b84d1b80 100644 --- a/include/deal.II/numerics/error_estimator.templates.h +++ b/include/deal.II/numerics/error_estimator.templates.h @@ -218,48 +218,49 @@ namespace internal const types::material_id material_id, const typename FunctionMap::type *neumann_bc, const ComponentMask & component_mask, - const Function * coefficients) : - finite_element(fe), - face_quadratures(face_quadratures), - fe_face_values_cell( - mapping, - finite_element, - face_quadratures, - update_gradients | update_JxW_values | - (need_quadrature_points ? update_quadrature_points : UpdateFlags()) | - update_normal_vectors), - fe_face_values_neighbor(mapping, - finite_element, - face_quadratures, - update_gradients | update_normal_vectors), - fe_subface_values(mapping, - finite_element, - face_quadratures, - update_gradients | update_normal_vectors), - phi(n_solution_vectors, - std::vector>( - face_quadratures.max_n_quadrature_points(), - std::vector(fe.n_components()))), - psi(n_solution_vectors, - std::vector>>( - face_quadratures.max_n_quadrature_points(), - std::vector>(fe.n_components()))), - neighbor_psi( - n_solution_vectors, - std::vector>>( - face_quadratures.max_n_quadrature_points(), - std::vector>(fe.n_components()))), - normal_vectors(face_quadratures.max_n_quadrature_points()), - neighbor_normal_vectors(face_quadratures.max_n_quadrature_points()), - coefficient_values1(face_quadratures.max_n_quadrature_points()), - coefficient_values(face_quadratures.max_n_quadrature_points(), - dealii::Vector(fe.n_components())), - JxW_values(face_quadratures.max_n_quadrature_points()), - subdomain_id(subdomain_id), - material_id(material_id), - neumann_bc(neumann_bc), - component_mask(component_mask), - coefficients(coefficients) + const Function * coefficients) + : finite_element(fe) + , face_quadratures(face_quadratures) + , fe_face_values_cell(mapping, + finite_element, + face_quadratures, + update_gradients | update_JxW_values | + (need_quadrature_points ? + update_quadrature_points : + UpdateFlags()) | + update_normal_vectors) + , fe_face_values_neighbor(mapping, + finite_element, + face_quadratures, + update_gradients | update_normal_vectors) + , fe_subface_values(mapping, + finite_element, + face_quadratures, + update_gradients | update_normal_vectors) + , phi(n_solution_vectors, + std::vector>( + face_quadratures.max_n_quadrature_points(), + std::vector(fe.n_components()))) + , psi(n_solution_vectors, + std::vector>>( + face_quadratures.max_n_quadrature_points(), + std::vector>(fe.n_components()))) + , neighbor_psi(n_solution_vectors, + std::vector>>( + face_quadratures.max_n_quadrature_points(), + std::vector>( + fe.n_components()))) + , normal_vectors(face_quadratures.max_n_quadrature_points()) + , neighbor_normal_vectors(face_quadratures.max_n_quadrature_points()) + , coefficient_values1(face_quadratures.max_n_quadrature_points()) + , coefficient_values(face_quadratures.max_n_quadrature_points(), + dealii::Vector(fe.n_components())) + , JxW_values(face_quadratures.max_n_quadrature_points()) + , subdomain_id(subdomain_id) + , material_id(material_id) + , neumann_bc(neumann_bc) + , component_mask(component_mask) + , coefficients(coefficients) {} @@ -448,10 +449,10 @@ namespace internal std::vector> g( n_q_points, dealii::Vector(n_components)); parallel_data.neumann_bc->find(boundary_id) - ->second->vector_value_list( - fe_face_values_cell.get_present_fe_values() - .get_quadrature_points(), - g); + ->second->vector_value_list(fe_face_values_cell + .get_present_fe_values() + .get_quadrature_points(), + g); for (unsigned int n = 0; n < n_solution_vectors; ++n) for (unsigned int component = 0; component < n_components; @@ -752,8 +753,9 @@ namespace internal // get restriction of finite element function of @p{neighbor} to the // common face. in the hp case, use the quadrature formula that // matches the one we would use for the present cell - fe_face_values_neighbor.reinit( - neighbor, neighbor_neighbor, cell->active_fe_index()); + fe_face_values_neighbor.reinit(neighbor, + neighbor_neighbor, + cell->active_fe_index()); factor = regular_face_factor(cell, face_no, @@ -775,8 +777,10 @@ namespace internal } else { - factor = boundary_face_factor( - cell, face_no, fe_face_values_cell, strategy); + factor = boundary_face_factor(cell, + face_no, + fe_face_values_cell, + strategy); } // now go to the generic function that does all the other things @@ -849,13 +853,16 @@ namespace internal Assert(!neighbor_child->has_children(), ExcInternalError()); // restrict the finite element on the present cell to the subface - fe_subface_values.reinit( - cell, face_no, subface_no, cell->active_fe_index()); + fe_subface_values.reinit(cell, + face_no, + subface_no, + cell->active_fe_index()); // restrict the finite element on the neighbor cell to the common // @p{subface}. - fe_face_values.reinit( - neighbor_child, neighbor_neighbor, cell->active_fe_index()); + fe_face_values.reinit(neighbor_child, + neighbor_neighbor, + cell->active_fe_index()); const double factor = irregular_face_factor(cell, @@ -1219,15 +1226,16 @@ KellyErrorEstimator::estimate( #ifdef DEAL_II_WITH_P4EST if (dynamic_cast *>( &dof_handler.get_triangulation()) != nullptr) - Assert( - (subdomain_id_ == numbers::invalid_subdomain_id) || - (subdomain_id_ == - dynamic_cast - &>(dof_handler.get_triangulation()) - .locally_owned_subdomain()), - ExcMessage("For parallel distributed triangulations, the only " - "valid subdomain_id that can be passed here is the " - "one that corresponds to the locally owned subdomain id.")); + Assert((subdomain_id_ == numbers::invalid_subdomain_id) || + (subdomain_id_ == + dynamic_cast< + const parallel::distributed::Triangulation &>( + dof_handler.get_triangulation()) + .locally_owned_subdomain()), + ExcMessage( + "For parallel distributed triangulations, the only " + "valid subdomain_id that can be passed here is the " + "one that corresponds to the locally owned subdomain id.")); const types::subdomain_id subdomain_id = ((dynamic_cast *>( @@ -1253,8 +1261,9 @@ KellyErrorEstimator::estimate( i != neumann_bc.end(); ++i) Assert(i->second->n_components == n_components, - ExcInvalidBoundaryFunction( - i->first, i->second->n_components, n_components)); + ExcInvalidBoundaryFunction(i->first, + i->second->n_components, + n_components)); Assert(component_mask.represents_n_components(n_components), ExcInvalidComponentMask()); diff --git a/include/deal.II/numerics/fe_field_function.templates.h b/include/deal.II/numerics/fe_field_function.templates.h index f81a502e67..acb2865efc 100644 --- a/include/deal.II/numerics/fe_field_function.templates.h +++ b/include/deal.II/numerics/fe_field_function.templates.h @@ -45,14 +45,14 @@ namespace Functions FEFieldFunction::FEFieldFunction( const DoFHandlerType &mydh, const VectorType & myv, - const Mapping & mymapping) : - Function( - mydh.get_fe(0).n_components()), - dh(&mydh, "FEFieldFunction"), - data_vector(myv), - mapping(mymapping), - cache(dh->get_triangulation(), mymapping), - cell_hint(dh->end()) + const Mapping & mymapping) + : Function( + mydh.get_fe(0).n_components()) + , dh(&mydh, "FEFieldFunction") + , data_vector(myv) + , mapping(mymapping) + , cache(dh->get_triangulation(), mymapping) + , cell_hint(dh->end()) {} @@ -287,8 +287,10 @@ namespace Functions quadrature_collection.push_back(Quadrature(qpoints[i], ww)); } // Get a function value object - hp::FEValues fe_v( - mapping_collection, fe_collection, quadrature_collection, update_values); + hp::FEValues fe_v(mapping_collection, + fe_collection, + quadrature_collection, + update_values); // Now gather all the information we need for (unsigned int i = 0; i < n_cells; ++i) { diff --git a/include/deal.II/numerics/kdtree.h b/include/deal.II/numerics/kdtree.h index 5722ad66dc..16400fd9bf 100644 --- a/include/deal.II/numerics/kdtree.h +++ b/include/deal.II/numerics/kdtree.h @@ -277,8 +277,8 @@ inline const Point &KDTree::operator[](const unsigned int i) const template KDTree::PointCloudAdaptor::PointCloudAdaptor( - const std::vector> &_points) : - points(_points) + const std::vector> &_points) + : points(_points) {} diff --git a/include/deal.II/numerics/matrix_creator.templates.h b/include/deal.II/numerics/matrix_creator.templates.h index f67f88b11b..5c195fda90 100644 --- a/include/deal.II/numerics/matrix_creator.templates.h +++ b/include/deal.II/numerics/matrix_creator.templates.h @@ -113,18 +113,17 @@ namespace MatrixCreator template inline IteratorRange::IteratorRange( const active_cell_iterator &first, - const active_cell_iterator &second) : - first(first), - second(second) + const active_cell_iterator &second) + : first(first) + , second(second) {} template - inline IteratorRange::IteratorRange( - const iterator_pair &ip) : - first(ip.first), - second(ip.second) + inline IteratorRange::IteratorRange(const iterator_pair &ip) + : first(ip.first) + , second(ip.second) {} @@ -139,42 +138,42 @@ namespace MatrixCreator const Function * coefficient, const Function * rhs_function, const ::dealii::hp::QCollection & quadrature, - const ::dealii::hp::MappingCollection &mapping) : - fe_collection(fe), - quadrature_collection(quadrature), - mapping_collection(mapping), - x_fe_values(mapping_collection, - fe_collection, - quadrature_collection, - update_flags), - coefficient_values(quadrature_collection.max_n_quadrature_points()), - coefficient_vector_values( - quadrature_collection.max_n_quadrature_points(), - dealii::Vector(fe_collection.n_components())), - rhs_values(quadrature_collection.max_n_quadrature_points()), - rhs_vector_values( - quadrature_collection.max_n_quadrature_points(), - dealii::Vector(fe_collection.n_components())), - coefficient(coefficient), - rhs_function(rhs_function), - update_flags(update_flags) + const ::dealii::hp::MappingCollection &mapping) + : fe_collection(fe) + , quadrature_collection(quadrature) + , mapping_collection(mapping) + , x_fe_values(mapping_collection, + fe_collection, + quadrature_collection, + update_flags) + , coefficient_values(quadrature_collection.max_n_quadrature_points()) + , coefficient_vector_values( + quadrature_collection.max_n_quadrature_points(), + dealii::Vector(fe_collection.n_components())) + , rhs_values(quadrature_collection.max_n_quadrature_points()) + , rhs_vector_values(quadrature_collection.max_n_quadrature_points(), + dealii::Vector( + fe_collection.n_components())) + , coefficient(coefficient) + , rhs_function(rhs_function) + , update_flags(update_flags) {} - Scratch(const Scratch &data) : - fe_collection(data.fe_collection), - quadrature_collection(data.quadrature_collection), - mapping_collection(data.mapping_collection), - x_fe_values(mapping_collection, - fe_collection, - quadrature_collection, - data.update_flags), - coefficient_values(data.coefficient_values), - coefficient_vector_values(data.coefficient_vector_values), - rhs_values(data.rhs_values), - rhs_vector_values(data.rhs_vector_values), - coefficient(data.coefficient), - rhs_function(data.rhs_function), - update_flags(data.update_flags) + Scratch(const Scratch &data) + : fe_collection(data.fe_collection) + , quadrature_collection(data.quadrature_collection) + , mapping_collection(data.mapping_collection) + , x_fe_values(mapping_collection, + fe_collection, + quadrature_collection, + data.update_flags) + , coefficient_values(data.coefficient_values) + , coefficient_vector_values(data.coefficient_vector_values) + , rhs_values(data.rhs_values) + , rhs_vector_values(data.rhs_vector_values) + , coefficient(data.coefficient) + , rhs_function(data.rhs_function) + , update_flags(data.update_flags) {} Scratch & @@ -359,21 +358,26 @@ namespace MatrixCreator if (data.coefficient->n_components == 1) for (unsigned int point = 0; point < n_q_points; ++point) - add_data += (data.coefficient_values[point] * - fe_values.shape_value_component( - i, point, comp_i) * - fe_values.shape_value_component( - j, point, comp_i) * - JxW[point]); + add_data += + (data.coefficient_values[point] * + fe_values.shape_value_component(i, + point, + comp_i) * + fe_values.shape_value_component(j, + point, + comp_i) * + JxW[point]); else for (unsigned int point = 0; point < n_q_points; ++point) add_data += (data.coefficient_vector_values[point](comp_i) * - fe_values.shape_value_component( - i, point, comp_i) * - fe_values.shape_value_component( - j, point, comp_i) * + fe_values.shape_value_component(i, + point, + comp_i) * + fe_values.shape_value_component(j, + point, + comp_i) * JxW[point]); } else @@ -560,19 +564,23 @@ namespace MatrixCreator for (unsigned int point = 0; point < n_q_points; ++point) add_data += - ((fe_values.shape_grad_component( - i, point, comp_i) * - fe_values.shape_grad_component( - j, point, comp_i)) * + ((fe_values.shape_grad_component(i, + point, + comp_i) * + fe_values.shape_grad_component(j, + point, + comp_i)) * JxW[point] * data.coefficient_values[point]); else for (unsigned int point = 0; point < n_q_points; ++point) add_data += - ((fe_values.shape_grad_component( - i, point, comp_i) * - fe_values.shape_grad_component( - j, point, comp_i)) * + ((fe_values.shape_grad_component(i, + point, + comp_i) * + fe_values.shape_grad_component(j, + point, + comp_i)) * JxW[point] * data.coefficient_vector_values[point](comp_i)); } @@ -637,8 +645,9 @@ namespace MatrixCreator *matrix, *right_hand_side); else - data.constraints->distribute_local_to_global( - data.cell_matrix, data.dof_indices, *matrix); + data.constraints->distribute_local_to_global(data.cell_matrix, + data.dof_indices, + *matrix); } @@ -667,19 +676,19 @@ namespace MatrixCreator template - CopyData::CopyData() : - dofs_per_cell(numbers::invalid_unsigned_int) + CopyData::CopyData() + : dofs_per_cell(numbers::invalid_unsigned_int) {} template - CopyData::CopyData(CopyData const &data) : - dofs_per_cell(data.dofs_per_cell), - dofs(data.dofs), - dof_is_on_face(data.dof_is_on_face), - cell(data.cell), - cell_matrix(data.cell_matrix), - cell_vector(data.cell_vector) + CopyData::CopyData(CopyData const &data) + : dofs_per_cell(data.dofs_per_cell) + , dofs(data.dofs) + , dof_is_on_face(data.dof_is_on_face) + , cell(data.cell) + , cell_matrix(data.cell_matrix) + , cell_vector(data.cell_vector) {} } // namespace AssemblerBoundary } // namespace internal @@ -706,14 +715,14 @@ namespace MatrixCreator hp::QCollection q_collection(q); hp::MappingCollection mapping_collection(mapping); MatrixCreator::internal::AssemblerData::Scratch - assembler_data( - fe_collection, - update_values | update_JxW_values | - (coefficient != nullptr ? update_quadrature_points : UpdateFlags(0)), - coefficient, - /*rhs_function=*/nullptr, - q_collection, - mapping_collection); + assembler_data(fe_collection, + update_values | update_JxW_values | + (coefficient != nullptr ? update_quadrature_points : + UpdateFlags(0)), + coefficient, + /*rhs_function=*/nullptr, + q_collection, + mapping_collection); MatrixCreator::internal::AssemblerData::CopyData copy_data; copy_data.cell_matrix.reinit( @@ -857,14 +866,14 @@ namespace MatrixCreator ExcDimensionMismatch(matrix.n(), dof.n_dofs())); MatrixCreator::internal::AssemblerData::Scratch - assembler_data( - dof.get_fe_collection(), - update_values | update_JxW_values | - (coefficient != nullptr ? update_quadrature_points : UpdateFlags(0)), - coefficient, - /*rhs_function=*/nullptr, - q, - mapping); + assembler_data(dof.get_fe_collection(), + update_values | update_JxW_values | + (coefficient != nullptr ? update_quadrature_points : + UpdateFlags(0)), + coefficient, + /*rhs_function=*/nullptr, + q, + mapping); MatrixCreator::internal::AssemblerData::CopyData copy_data; copy_data.cell_matrix.reinit( assembler_data.fe_collection.max_dofs_per_cell(), @@ -1164,16 +1173,19 @@ namespace MatrixCreator ++j) copy_data.cell_matrix.back()(i, j) += coefficient_vector_values[point](comp) * - fe_values.shape_value_component( - j, point, comp) * - fe_values.shape_value_component( - i, point, comp) * + fe_values.shape_value_component(j, + point, + comp) * + fe_values.shape_value_component(i, + point, + comp) * normal_adjustment[point][comp] * weight; copy_data.cell_vector.back()(i) += rhs_values_system[point]( component_mapping[comp]) * - fe_values.shape_value_component( - i, point, comp) * + fe_values.shape_value_component(i, + point, + comp) * normal_adjustment[point][comp] * weight; } } @@ -1394,11 +1406,11 @@ namespace MatrixCreator WorkStream::run( dof.begin_active(), dof.end(), - static_cast::active_cell_iterator const &, - MatrixCreator::internal::AssemblerBoundary::Scratch const &, - MatrixCreator::internal::AssemblerBoundary:: - CopyData, number> &)>>( + static_cast::active_cell_iterator const &, + MatrixCreator::internal::AssemblerBoundary::Scratch const &, + MatrixCreator::internal::AssemblerBoundary:: + CopyData, number> &)>>( std::bind( &internal::create_boundary_mass_matrix_1, std::placeholders::_1, @@ -1459,8 +1471,10 @@ namespace MatrixCreator UpdateFlags update_flags = UpdateFlags(update_values | update_JxW_values | update_normal_vectors | update_quadrature_points); - hp::FEFaceValues x_fe_values( - mapping, fe_collection, q, update_flags); + hp::FEFaceValues x_fe_values(mapping, + fe_collection, + q, + update_flags); // two variables for the coefficient, // one for the two cases indicated in @@ -1612,16 +1626,19 @@ namespace MatrixCreator ++j) copy_data.cell_matrix.back()(i, j) += coefficient_vector_values[point](comp) * - fe_values.shape_value_component( - i, point, comp) * - fe_values.shape_value_component( - j, point, comp) * + fe_values.shape_value_component(i, + point, + comp) * + fe_values.shape_value_component(j, + point, + comp) * normal_adjustment[point][comp] * weight; copy_data.cell_vector.back()(i) += rhs_values_system[point]( component_mapping[comp]) * - fe_values.shape_value_component( - i, point, comp) * + fe_values.shape_value_component(i, + point, + comp) * normal_adjustment[point][comp] * weight; } } @@ -1940,14 +1957,14 @@ namespace MatrixCreator hp::QCollection q_collection(q); hp::MappingCollection mapping_collection(mapping); MatrixCreator::internal::AssemblerData::Scratch - assembler_data( - fe_collection, - update_gradients | update_JxW_values | - (coefficient != nullptr ? update_quadrature_points : UpdateFlags(0)), - coefficient, - /*rhs_function=*/nullptr, - q_collection, - mapping_collection); + assembler_data(fe_collection, + update_gradients | update_JxW_values | + (coefficient != nullptr ? update_quadrature_points : + UpdateFlags(0)), + coefficient, + /*rhs_function=*/nullptr, + q_collection, + mapping_collection); MatrixCreator::internal::AssemblerData::CopyData copy_data; copy_data.cell_matrix.reinit( assembler_data.fe_collection.max_dofs_per_cell(), @@ -2088,14 +2105,14 @@ namespace MatrixCreator ExcDimensionMismatch(matrix.n(), dof.n_dofs())); MatrixCreator::internal::AssemblerData::Scratch - assembler_data( - dof.get_fe_collection(), - update_gradients | update_JxW_values | - (coefficient != nullptr ? update_quadrature_points : UpdateFlags(0)), - coefficient, - /*rhs_function=*/nullptr, - q, - mapping); + assembler_data(dof.get_fe_collection(), + update_gradients | update_JxW_values | + (coefficient != nullptr ? update_quadrature_points : + UpdateFlags(0)), + coefficient, + /*rhs_function=*/nullptr, + q, + mapping); MatrixCreator::internal::AssemblerData::CopyData copy_data; copy_data.cell_matrix.reinit( assembler_data.fe_collection.max_dofs_per_cell(), diff --git a/include/deal.II/numerics/solution_transfer.h b/include/deal.II/numerics/solution_transfer.h index d6959b5a65..457dd332dd 100644 --- a/include/deal.II/numerics/solution_transfer.h +++ b/include/deal.II/numerics/solution_transfer.h @@ -491,23 +491,23 @@ private: */ struct Pointerstruct { - Pointerstruct() : - indices_ptr(nullptr), - dof_values_ptr(nullptr), - active_fe_index(0) + Pointerstruct() + : indices_ptr(nullptr) + , dof_values_ptr(nullptr) + , active_fe_index(0) {} Pointerstruct(std::vector *indices_ptr_in, - const unsigned int active_fe_index_in = 0) : - indices_ptr(indices_ptr_in), - dof_values_ptr(nullptr), - active_fe_index(active_fe_index_in) + const unsigned int active_fe_index_in = 0) + : indices_ptr(indices_ptr_in) + , dof_values_ptr(nullptr) + , active_fe_index(active_fe_index_in) {} Pointerstruct( std::vector> *dof_values_ptr_in, - const unsigned int active_fe_index_in = 0) : - indices_ptr(nullptr), - dof_values_ptr(dof_values_ptr_in), - active_fe_index(active_fe_index_in) + const unsigned int active_fe_index_in = 0) + : indices_ptr(nullptr) + , dof_values_ptr(dof_values_ptr_in) + , active_fe_index(active_fe_index_in) {} std::size_t memory_consumption() const; diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index f9d2283dad..6a930eae8e 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -186,8 +186,9 @@ namespace VectorTools destination; // value[m] <- sum inverse_jacobians[m][n] * old_value[n]: - TensorAccessors::contract<1, 2, 1, dim>( - destination, inverse_jacobians[i], source); + TensorAccessors::contract<1, 2, 1, dim>(destination, + inverse_jacobians[i], + source); destination *= jacobians[i].determinant(); // now copy things back into the input=output vector @@ -255,8 +256,10 @@ namespace VectorTools } else { - transform( - fe.conforming_space, offset, fe_values_jacobians, function_values); + transform(fe.conforming_space, + offset, + fe_values_jacobians, + function_values); return (offset + fe.n_components()); } } @@ -279,12 +282,12 @@ namespace VectorTools VectorType & vec, const ComponentMask & component_mask) { - Assert( - component_mask.represents_n_components( - dof_handler.get_fe().n_components()), - ExcMessage("The number of components in the mask has to be either " - "zero or equal to the number of components in the finite " - "element.")); + Assert(component_mask.represents_n_components( + dof_handler.get_fe().n_components()), + ExcMessage( + "The number of components in the mask has to be either " + "zero or equal to the number of components in the finite " + "element.")); Assert(vec.size() == dof_handler.n_dofs(), ExcDimensionMismatch(vec.size(), dof_handler.n_dofs())); @@ -372,11 +375,12 @@ namespace VectorTools // locations as well as Jacobians and their inverses. // the latter are only needed for Hcurl or Hdiv conforming elements, // but we'll just always include them. - hp::FEValues fe_values( - mapping_collection, - fe, - support_quadrature, - update_quadrature_points | update_jacobians | update_inverse_jacobians); + hp::FEValues fe_values(mapping_collection, + fe, + support_quadrature, + update_quadrature_points | + update_jacobians | + update_inverse_jacobians); // // Now loop over all locally owned, active cells. @@ -511,12 +515,14 @@ namespace VectorTools for (const auto i : interpolation.locally_owned_elements()) { - const auto value = ::dealii::internal::ElementAccess::get( - interpolation, i); + const auto value = + ::dealii::internal::ElementAccess::get(interpolation, + i); const auto weight = ::dealii::internal::ElementAccess::get(weights, i); - ::dealii::internal::ElementAccess::set( - value / weight, i, vec); + ::dealii::internal::ElementAccess::set(value / weight, + i, + vec); } vec.compress(VectorOperation::insert); } @@ -1036,8 +1042,10 @@ namespace VectorTools SparsityPattern sparsity; { DynamicSparsityPattern dsp(dof.n_dofs(), dof.n_dofs()); - DoFTools::make_sparsity_pattern( - dof, dsp, constraints, !constraints_are_compatible); + DoFTools::make_sparsity_pattern(dof, + dsp, + constraints, + !constraints_are_compatible); sparsity.copy_from(dsp); } @@ -1081,8 +1089,9 @@ namespace VectorTools // it may be of another type than Vector and that wouldn't // necessarily go together with the matrix and other functions for (unsigned int i = 0; i < vec.size(); ++i) - ::dealii::internal::ElementAccess::set( - vec(i), i, vec_result); + ::dealii::internal::ElementAccess::set(vec(i), + i, + vec_result); } @@ -1382,8 +1391,9 @@ namespace VectorTools const IndexSet & locally_owned_dofs = dof.locally_owned_dofs(); IndexSet::ElementIterator it = locally_owned_dofs.begin(); for (; it != locally_owned_dofs.end(); ++it) - ::dealii::internal::ElementAccess::set( - work_result(*it), *it, vec_result); + ::dealii::internal::ElementAccess::set(work_result(*it), + *it, + vec_result); vec_result.compress(VectorOperation::insert); } @@ -1504,8 +1514,10 @@ namespace VectorTools // assemble right hand side: { - FEValues fe_values( - mapping, dof.get_fe(), quadrature, update_values | update_JxW_values); + FEValues fe_values(mapping, + dof.get_fe(), + quadrature, + update_values | update_JxW_values); const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; const unsigned int n_q_points = quadrature.size(); @@ -1528,8 +1540,9 @@ namespace VectorTools } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_rhs, local_dof_indices, rhs); + constraints.distribute_local_to_global(cell_rhs, + local_dof_indices, + rhs); } rhs.compress(VectorOperation::add); } @@ -1554,8 +1567,9 @@ namespace VectorTools const IndexSet & locally_owned_dofs = dof.locally_owned_dofs(); IndexSet::ElementIterator it = locally_owned_dofs.begin(); for (; it != locally_owned_dofs.end(); ++it) - ::dealii::internal::ElementAccess::set( - vec(*it), *it, vec_result); + ::dealii::internal::ElementAccess::set(vec(*it), + *it, + vec_result); vec_result.compress(VectorOperation::insert); } @@ -1647,8 +1661,9 @@ namespace VectorTools const IndexSet & locally_owned_dofs = dof.locally_owned_dofs(); IndexSet::ElementIterator it = locally_owned_dofs.begin(); for (; it != locally_owned_dofs.end(); ++it) - ::dealii::internal::ElementAccess::set( - vec(*it), *it, vec_result); + ::dealii::internal::ElementAccess::set(vec(*it), + *it, + vec_result); vec_result.compress(VectorOperation::insert); } } // namespace @@ -1941,8 +1956,9 @@ namespace VectorTools cell->get_dof_indices(dofs); - constraints.distribute_local_to_global( - cell_vector, dofs, rhs_vector); + constraints.distribute_local_to_global(cell_vector, + dofs, + rhs_vector); } } else @@ -1986,16 +2002,19 @@ namespace VectorTools ++comp_i) if (fe.get_nonzero_components(i)[comp_i]) { - cell_vector(i) += rhs_values[point](comp_i) * - fe_values.shape_value_component( - i, point, comp_i) * - weights[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); - constraints.distribute_local_to_global( - cell_vector, dofs, rhs_vector); + constraints.distribute_local_to_global(cell_vector, + dofs, + rhs_vector); } } } @@ -2042,8 +2061,10 @@ namespace VectorTools UpdateFlags update_flags = UpdateFlags(update_values | update_quadrature_points | update_JxW_values); - hp::FEValues x_fe_values( - mapping, fe, quadrature, update_flags); + hp::FEValues x_fe_values(mapping, + fe, + quadrature, + update_flags); const unsigned int n_components = fe.n_components(); @@ -2085,8 +2106,9 @@ namespace VectorTools cell->get_dof_indices(dofs); - constraints.distribute_local_to_global( - cell_vector, dofs, rhs_vector); + constraints.distribute_local_to_global(cell_vector, + dofs, + rhs_vector); } } else @@ -2138,17 +2160,20 @@ namespace VectorTools ++comp_i) if (cell->get_fe().get_nonzero_components(i)[comp_i]) { - cell_vector(i) += rhs_values[point](comp_i) * - fe_values.shape_value_component( - i, point, comp_i) * - weights[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); - constraints.distribute_local_to_global( - cell_vector, dofs, rhs_vector); + constraints.distribute_local_to_global(cell_vector, + dofs, + rhs_vector); } } } @@ -2197,8 +2222,10 @@ namespace VectorTools Quadrature q( GeometryInfo::project_to_unit_cell(cell_point.second)); - FEValues fe_values( - mapping, dof_handler.get_fe(), q, UpdateFlags(update_values)); + FEValues fe_values(mapping, + dof_handler.get_fe(), + q, + UpdateFlags(update_values)); fe_values.reinit(cell_point.first); const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell; @@ -2218,8 +2245,10 @@ namespace VectorTools const Point & p, Vector & rhs_vector) { - create_point_source_vector( - StaticMappingQ1::mapping, dof_handler, p, rhs_vector); + create_point_source_vector(StaticMappingQ1::mapping, + dof_handler, + p, + rhs_vector); } @@ -2269,8 +2298,10 @@ namespace VectorTools const Point & p, Vector & rhs_vector) { - create_point_source_vector( - hp::StaticMappingQ1::mapping_collection, dof_handler, p, rhs_vector); + create_point_source_vector(hp::StaticMappingQ1::mapping_collection, + dof_handler, + p, + rhs_vector); } @@ -2300,8 +2331,10 @@ namespace VectorTools GeometryInfo::project_to_unit_cell(cell_point.second)); const FEValuesExtractors::Vector vec(0); - FEValues fe_values( - mapping, dof_handler.get_fe(), q, UpdateFlags(update_values)); + FEValues fe_values(mapping, + dof_handler.get_fe(), + q, + UpdateFlags(update_values)); fe_values.reinit(cell_point.first); const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell; @@ -2502,10 +2535,12 @@ namespace VectorTools ++comp_i) if (fe.get_nonzero_components(i)[comp_i]) { - cell_vector(i) += rhs_values[point](comp_i) * - fe_values.shape_value_component( - i, point, comp_i) * - weights[point]; + cell_vector(i) += + rhs_values[point](comp_i) * + fe_values.shape_value_component(i, + point, + comp_i) * + weights[point]; } } @@ -2661,10 +2696,12 @@ namespace VectorTools ++comp_i) if (cell->get_fe().get_nonzero_components(i)[comp_i]) { - cell_vector(i) += rhs_values[point](comp_i) * - fe_values.shape_value_component( - i, point, comp_i) * - weights[point]; + cell_vector(i) += + rhs_values[point](comp_i) * + fe_values.shape_value_component(i, + point, + comp_i) * + weights[point]; } } dofs.resize(dofs_per_cell); @@ -2770,9 +2807,9 @@ namespace VectorTools ExcDimensionMismatch(fe.n_components(), boundary_function.n_components)); - Assert( - component_mask.n_selected_components(fe.n_components()) > 0, - ComponentMask::ExcNoComponentSelected()); + Assert(component_mask.n_selected_components( + fe.n_components()) > 0, + ComponentMask::ExcNoComponentSelected()); // now set the value of the vertex degree of // freedom. setting also creates the entry in the @@ -2939,9 +2976,9 @@ namespace VectorTools // resize array. avoid construction of a memory // allocating temporary if possible if (dof_values_system.size() < fe.dofs_per_face) - dof_values_system.resize( - fe.dofs_per_face, - Vector(fe.n_components())); + dof_values_system.resize(fe.dofs_per_face, + Vector( + fe.n_components())); else dof_values_system.resize(fe.dofs_per_face); @@ -3016,8 +3053,9 @@ namespace VectorTools // get only the one component that this function has dof_values_scalar.resize(fe.dofs_per_face); function_map.find(boundary_component) - ->second->value_list( - dof_locations, dof_values_scalar, 0); + ->second->value_list(dof_locations, + dof_values_scalar, + 0); // enter into list @@ -3417,8 +3455,9 @@ namespace VectorTools ++i) selected_boundary_components.insert(i->first); - DoFTools::map_dof_to_boundary_indices( - dof, selected_boundary_components, dof_to_boundary_mapping); + DoFTools::map_dof_to_boundary_indices(dof, + selected_boundary_components, + dof_to_boundary_mapping); // Done if no degrees of freedom on the boundary if (dof.n_boundary_dofs(boundary_functions) == 0) @@ -3427,8 +3466,10 @@ namespace VectorTools // set up sparsity structure DynamicSparsityPattern dsp(dof.n_boundary_dofs(boundary_functions), dof.n_boundary_dofs(boundary_functions)); - DoFTools::make_boundary_sparsity_pattern( - dof, boundary_functions, dof_to_boundary_mapping, dsp); + DoFTools::make_boundary_sparsity_pattern(dof, + boundary_functions, + dof_to_boundary_mapping, + dsp); SparsityPattern sparsity; sparsity.copy_from(dsp); @@ -4325,9 +4366,10 @@ namespace VectorTools std::vector & dofs_processed) { const unsigned int spacedim = dim; - hp_fe_values.reinit( - cell, - cell->active_fe_index() * GeometryInfo::faces_per_cell + face); + hp_fe_values.reinit(cell, + cell->active_fe_index() * + GeometryInfo::faces_per_cell + + face); // Initialize the required // objects. const FEValues &fe_values = hp_fe_values.get_present_fe_values(); @@ -4510,9 +4552,10 @@ namespace VectorTools ((dynamic_cast *>(&fe) != nullptr) && (2 * fe.degree <= i) && (i < 4 * fe.degree))) - tmp -= dof_values[i] * - fe_values[vec].value( - fe.face_to_cell_index(i, face), q_point); + tmp -= + dof_values[i] * + fe_values[vec].value(fe.face_to_cell_index(i, face), + q_point); const double JxW = std::sqrt( fe_values.JxW(q_point) / @@ -4584,8 +4627,9 @@ namespace VectorTools fe.degree))) { const Tensor<1, dim> shape_value = - (JxW * fe_values[vec].value( - fe.face_to_cell_index(i, face), q_point)); + (JxW * + fe_values[vec].value(fe.face_to_cell_index(i, face), + q_point)); for (unsigned int d = 0; d < dim; ++d) assembling_matrix(index, dim * q_point + d) = @@ -4667,9 +4711,10 @@ namespace VectorTools ((dynamic_cast *>(&fe) != nullptr) && (i < 2 * fe.degree))) - tmp -= dof_values[i] * - fe_values[vec].value( - fe.face_to_cell_index(i, face), q_point); + tmp -= + dof_values[i] * + fe_values[vec].value(fe.face_to_cell_index(i, face), + q_point); const double JxW = std::sqrt( fe_values.JxW(q_point) / @@ -4725,8 +4770,9 @@ namespace VectorTools i))) { const Tensor<1, dim> shape_value = - JxW * fe_values[vec].value( - fe.face_to_cell_index(i, face), q_point); + JxW * + fe_values[vec].value(fe.face_to_cell_index(i, face), + q_point); for (unsigned int d = 0; d < dim; ++d) assembling_matrix(index, dim * q_point + d) = @@ -4920,12 +4966,13 @@ namespace VectorTools reference_edge_quadrature, line), face)); - hp::FEValues fe_edge_values( - mapping_collection, - fe_collection, - edge_quadrature_collection, - update_jacobians | update_JxW_values | update_quadrature_points | - update_values); + hp::FEValues fe_edge_values(mapping_collection, + fe_collection, + edge_quadrature_collection, + update_jacobians | + update_JxW_values | + update_quadrature_points | + update_values); for (; cell != dof_handler.end(); ++cell) if (cell->at_boundary() && cell->is_locally_owned()) @@ -5151,12 +5198,13 @@ namespace VectorTools face)); } - hp::FEValues fe_edge_values( - mapping_collection, - fe_collection, - edge_quadrature_collection, - update_jacobians | update_JxW_values | update_quadrature_points | - update_values); + hp::FEValues fe_edge_values(mapping_collection, + fe_collection, + edge_quadrature_collection, + update_jacobians | + update_JxW_values | + update_quadrature_points | + update_values); for (; cell != dof_handler.end(); ++cell) if (cell->at_boundary() && cell->is_locally_owned()) @@ -5729,8 +5777,9 @@ namespace VectorTools const unsigned int lines_per_face = GeometryInfo::lines_per_face; std::vector> - associated_edge_dof_to_face_dof( - lines_per_face, std::vector(degree + 1)); + associated_edge_dof_to_face_dof(lines_per_face, + std::vector(degree + + 1)); std::vector associated_edge_dofs(lines_per_face); for (unsigned int line = 0; line < lines_per_face; ++line) @@ -5775,9 +5824,9 @@ namespace VectorTools } // Sanity check: associated_edge_dofs[line] = associated_edge_dof_index; - Assert( - associated_edge_dofs[line] == degree + 1, - ExcMessage("Error: Unexpected number of 3D edge DoFs")); + Assert(associated_edge_dofs[line] == degree + 1, + ExcMessage( + "Error: Unexpected number of 3D edge DoFs")); } // Next find the face DoFs associated with the vector components @@ -5901,9 +5950,10 @@ namespace VectorTools const unsigned int cell_j = fe.face_to_cell_index(j_face_idx, face); - cross_product_j = cross_product_3d( - normal_vector, - fe_face_values[vec].value(cell_j, q_point)); + cross_product_j = + cross_product_3d(normal_vector, + fe_face_values[vec].value(cell_j, + q_point)); for (unsigned int i = 0; i < associated_face_dofs; ++i) { @@ -6002,12 +6052,13 @@ namespace VectorTools face_quadrature_collection.push_back(reference_face_quadrature); } - hp::FEFaceValues fe_face_values( - mapping_collection, - fe_collection, - face_quadrature_collection, - update_values | update_quadrature_points | update_normal_vectors | - update_JxW_values); + hp::FEFaceValues fe_face_values(mapping_collection, + fe_collection, + face_quadrature_collection, + update_values | + update_quadrature_points | + update_normal_vectors | + update_JxW_values); // Storage for dof values found and whether they have been processed: std::vector dofs_processed; @@ -6138,12 +6189,13 @@ namespace VectorTools } } - hp::FEValues fe_edge_values( - mapping_collection, - fe_collection, - edge_quadrature_collection, - update_jacobians | update_JxW_values | - update_quadrature_points | update_values); + hp::FEValues fe_edge_values(mapping_collection, + fe_collection, + edge_quadrature_collection, + update_jacobians | + update_JxW_values | + update_quadrature_points | + update_values); for (; cell != dof_handler.end(); ++cell) { @@ -6333,8 +6385,10 @@ namespace VectorTools const std::vector> &normals = fe_values.get_all_normal_vectors(); const unsigned int - face_coordinate_direction[GeometryInfo<2>::faces_per_cell] = { - 1, 1, 0, 0}; + face_coordinate_direction[GeometryInfo<2>::faces_per_cell] = {1, + 1, + 0, + 0}; std::vector> values(fe_values.n_quadrature_points, Vector(2)); Vector dof_values(fe.dofs_per_face); @@ -6712,13 +6766,14 @@ namespace VectorTools QProjector::project_to_face(quadrature, face)); } - hp::FEFaceValues fe_face_values( - mapping_collection, - fe_collection, - face_quadrature_collection, - update_JxW_values | update_normal_vectors | update_quadrature_points | - update_values); - hp::FEValues fe_values(mapping_collection, + hp::FEFaceValues fe_face_values(mapping_collection, + fe_collection, + face_quadrature_collection, + update_JxW_values | + update_normal_vectors | + update_quadrature_points | + update_values); + hp::FEValues fe_values(mapping_collection, fe_collection, quadrature_collection, update_jacobians); @@ -7066,8 +7121,9 @@ namespace VectorTools // now enter the (dofs,(normal_vector,cell)) entry into // the map - dof_to_normals_map.insert(std::make_pair( - vector_dofs, std::make_pair(normal_vector, cell))); + dof_to_normals_map.insert( + std::make_pair(vector_dofs, + std::make_pair(normal_vector, cell))); dof_vector_to_b_values.insert( std::make_pair(vector_dofs, b_values)); @@ -7142,9 +7198,10 @@ namespace VectorTools // in the same entry, store again the now averaged normal vector // and the new count - cell_to_normals_map[q->second.second] = std::make_pair( - (old_normal * old_count + q->second.first) / (old_count + 1), - old_count + 1); + cell_to_normals_map[q->second.second] = + std::make_pair((old_normal * old_count + q->second.first) / + (old_count + 1), + old_count + 1); } Assert(cell_to_normals_map.size() >= 1, ExcInternalError()); @@ -7213,8 +7270,10 @@ namespace VectorTools dof_vector_to_b_values[dof_indices]; for (unsigned int i = 0; i < dim; ++i) normal_value += b_values[i] * normal[i]; - internal::add_constraint( - dof_indices, normal, constraints, normal_value); + internal::add_constraint(dof_indices, + normal, + constraints, + normal_value); break; } @@ -7430,8 +7489,10 @@ namespace VectorTools same_dof_range[0]->first; const Vector b_values = dof_vector_to_b_values[dof_indices]; - internal::add_tangentiality_constraints( - dof_indices, average_tangent, constraints, b_values); + internal::add_tangentiality_constraints(dof_indices, + average_tangent, + constraints, + b_values); } } } @@ -7577,9 +7638,10 @@ namespace VectorTools const unsigned int component = fe.face_system_to_component_index(i).first - first_vector_component; - n_scalar_indices = std::max( - n_scalar_indices, - fe.face_system_to_component_index(i).second + 1); + n_scalar_indices = + std::max(n_scalar_indices, + fe.face_system_to_component_index(i).second + + 1); cell_vector_dofs[fe.face_system_to_component_index(i) .second][component] = face_dofs[i]; @@ -7681,8 +7743,9 @@ namespace VectorTools { constraints.add_line(new_index); if (std::abs(normal[d]) > 1e-13) - constraints.add_entry( - new_index, (*it)[constrained_index], -normal[d]); + constraints.add_entry(new_index, + (*it)[constrained_index], + -normal[d]); constraints.set_inhomogeneity(new_index, boundary_value[d]); } } @@ -7733,17 +7796,17 @@ namespace VectorTools const dealii::hp::MappingCollection &mapping, const dealii::hp::FECollection & fe, const dealii::hp::QCollection & q, - const UpdateFlags update_flags) : - x_fe_values(mapping, fe, q, update_flags) + const UpdateFlags update_flags) + : x_fe_values(mapping, fe, q, update_flags) {} template IDScratchData::IDScratchData( - const IDScratchData &data) : - x_fe_values(data.x_fe_values.get_mapping_collection(), - data.x_fe_values.get_fe_collection(), - data.x_fe_values.get_quadrature_collection(), - data.x_fe_values.get_update_flags()) + const IDScratchData &data) + : x_fe_values(data.x_fe_values.get_mapping_collection(), + data.x_fe_values.get_fe_collection(), + data.x_fe_values.get_quadrature_collection(), + data.x_fe_values.get_update_flags()) {} template @@ -8170,8 +8233,10 @@ namespace VectorTools const dealii::hp::FECollection &fe_collection = dof.get_fe_collection(); - IDScratchData data( - mapping, fe_collection, q, update_flags); + IDScratchData data(mapping, + fe_collection, + q, + update_flags); // loop over all cells for (typename DoFHandlerType::active_cell_iterator cell = @@ -8225,16 +8290,16 @@ namespace VectorTools const Function * weight, const double exponent) { - internal ::do_integrate_difference( - hp::MappingCollection(mapping), - dof, - fe_function, - exact_solution, - difference, - hp::QCollection(q), - norm, - weight, - exponent); + internal ::do_integrate_difference(hp::MappingCollection( + mapping), + dof, + fe_function, + exact_solution, + difference, + hp::QCollection(q), + norm, + weight, + exponent); } @@ -8276,16 +8341,16 @@ namespace VectorTools const Function * weight, const double exponent) { - internal ::do_integrate_difference( - hp::MappingCollection(mapping), - dof, - fe_function, - exact_solution, - difference, - q, - norm, - weight, - exponent); + internal ::do_integrate_difference(hp::MappingCollection( + mapping), + dof, + fe_function, + exact_solution, + difference, + q, + norm, + weight, + exponent); } @@ -8370,11 +8435,11 @@ namespace VectorTools case W1infty_norm: { - AssertThrow( - false, - ExcMessage("compute_global_error() is impossible for " - "the W1infty_norm. See the documentation for " - "NormType::W1infty_norm for more information.")); + AssertThrow(false, + ExcMessage( + "compute_global_error() is impossible for " + "the W1infty_norm. See the documentation for " + "NormType::W1infty_norm for more information.")); return std::numeric_limits::infinity(); } @@ -8510,8 +8575,10 @@ namespace VectorTools const VectorType & fe_function, const Point & point) { - return point_value( - StaticMappingQ1::mapping, dof, fe_function, point); + return point_value(StaticMappingQ1::mapping, + dof, + fe_function, + point); } @@ -8600,8 +8667,10 @@ namespace VectorTools const Quadrature quadrature( GeometryInfo::project_to_unit_cell(cell_point.second)); - hp::FEValues hp_fe_values( - mapping, fe, hp::QCollection(quadrature), update_values); + hp::FEValues hp_fe_values(mapping, + fe, + hp::QCollection(quadrature), + update_values); hp_fe_values.reinit(cell_point.first); const FEValues &fe_values = hp_fe_values.get_present_fe_values(); @@ -8692,8 +8761,10 @@ namespace VectorTools const VectorType & fe_function, const Point & point) { - return point_gradient( - StaticMappingQ1::mapping, dof, fe_function, point); + return point_gradient(StaticMappingQ1::mapping, + dof, + fe_function, + point); } @@ -8786,8 +8857,10 @@ namespace VectorTools const Quadrature quadrature( GeometryInfo::project_to_unit_cell(cell_point.second)); - hp::FEValues hp_fe_values( - mapping, fe, hp::QCollection(quadrature), update_gradients); + hp::FEValues hp_fe_values(mapping, + fe, + hp::QCollection(quadrature), + update_gradients); hp_fe_values.reinit(cell_point.first); const FEValues &fe_values = hp_fe_values.get_present_fe_values(); diff --git a/include/deal.II/optimization/rol/vector_adaptor.h b/include/deal.II/optimization/rol/vector_adaptor.h index 56fed84ee5..aa6ec7bcf1 100644 --- a/include/deal.II/optimization/rol/vector_adaptor.h +++ b/include/deal.II/optimization/rol/vector_adaptor.h @@ -262,8 +262,8 @@ namespace Rol template VectorAdaptor::VectorAdaptor( - const Teuchos::RCP &vector_ptr) : - vector_ptr(vector_ptr) + const Teuchos::RCP &vector_ptr) + : vector_ptr(vector_ptr) {} diff --git a/include/deal.II/physics/notation.h b/include/deal.II/physics/notation.h index 19838a2df4..82c227bc98 100644 --- a/include/deal.II/physics/notation.h +++ b/include/deal.II/physics/notation.h @@ -702,12 +702,15 @@ namespace Physics else { Assert((component_n < Tensor<2, 2>::n_independent_components), - ExcIndexRange( - component_n, 0, Tensor<2, 2>::n_independent_components)); + ExcIndexRange(component_n, + 0, + Tensor<2, 2>::n_independent_components)); } - static const unsigned int indices[4][2] = { - {0, 0}, {1, 1}, {0, 1}, {1, 0}}; + static const unsigned int indices[4][2] = {{0, 0}, + {1, 1}, + {0, 1}, + {1, 0}}; return std::make_pair(indices[component_n][0], indices[component_n][1]); } @@ -729,8 +732,9 @@ namespace Physics else { Assert((component_n < Tensor<2, 3>::n_independent_components), - ExcIndexRange( - component_n, 0, Tensor<2, 3>::n_independent_components)); + ExcIndexRange(component_n, + 0, + Tensor<2, 3>::n_independent_components)); } static const unsigned int indices[9][2] = {{0, 0}, @@ -1258,9 +1262,9 @@ namespace Physics { Assert(mtrx.m() == dim, ExcDimensionMismatch(mtrx.m(), dim)); Assert(mtrx.n() == 1, ExcDimensionMismatch(mtrx.n(), 1)); - Assert( - mtrx.n_elements() == v.n_independent_components, - ExcDimensionMismatch(mtrx.n_elements(), v.n_independent_components)); + Assert(mtrx.n_elements() == v.n_independent_components, + ExcDimensionMismatch(mtrx.n_elements(), + v.n_independent_components)); const unsigned int n_rows = mtrx.m(); const unsigned int n_cols = mtrx.n(); @@ -1287,9 +1291,9 @@ namespace Physics { Assert(mtrx.m() == dim, ExcDimensionMismatch(mtrx.m(), dim)); Assert(mtrx.n() == dim, ExcDimensionMismatch(mtrx.n(), dim)); - Assert( - mtrx.n_elements() == t.n_independent_components, - ExcDimensionMismatch(mtrx.n_elements(), t.n_independent_components)); + Assert(mtrx.n_elements() == t.n_independent_components, + ExcDimensionMismatch(mtrx.n_elements(), + t.n_independent_components)); const unsigned int n_rows = mtrx.m(); const unsigned int n_cols = mtrx.n(); @@ -1345,26 +1349,26 @@ namespace Physics void to_tensor(const FullMatrix &mtrx, Tensor<3, dim, Number> &t) { - Assert( - (mtrx.m() == Tensor<1, dim, Number>::n_independent_components) || - (mtrx.m() == Tensor<2, dim, Number>::n_independent_components) || - (mtrx.m() == - SymmetricTensor<2, dim, Number>::n_independent_components), - ExcNotationExcFullMatrixToTensorColSize3( - mtrx.m(), - Tensor<1, dim, Number>::n_independent_components, - Tensor<2, dim, Number>::n_independent_components, - SymmetricTensor<2, dim, Number>::n_independent_components)); - Assert( - (mtrx.n() == Tensor<1, dim, Number>::n_independent_components) || - (mtrx.n() == Tensor<2, dim, Number>::n_independent_components) || - (mtrx.n() == - SymmetricTensor<2, dim, Number>::n_independent_components), - ExcNotationExcFullMatrixToTensorColSize3( - mtrx.n(), - Tensor<1, dim, Number>::n_independent_components, - Tensor<2, dim, Number>::n_independent_components, - SymmetricTensor<2, dim, Number>::n_independent_components)); + Assert((mtrx.m() == Tensor<1, dim, Number>::n_independent_components) || + (mtrx.m() == + Tensor<2, dim, Number>::n_independent_components) || + (mtrx.m() == + SymmetricTensor<2, dim, Number>::n_independent_components), + ExcNotationExcFullMatrixToTensorColSize3( + mtrx.m(), + Tensor<1, dim, Number>::n_independent_components, + Tensor<2, dim, Number>::n_independent_components, + SymmetricTensor<2, dim, Number>::n_independent_components)); + Assert((mtrx.n() == Tensor<1, dim, Number>::n_independent_components) || + (mtrx.n() == + Tensor<2, dim, Number>::n_independent_components) || + (mtrx.n() == + SymmetricTensor<2, dim, Number>::n_independent_components), + ExcNotationExcFullMatrixToTensorColSize3( + mtrx.n(), + Tensor<1, dim, Number>::n_independent_components, + Tensor<2, dim, Number>::n_independent_components, + SymmetricTensor<2, dim, Number>::n_independent_components)); const unsigned int n_rows = mtrx.m(); const unsigned int n_cols = mtrx.n(); @@ -1486,9 +1490,9 @@ namespace Physics Assert((mtrx.n() == Tensor<2, dim, Number>::n_independent_components), ExcDimensionMismatch( mtrx.n(), Tensor<2, dim, Number>::n_independent_components)); - Assert( - mtrx.n_elements() == t.n_independent_components, - ExcDimensionMismatch(mtrx.n_elements(), t.n_independent_components)); + Assert(mtrx.n_elements() == t.n_independent_components, + ExcDimensionMismatch(mtrx.n_elements(), + t.n_independent_components)); const unsigned int n_rows = mtrx.m(); const unsigned int n_cols = mtrx.n(); @@ -1531,9 +1535,9 @@ namespace Physics ExcDimensionMismatch( mtrx.n(), SymmetricTensor<2, dim, Number>::n_independent_components)); - Assert( - mtrx.n_elements() == st.n_independent_components, - ExcDimensionMismatch(mtrx.n_elements(), st.n_independent_components)); + Assert(mtrx.n_elements() == st.n_independent_components, + ExcDimensionMismatch(mtrx.n_elements(), + st.n_independent_components)); const unsigned int n_rows = mtrx.m(); const unsigned int n_cols = mtrx.n(); diff --git a/include/deal.II/sundials/arkode.h b/include/deal.II/sundials/arkode.h index 9549477c33..181272b63a 100644 --- a/include/deal.II/sundials/arkode.h +++ b/include/deal.II/sundials/arkode.h @@ -357,19 +357,19 @@ namespace SUNDIALS const bool implicit_function_is_time_independent = false, // Error parameters const double &absolute_tolerance = 1e-6, - const double &relative_tolerance = 1e-5) : - initial_time(initial_time), - final_time(final_time), - initial_step_size(initial_step_size), - minimum_step_size(minimum_step_size), - absolute_tolerance(absolute_tolerance), - relative_tolerance(relative_tolerance), - maximum_order(maximum_order), - output_period(output_period), - maximum_non_linear_iterations(maximum_non_linear_iterations), - implicit_function_is_linear(implicit_function_is_linear), - implicit_function_is_time_independent( - implicit_function_is_time_independent) + const double &relative_tolerance = 1e-5) + : initial_time(initial_time) + , final_time(final_time) + , initial_step_size(initial_step_size) + , minimum_step_size(minimum_step_size) + , absolute_tolerance(absolute_tolerance) + , relative_tolerance(relative_tolerance) + , maximum_order(maximum_order) + , output_period(output_period) + , maximum_non_linear_iterations(maximum_non_linear_iterations) + , implicit_function_is_linear(implicit_function_is_linear) + , implicit_function_is_time_independent( + implicit_function_is_time_independent) {} /** diff --git a/include/deal.II/sundials/ida.h b/include/deal.II/sundials/ida.h index ed84cf639f..2092286f35 100644 --- a/include/deal.II/sundials/ida.h +++ b/include/deal.II/sundials/ida.h @@ -317,22 +317,22 @@ namespace SUNDIALS const double &relative_tolerance = 1e-5, const bool & ignore_algebraic_terms_for_errors = true, // Initial conditions parameters - const InitialConditionCorrection &ic_type = use_y_diff, - const InitialConditionCorrection &reset_type = use_y_diff, - const unsigned int &maximum_non_linear_iterations_ic = 5) : - initial_time(initial_time), - final_time(final_time), - initial_step_size(initial_step_size), - minimum_step_size(minimum_step_size), - absolute_tolerance(absolute_tolerance), - relative_tolerance(relative_tolerance), - maximum_order(maximum_order), - output_period(output_period), - ignore_algebraic_terms_for_errors(ignore_algebraic_terms_for_errors), - ic_type(ic_type), - reset_type(reset_type), - maximum_non_linear_iterations_ic(maximum_non_linear_iterations_ic), - maximum_non_linear_iterations(maximum_non_linear_iterations) + const InitialConditionCorrection &ic_type = use_y_diff, + const InitialConditionCorrection &reset_type = use_y_diff, + const unsigned int & maximum_non_linear_iterations_ic = 5) + : initial_time(initial_time) + , final_time(final_time) + , initial_step_size(initial_step_size) + , minimum_step_size(minimum_step_size) + , absolute_tolerance(absolute_tolerance) + , relative_tolerance(relative_tolerance) + , maximum_order(maximum_order) + , output_period(output_period) + , ignore_algebraic_terms_for_errors(ignore_algebraic_terms_for_errors) + , ic_type(ic_type) + , reset_type(reset_type) + , maximum_non_linear_iterations_ic(maximum_non_linear_iterations_ic) + , maximum_non_linear_iterations(maximum_non_linear_iterations) {} /** diff --git a/include/deal.II/sundials/kinsol.h b/include/deal.II/sundials/kinsol.h index b703100b53..5dd42d8ef3 100644 --- a/include/deal.II/sundials/kinsol.h +++ b/include/deal.II/sundials/kinsol.h @@ -267,17 +267,17 @@ namespace SUNDIALS const double & maximum_newton_step = 0.0, const double & dq_relative_error = 0.0, const unsigned int & maximum_beta_failures = 0, - const unsigned int & anderson_subspace_size = 0) : - strategy(strategy), - maximum_non_linear_iterations(maximum_non_linear_iterations), - function_tolerance(function_tolerance), - step_tolerance(step_tolerance), - no_init_setup(no_init_setup), - maximum_setup_calls(maximum_setup_calls), - maximum_newton_step(maximum_newton_step), - dq_relative_error(dq_relative_error), - maximum_beta_failures(maximum_beta_failures), - anderson_subspace_size(anderson_subspace_size) + const unsigned int & anderson_subspace_size = 0) + : strategy(strategy) + , maximum_non_linear_iterations(maximum_non_linear_iterations) + , function_tolerance(function_tolerance) + , step_tolerance(step_tolerance) + , no_init_setup(no_init_setup) + , maximum_setup_calls(maximum_setup_calls) + , maximum_newton_step(maximum_newton_step) + , dq_relative_error(dq_relative_error) + , maximum_beta_failures(maximum_beta_failures) + , anderson_subspace_size(anderson_subspace_size) {} /** @@ -322,11 +322,11 @@ namespace SUNDIALS add_parameters(ParameterHandler &prm) { static std::string strategy_str("newton"); - prm.add_parameter( - "Solution strategy", - strategy_str, - "Choose among newton|linesearch|fixed_point|picard", - Patterns::Selection("newton|linesearch|fixed_point|picard")); + prm.add_parameter("Solution strategy", + strategy_str, + "Choose among newton|linesearch|fixed_point|picard", + Patterns::Selection( + "newton|linesearch|fixed_point|picard")); prm.add_action("Solution strategy", [&](const std::string &value) { if (value == "newton") strategy = newton; diff --git a/source/algorithms/timestep_control.cc b/source/algorithms/timestep_control.cc index 20d7113cae..44e8f6661a 100644 --- a/source/algorithms/timestep_control.cc +++ b/source/algorithms/timestep_control.cc @@ -27,18 +27,18 @@ TimestepControl::TimestepControl(double start, double tolerance, double start_step, double print_step, - double max_step) : - start_val(start), - final_val(final), - tolerance_val(tolerance), - strategy_val(uniform), - start_step_val(start_step), - max_step_val(max_step), - min_step_val(0), - current_step_val(start_step), - step_val(start_step), - print_step(print_step), - next_print_val(print_step > 0. ? start_val + print_step : start_val - 1.) + double max_step) + : start_val(start) + , final_val(final) + , tolerance_val(tolerance) + , strategy_val(uniform) + , start_step_val(start_step) + , max_step_val(max_step) + , min_step_val(0) + , current_step_val(start_step) + , step_val(start_step) + , print_step(print_step) + , next_print_val(print_step > 0. ? start_val + print_step : start_val - 1.) { now_val = start_val; strcpy(format, "T.%06.3f"); @@ -58,8 +58,9 @@ TimestepControl::declare_parameters(ParameterHandler ¶m) param.declare_entry("Max step", "1.", Patterns::Double()); param.declare_entry("Tolerance", "1.e-2", Patterns::Double()); param.declare_entry("Print step", "-1.", Patterns::Double()); - param.declare_entry( - "Strategy", "uniform", Patterns::Selection("uniform|doubling")); + param.declare_entry("Strategy", + "uniform", + Patterns::Selection("uniform|doubling")); } diff --git a/source/base/auto_derivative_function.cc b/source/base/auto_derivative_function.cc index 76baae3015..8e8628a26d 100644 --- a/source/base/auto_derivative_function.cc +++ b/source/base/auto_derivative_function.cc @@ -26,11 +26,11 @@ template AutoDerivativeFunction::AutoDerivativeFunction( const double hh, const unsigned int n_components, - const double initial_time) : - Function(n_components, initial_time), - h(1), - ht(dim), - formula(Euler) + const double initial_time) + : Function(n_components, initial_time) + , h(1) + , ht(dim) + , formula(Euler) { set_h(hh); set_formula(); diff --git a/source/base/bounding_box.cc b/source/base/bounding_box.cc index 0aecd537f4..410d610d35 100644 --- a/source/base/bounding_box.cc +++ b/source/base/bounding_box.cc @@ -44,10 +44,12 @@ BoundingBox::merge_with( { for (unsigned int i = 0; i < spacedim; ++i) { - this->boundary_points.first[i] = std::min( - this->boundary_points.first[i], other_bbox.boundary_points.first[i]); - this->boundary_points.second[i] = std::max( - this->boundary_points.second[i], other_bbox.boundary_points.second[i]); + this->boundary_points.first[i] = + std::min(this->boundary_points.first[i], + other_bbox.boundary_points.first[i]); + this->boundary_points.second[i] = + std::max(this->boundary_points.second[i], + other_bbox.boundary_points.second[i]); } } diff --git a/source/base/conditional_ostream.cc b/source/base/conditional_ostream.cc index 1bbde98ab0..f39a423618 100644 --- a/source/base/conditional_ostream.cc +++ b/source/base/conditional_ostream.cc @@ -18,10 +18,9 @@ DEAL_II_NAMESPACE_OPEN -ConditionalOStream::ConditionalOStream(std::ostream &stream, - const bool active) : - output_stream(stream), - active_flag(active) +ConditionalOStream::ConditionalOStream(std::ostream &stream, const bool active) + : output_stream(stream) + , active_flag(active) {} diff --git a/source/base/convergence_table.cc b/source/base/convergence_table.cc index 0d57f0c8a7..b594bd4cb4 100644 --- a/source/base/convergence_table.cc +++ b/source/base/convergence_table.cc @@ -92,10 +92,10 @@ ConvergenceTable::evaluate_convergence_rates( } else { - add_value( - rate_key, - dim * std::log(std::fabs(values[i - 1] / values[i])) / - std::log(std::fabs(ref_values[i] / ref_values[i - 1]))); + add_value(rate_key, + dim * std::log(std::fabs(values[i - 1] / values[i])) / + std::log( + std::fabs(ref_values[i] / ref_values[i - 1]))); } } break; @@ -235,8 +235,9 @@ ConvergenceTable::evaluate_all_convergence_rates( col_iter != columns.end(); ++col_iter) if (!col_iter->second.flag) - evaluate_convergence_rates( - col_iter->first, reference_column_key, rate_mode); + evaluate_convergence_rates(col_iter->first, + reference_column_key, + rate_mode); } diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index 8f6d440772..34f8fb3731 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -448,11 +448,11 @@ namespace DataOutBase (n_data_sets + spacedim) : n_data_sets, patch->data.n_rows())); - Assert( - (n_data_sets == 0) || - (patch->data.n_cols() == - Utilities::fixed_power(n_subdivisions + 1)), - ExcInvalidDatasetSize(patch->data.n_cols(), n_subdivisions + 1)); + Assert((n_data_sets == 0) || + (patch->data.n_cols() == + Utilities::fixed_power(n_subdivisions + 1)), + ExcInvalidDatasetSize(patch->data.n_cols(), + n_subdivisions + 1)); for (unsigned int i = 0; i < patch->data.n_cols(); ++i, ++next_value) for (unsigned int data_set = 0; data_set < n_data_sets; ++data_set) @@ -466,18 +466,18 @@ namespace DataOutBase - DataOutFilter::DataOutFilter() : - flags(false, true), - node_dim(numbers::invalid_unsigned_int), - vertices_per_cell(numbers::invalid_unsigned_int) + DataOutFilter::DataOutFilter() + : flags(false, true) + , node_dim(numbers::invalid_unsigned_int) + , vertices_per_cell(numbers::invalid_unsigned_int) {} - DataOutFilter::DataOutFilter(const DataOutBase::DataOutFilterFlags &flags) : - flags(flags), - node_dim(numbers::invalid_unsigned_int), - vertices_per_cell(numbers::invalid_unsigned_int) + DataOutFilter::DataOutFilter(const DataOutBase::DataOutFilterFlags &flags) + : flags(flags) + , node_dim(numbers::invalid_unsigned_int) + , vertices_per_cell(numbers::invalid_unsigned_int) {} @@ -827,10 +827,10 @@ namespace /* * Constructor. Stores a reference to the output stream for immediate use. */ - StreamBase(std::ostream &stream, const FlagsType &flags) : - selected_component(numbers::invalid_unsigned_int), - stream(stream), - flags(flags) + StreamBase(std::ostream &stream, const FlagsType &flags) + : selected_component(numbers::invalid_unsigned_int) + , stream(stream) + , flags(flags) {} /** @@ -1193,8 +1193,8 @@ namespace //----------------------------------------------------------------------// - DXStream::DXStream(std::ostream &out, const DataOutBase::DXFlags &f) : - StreamBase(out, f) + DXStream::DXStream(std::ostream &out, const DataOutBase::DXFlags &f) + : StreamBase(out, f) {} @@ -1283,8 +1283,8 @@ namespace //----------------------------------------------------------------------// - GmvStream::GmvStream(std::ostream &out, const DataOutBase::GmvFlags &f) : - StreamBase(out, f) + GmvStream::GmvStream(std::ostream &out, const DataOutBase::GmvFlags &f) + : StreamBase(out, f) {} @@ -1332,8 +1332,8 @@ namespace TecplotStream::TecplotStream(std::ostream & out, - const DataOutBase::TecplotFlags &f) : - StreamBase(out, f) + const DataOutBase::TecplotFlags &f) + : StreamBase(out, f) {} @@ -1377,8 +1377,8 @@ namespace - UcdStream::UcdStream(std::ostream &out, const DataOutBase::UcdFlags &f) : - StreamBase(out, f) + UcdStream::UcdStream(std::ostream &out, const DataOutBase::UcdFlags &f) + : StreamBase(out, f) {} @@ -1454,8 +1454,8 @@ namespace //----------------------------------------------------------------------// - VtkStream::VtkStream(std::ostream &out, const DataOutBase::VtkFlags &f) : - StreamBase(out, f) + VtkStream::VtkStream(std::ostream &out, const DataOutBase::VtkFlags &f) + : StreamBase(out, f) {} @@ -1500,8 +1500,8 @@ namespace - VtuStream::VtuStream(std::ostream &out, const DataOutBase::VtkFlags &f) : - StreamBase(out, f) + VtuStream::VtuStream(std::ostream &out, const DataOutBase::VtkFlags &f) + : StreamBase(out, f) {} @@ -1635,10 +1635,10 @@ namespace DataOutBase template - Patch::Patch() : - patch_index(no_neighbor), - n_subdivisions(1), - points_are_available(false) + Patch::Patch() + : patch_index(no_neighbor) + , n_subdivisions(1) + , points_are_available(false) // all the other data has a constructor of its own, except for the // "neighbors" field, which we set to invalid values. { @@ -1736,9 +1736,9 @@ namespace DataOutBase unsigned int Patch<0, spacedim>::n_subdivisions = 1; template - Patch<0, spacedim>::Patch() : - patch_index(no_neighbor), - points_are_available(false) + Patch<0, spacedim>::Patch() + : patch_index(no_neighbor) + , points_are_available(false) { Assert(spacedim <= 3, ExcNotImplemented()); } @@ -1802,7 +1802,8 @@ namespace DataOutBase - UcdFlags::UcdFlags(const bool write_preamble) : write_preamble(write_preamble) + UcdFlags::UcdFlags(const bool write_preamble) + : write_preamble(write_preamble) {} @@ -1816,8 +1817,8 @@ namespace DataOutBase - GnuplotFlags::GnuplotFlags(const std::vector &labels) : - space_dimension_labels(labels) + GnuplotFlags::GnuplotFlags(const std::vector &labels) + : space_dimension_labels(labels) {} @@ -1832,17 +1833,17 @@ namespace DataOutBase PovrayFlags::PovrayFlags(const bool smooth, const bool bicubic_patch, - const bool external_data) : - smooth(smooth), - bicubic_patch(bicubic_patch), - external_data(external_data) + const bool external_data) + : smooth(smooth) + , bicubic_patch(bicubic_patch) + , external_data(external_data) {} DataOutFilterFlags::DataOutFilterFlags(const bool filter_duplicate_vertices, - const bool xdmf_hdf5_output) : - filter_duplicate_vertices(filter_duplicate_vertices), - xdmf_hdf5_output(xdmf_hdf5_output) + const bool xdmf_hdf5_output) + : filter_duplicate_vertices(filter_duplicate_vertices) + , xdmf_hdf5_output(xdmf_hdf5_output) {} @@ -1896,12 +1897,12 @@ namespace DataOutBase DXFlags::DXFlags(const bool write_neighbors, const bool int_binary, const bool coordinates_binary, - const bool data_binary) : - write_neighbors(write_neighbors), - int_binary(int_binary), - coordinates_binary(coordinates_binary), - data_binary(data_binary), - data_double(false) + const bool data_binary) + : write_neighbors(write_neighbors) + , int_binary(int_binary) + , coordinates_binary(coordinates_binary) + , data_binary(data_binary) + , data_double(false) {} @@ -1972,15 +1973,15 @@ namespace DataOutBase const int polar_angle, const unsigned int line_thickness, const bool margin, - const bool draw_colorbar) : - height(4000), - width(0), - height_vector(height_vector), - azimuth_angle(azimuth_angle), - polar_angle(polar_angle), - line_thickness(line_thickness), - margin(margin), - draw_colorbar(draw_colorbar) + const bool draw_colorbar) + : height(4000) + , width(0) + , height_vector(height_vector) + , azimuth_angle(azimuth_angle) + , polar_angle(polar_angle) + , line_thickness(line_thickness) + , margin(margin) + , draw_colorbar(draw_colorbar) {} @@ -2028,19 +2029,19 @@ namespace DataOutBase const bool draw_mesh, const bool draw_cells, const bool shade_cells, - const ColorFunction color_function) : - height_vector(height_vector), - color_vector(color_vector), - size_type(size_type), - size(size), - line_width(line_width), - azimut_angle(azimut_angle), - turn_angle(turn_angle), - z_scaling(z_scaling), - draw_mesh(draw_mesh), - draw_cells(draw_cells), - shade_cells(shade_cells), - color_function(color_function) + const ColorFunction color_function) + : height_vector(height_vector) + , color_vector(color_vector) + , size_type(size_type) + , size(size) + , line_width(line_width) + , azimut_angle(azimut_angle) + , turn_angle(turn_angle) + , z_scaling(z_scaling) + , draw_mesh(draw_mesh) + , draw_cells(draw_cells) + , shade_cells(shade_cells) + , color_function(color_function) {} @@ -2226,12 +2227,12 @@ namespace DataOutBase "true", Patterns::Bool(), "Whether the interior of cells shall be shaded"); - prm.declare_entry( - "Color function", - "default", - Patterns::Selection("default|grey scale|reverse grey scale"), - "Name of a color function used to colorize mesh lines " - "and/or cell interiors"); + prm.declare_entry("Color function", + "default", + Patterns::Selection( + "default|grey scale|reverse grey scale"), + "Name of a color function used to colorize mesh lines " + "and/or cell interiors"); } @@ -2271,10 +2272,10 @@ namespace DataOutBase TecplotFlags::TecplotFlags(const char * tecplot_binary_file_name, const char * zone_name, - const double solution_time) : - tecplot_binary_file_name(tecplot_binary_file_name), - zone_name(zone_name), - solution_time(solution_time) + const double solution_time) + : tecplot_binary_file_name(tecplot_binary_file_name) + , zone_name(zone_name) + , solution_time(solution_time) {} @@ -2292,11 +2293,11 @@ namespace DataOutBase VtkFlags::VtkFlags(const double time, const unsigned int cycle, const bool print_date_and_time, - const VtkFlags::ZlibCompressionLevel compression_level) : - time(time), - cycle(cycle), - print_date_and_time(print_date_and_time), - compression_level(compression_level) + const VtkFlags::ZlibCompressionLevel compression_level) + : time(time) + , cycle(cycle) + , print_date_and_time(print_date_and_time) + , compression_level(compression_level) {} @@ -3912,8 +3913,9 @@ namespace DataOutBase case 2: Assert((flags.height_vector < patch->data.n_rows()) || patch->data.n_rows() == 0, - ExcIndexRange( - flags.height_vector, 0, patch->data.n_rows())); + ExcIndexRange(flags.height_vector, + 0, + patch->data.n_rows())); heights[0] = patch->data.n_rows() != 0 ? patch->data(flags.height_vector, i1 * d1 + i2 * d2) * @@ -4016,10 +4018,11 @@ namespace DataOutBase if (flags.draw_cells && flags.shade_cells) { - Assert( - (flags.color_vector < patch->data.n_rows()) || - patch->data.n_rows() == 0, - ExcIndexRange(flags.color_vector, 0, patch->data.n_rows())); + Assert((flags.color_vector < patch->data.n_rows()) || + patch->data.n_rows() == 0, + ExcIndexRange(flags.color_vector, + 0, + patch->data.n_rows())); const double color_values[4] = { patch->data.n_rows() != 0 ? patch->data(flags.color_vector, i1 * d1 + i2 * d2) : @@ -4161,8 +4164,10 @@ namespace DataOutBase { if (flags.shade_cells) { - const EpsFlags::RgbValues rgb_values = (*flags.color_function)( - cell->color_value, min_color_value, max_color_value); + const EpsFlags::RgbValues rgb_values = + (*flags.color_function)(cell->color_value, + min_color_value, + max_color_value); // write out color if (rgb_values.is_grey()) @@ -4567,11 +4572,11 @@ namespace DataOutBase inline TecplotMacros::TecplotMacros(const unsigned int n_nodes, const unsigned int n_vars, const unsigned int n_cells, - const unsigned int n_vert) : - n_nodes(n_nodes), - n_vars(n_vars), - n_cells(n_cells), - n_vert(n_vert) + const unsigned int n_vert) + : n_nodes(n_nodes) + , n_vars(n_vars) + , n_cells(n_cells) + , n_vert(n_vert) { nodalData.resize(n_nodes * n_vars); connData.resize(n_cells * n_vert); @@ -5132,21 +5137,21 @@ namespace DataOutBase for (unsigned int n_th_vector = 0; n_th_vector < vector_data_ranges.size(); ++n_th_vector) { - AssertThrow( - std::get<1>(vector_data_ranges[n_th_vector]) >= - std::get<0>(vector_data_ranges[n_th_vector]), - ExcLowerRange(std::get<1>(vector_data_ranges[n_th_vector]), - std::get<0>(vector_data_ranges[n_th_vector]))); + AssertThrow(std::get<1>(vector_data_ranges[n_th_vector]) >= + std::get<0>(vector_data_ranges[n_th_vector]), + ExcLowerRange(std::get<1>(vector_data_ranges[n_th_vector]), + std::get<0>( + vector_data_ranges[n_th_vector]))); AssertThrow(std::get<1>(vector_data_ranges[n_th_vector]) < n_data_sets, ExcIndexRange(std::get<1>(vector_data_ranges[n_th_vector]), 0, n_data_sets)); - AssertThrow( - std::get<1>(vector_data_ranges[n_th_vector]) + 1 - - std::get<0>(vector_data_ranges[n_th_vector]) <= - 3, - ExcMessage("Can't declare a vector with more than 3 components " - "in VTK")); + AssertThrow(std::get<1>(vector_data_ranges[n_th_vector]) + 1 - + std::get<0>(vector_data_ranges[n_th_vector]) <= + 3, + ExcMessage( + "Can't declare a vector with more than 3 components " + "in VTK")); // mark these components as already written: for (unsigned int i = std::get<0>(vector_data_ranges[n_th_vector]); @@ -5565,21 +5570,21 @@ namespace DataOutBase for (unsigned int n_th_vector = 0; n_th_vector < vector_data_ranges.size(); ++n_th_vector) { - AssertThrow( - std::get<1>(vector_data_ranges[n_th_vector]) >= - std::get<0>(vector_data_ranges[n_th_vector]), - ExcLowerRange(std::get<1>(vector_data_ranges[n_th_vector]), - std::get<0>(vector_data_ranges[n_th_vector]))); + AssertThrow(std::get<1>(vector_data_ranges[n_th_vector]) >= + std::get<0>(vector_data_ranges[n_th_vector]), + ExcLowerRange(std::get<1>(vector_data_ranges[n_th_vector]), + std::get<0>( + vector_data_ranges[n_th_vector]))); AssertThrow(std::get<1>(vector_data_ranges[n_th_vector]) < n_data_sets, ExcIndexRange(std::get<1>(vector_data_ranges[n_th_vector]), 0, n_data_sets)); - AssertThrow( - std::get<1>(vector_data_ranges[n_th_vector]) + 1 - - std::get<0>(vector_data_ranges[n_th_vector]) <= - 3, - ExcMessage("Can't declare a vector with more than 3 components " - "in VTK")); + AssertThrow(std::get<1>(vector_data_ranges[n_th_vector]) + 1 - + std::get<0>(vector_data_ranges[n_th_vector]) <= + 3, + ExcMessage( + "Can't declare a vector with more than 3 components " + "in VTK")); // mark these components as already // written: @@ -5621,22 +5626,25 @@ namespace DataOutBase std::get<0>(vector_data_ranges[n_th_vector])) { case 0: - data.push_back(data_vectors( - std::get<0>(vector_data_ranges[n_th_vector]), n)); + data.push_back( + data_vectors(std::get<0>(vector_data_ranges[n_th_vector]), + n)); data.push_back(0); data.push_back(0); break; case 1: - data.push_back(data_vectors( - std::get<0>(vector_data_ranges[n_th_vector]), n)); + data.push_back( + data_vectors(std::get<0>(vector_data_ranges[n_th_vector]), + n)); data.push_back(data_vectors( std::get<0>(vector_data_ranges[n_th_vector]) + 1, n)); data.push_back(0); break; case 2: - data.push_back(data_vectors( - std::get<0>(vector_data_ranges[n_th_vector]), n)); + data.push_back( + data_vectors(std::get<0>(vector_data_ranges[n_th_vector]), + n)); data.push_back(data_vectors( std::get<0>(vector_data_ranges[n_th_vector]) + 1, n)); data.push_back(data_vectors( @@ -5716,21 +5724,21 @@ namespace DataOutBase for (unsigned int n_th_vector = 0; n_th_vector < vector_data_ranges.size(); ++n_th_vector) { - AssertThrow( - std::get<1>(vector_data_ranges[n_th_vector]) >= - std::get<0>(vector_data_ranges[n_th_vector]), - ExcLowerRange(std::get<1>(vector_data_ranges[n_th_vector]), - std::get<0>(vector_data_ranges[n_th_vector]))); + AssertThrow(std::get<1>(vector_data_ranges[n_th_vector]) >= + std::get<0>(vector_data_ranges[n_th_vector]), + ExcLowerRange(std::get<1>(vector_data_ranges[n_th_vector]), + std::get<0>( + vector_data_ranges[n_th_vector]))); AssertThrow(std::get<1>(vector_data_ranges[n_th_vector]) < n_data_sets, ExcIndexRange(std::get<1>(vector_data_ranges[n_th_vector]), 0, n_data_sets)); - AssertThrow( - std::get<1>(vector_data_ranges[n_th_vector]) + 1 - - std::get<0>(vector_data_ranges[n_th_vector]) <= - 3, - ExcMessage("Can't declare a vector with more than 3 components " - "in VTK")); + AssertThrow(std::get<1>(vector_data_ranges[n_th_vector]) + 1 - + std::get<0>(vector_data_ranges[n_th_vector]) <= + 3, + ExcMessage( + "Can't declare a vector with more than 3 components " + "in VTK")); // mark these components as already // written: @@ -6018,14 +6026,15 @@ namespace DataOutBase y_max = std::max(y_max, (double)projected_points[2][1]); y_max = std::max(y_max, (double)projected_points[3][1]); - Assert( - (flags.height_vector < patch->data.n_rows()) || - patch->data.n_rows() == 0, - ExcIndexRange(flags.height_vector, 0, patch->data.n_rows())); + Assert((flags.height_vector < patch->data.n_rows()) || + patch->data.n_rows() == 0, + ExcIndexRange(flags.height_vector, + 0, + patch->data.n_rows())); - z_min = std::min( - z_min, - (double)patch->data(flags.height_vector, i1 * d1 + i2 * d2)); + z_min = std::min(z_min, + (double)patch->data(flags.height_vector, + i1 * d1 + i2 * d2)); z_min = std::min(z_min, (double)patch->data(flags.height_vector, (i1 + 1) * d1 + i2 * d2)); @@ -6037,9 +6046,9 @@ namespace DataOutBase (double)patch->data(flags.height_vector, (i1 + 1) * d1 + (i2 + 1) * d2)); - z_max = std::max( - z_max, - (double)patch->data(flags.height_vector, i1 * d1 + i2 * d2)); + z_max = std::max(z_max, + (double)patch->data(flags.height_vector, + i1 * d1 + i2 * d2)); z_max = std::max(z_max, (double)patch->data(flags.height_vector, (i1 + 1) * d1 + i2 * d2)); @@ -6226,10 +6235,11 @@ namespace DataOutBase 0, n_subdivisions); - Assert( - (flags.height_vector < patch->data.n_rows()) || - patch->data.n_rows() == 0, - ExcIndexRange(flags.height_vector, 0, patch->data.n_rows())); + Assert((flags.height_vector < patch->data.n_rows()) || + patch->data.n_rows() == 0, + ExcIndexRange(flags.height_vector, + 0, + patch->data.n_rows())); vertices[0][0] = projected_vertices[0][0]; vertices[0][1] = projected_vertices[0][1]; @@ -6281,41 +6291,57 @@ namespace DataOutBase camera_horizontal, camera_focus); - x_min_perspective = std::min( - x_min_perspective, (double)projection_decompositions[0][0]); - x_min_perspective = std::min( - x_min_perspective, (double)projection_decompositions[1][0]); - x_min_perspective = std::min( - x_min_perspective, (double)projection_decompositions[2][0]); - x_min_perspective = std::min( - x_min_perspective, (double)projection_decompositions[3][0]); - - x_max_perspective = std::max( - x_max_perspective, (double)projection_decompositions[0][0]); - x_max_perspective = std::max( - x_max_perspective, (double)projection_decompositions[1][0]); - x_max_perspective = std::max( - x_max_perspective, (double)projection_decompositions[2][0]); - x_max_perspective = std::max( - x_max_perspective, (double)projection_decompositions[3][0]); - - y_min_perspective = std::min( - y_min_perspective, (double)projection_decompositions[0][1]); - y_min_perspective = std::min( - y_min_perspective, (double)projection_decompositions[1][1]); - y_min_perspective = std::min( - y_min_perspective, (double)projection_decompositions[2][1]); - y_min_perspective = std::min( - y_min_perspective, (double)projection_decompositions[3][1]); - - y_max_perspective = std::max( - y_max_perspective, (double)projection_decompositions[0][1]); - y_max_perspective = std::max( - y_max_perspective, (double)projection_decompositions[1][1]); - y_max_perspective = std::max( - y_max_perspective, (double)projection_decompositions[2][1]); - y_max_perspective = std::max( - y_max_perspective, (double)projection_decompositions[3][1]); + x_min_perspective = + std::min(x_min_perspective, + (double)projection_decompositions[0][0]); + x_min_perspective = + std::min(x_min_perspective, + (double)projection_decompositions[1][0]); + x_min_perspective = + std::min(x_min_perspective, + (double)projection_decompositions[2][0]); + x_min_perspective = + std::min(x_min_perspective, + (double)projection_decompositions[3][0]); + + x_max_perspective = + std::max(x_max_perspective, + (double)projection_decompositions[0][0]); + x_max_perspective = + std::max(x_max_perspective, + (double)projection_decompositions[1][0]); + x_max_perspective = + std::max(x_max_perspective, + (double)projection_decompositions[2][0]); + x_max_perspective = + std::max(x_max_perspective, + (double)projection_decompositions[3][0]); + + y_min_perspective = + std::min(y_min_perspective, + (double)projection_decompositions[0][1]); + y_min_perspective = + std::min(y_min_perspective, + (double)projection_decompositions[1][1]); + y_min_perspective = + std::min(y_min_perspective, + (double)projection_decompositions[2][1]); + y_min_perspective = + std::min(y_min_perspective, + (double)projection_decompositions[3][1]); + + y_max_perspective = + std::max(y_max_perspective, + (double)projection_decompositions[0][1]); + y_max_perspective = + std::max(y_max_perspective, + (double)projection_decompositions[1][1]); + y_max_perspective = + std::max(y_max_perspective, + (double)projection_decompositions[2][1]); + y_max_perspective = + std::max(y_max_perspective, + (double)projection_decompositions[3][1]); } } } @@ -6358,10 +6384,11 @@ namespace DataOutBase 0, n_subdivisions); - Assert( - (flags.height_vector < patch->data.n_rows()) || - patch->data.n_rows() == 0, - ExcIndexRange(flags.height_vector, 0, patch->data.n_rows())); + Assert((flags.height_vector < patch->data.n_rows()) || + patch->data.n_rows() == 0, + ExcIndexRange(flags.height_vector, + 0, + patch->data.n_rows())); cell.vertices[0][0] = projected_vertices[0][0]; cell.vertices[0][1] = projected_vertices[0][1]; @@ -6957,9 +6984,9 @@ namespace DataOutBase template -DataOutInterface::DataOutInterface() : - default_subdivisions(1), - default_fmt(DataOutBase::default_format) +DataOutInterface::DataOutInterface() + : default_subdivisions(1) + , default_fmt(DataOutBase::default_format) {} @@ -7201,8 +7228,10 @@ DataOutInterface::write_pvtu_record( std::ostream & out, const std::vector &piece_names) const { - DataOutBase::write_pvtu_record( - out, piece_names, get_dataset_names(), get_vector_data_ranges()); + DataOutBase::write_pvtu_record(out, + piece_names, + get_dataset_names(), + get_vector_data_ranges()); } @@ -7444,8 +7473,9 @@ DataOutBase::write_filtered_data( std::get<0>(vector_data_ranges[n_th_vector]))); AssertThrow( std::get<1>(vector_data_ranges[n_th_vector]) < n_data_sets, - ExcIndexRange( - std::get<1>(vector_data_ranges[n_th_vector]), 0, n_data_sets)); + ExcIndexRange(std::get<1>(vector_data_ranges[n_th_vector]), + 0, + n_data_sets)); // Determine the vector name // Concatenate all the @@ -7475,8 +7505,10 @@ DataOutBase::write_filtered_data( } // Write data to the filter object - filtered_data.write_data_set( - vector_name, pt_data_vector_dim, data_set, data_vectors); + filtered_data.write_data_set(vector_name, + pt_data_vector_dim, + data_set, + data_vectors); // Advance the current data set data_set += pt_data_vector_dim; @@ -7648,8 +7680,10 @@ DataOutBase::write_hdf5_parallel( if (write_mesh_file) { // Overwrite any existing files (change this to an option?) - h5_mesh_file_id = H5Fcreate( - mesh_filename.c_str(), H5F_ACC_TRUNC, H5P_DEFAULT, file_plist_id); + h5_mesh_file_id = H5Fcreate(mesh_filename.c_str(), + H5F_ACC_TRUNC, + H5P_DEFAULT, + file_plist_id); AssertThrow(h5_mesh_file_id >= 0, ExcIO()); // Create the dataspace for the nodes and cells @@ -7789,8 +7823,10 @@ DataOutBase::write_hdf5_parallel( else { // Otherwise we need to open a new file - h5_solution_file_id = H5Fcreate( - solution_filename.c_str(), H5F_ACC_TRUNC, H5P_DEFAULT, file_plist_id); + h5_solution_file_id = H5Fcreate(solution_filename.c_str(), + H5F_ACC_TRUNC, + H5P_DEFAULT, + file_plist_id); AssertThrow(h5_solution_file_id >= 0, ExcIO()); } @@ -8163,11 +8199,11 @@ DataOutInterface::validate_dataset_names() const const std::string &name = std::get<2>(ranges[n_th_vector]); if (name != "") { - Assert( - all_names.find(name) == all_names.end(), - ExcMessage("Error: names of fields in DataOut need to be unique, " - "but '" + - name + "' is used more than once.")); + Assert(all_names.find(name) == all_names.end(), + ExcMessage( + "Error: names of fields in DataOut need to be unique, " + "but '" + + name + "' is used more than once.")); all_names.insert(name); for (unsigned int i = std::get<0>(ranges[n_th_vector]); i <= std::get<1>(ranges[n_th_vector]); @@ -8180,11 +8216,11 @@ DataOutInterface::validate_dataset_names() const if (data_set_written[data_set] == false) { const std::string &name = data_names[data_set]; - Assert( - all_names.find(name) == all_names.end(), - ExcMessage("Error: names of fields in DataOut need to be unique, " - "but '" + - name + "' is used more than once.")); + Assert(all_names.find(name) == all_names.end(), + ExcMessage( + "Error: names of fields in DataOut need to be unique, " + "but '" + + name + "' is used more than once.")); all_names.insert(name); } } @@ -8263,11 +8299,11 @@ DataOutReader::read(std::istream &in) s << "[Version: " << dealii::DataOutBase::Deal_II_IntermediateFlags::format_version << "]"; - Assert( - header == s.str(), - ExcMessage("Invalid or incompatible file format. Intermediate format " - "files can only be read by the same deal.II version as they " - "are written by.")); + Assert(header == s.str(), + ExcMessage( + "Invalid or incompatible file format. Intermediate format " + "files can only be read by the same deal.II version as they " + "are written by.")); } // then read the rest of the data @@ -8405,15 +8441,15 @@ DataOutReader::get_vector_data_ranges() const // ---------------------------------------------- XDMFEntry ---------- -XDMFEntry::XDMFEntry() : - valid(false), - h5_sol_filename(""), - h5_mesh_filename(""), - entry_time(0.0), - num_nodes(numbers::invalid_unsigned_int), - num_cells(numbers::invalid_unsigned_int), - dimension(numbers::invalid_unsigned_int), - space_dimension(numbers::invalid_unsigned_int) +XDMFEntry::XDMFEntry() + : valid(false) + , h5_sol_filename("") + , h5_mesh_filename("") + , entry_time(0.0) + , num_nodes(numbers::invalid_unsigned_int) + , num_cells(numbers::invalid_unsigned_int) + , dimension(numbers::invalid_unsigned_int) + , space_dimension(numbers::invalid_unsigned_int) {} @@ -8422,8 +8458,8 @@ XDMFEntry::XDMFEntry(const std::string &filename, const double time, const unsigned int nodes, const unsigned int cells, - const unsigned int dim) : - XDMFEntry(filename, filename, time, nodes, cells, dim, dim) + const unsigned int dim) + : XDMFEntry(filename, filename, time, nodes, cells, dim, dim) {} @@ -8433,8 +8469,8 @@ XDMFEntry::XDMFEntry(const std::string &mesh_filename, const double time, const unsigned int nodes, const unsigned int cells, - const unsigned int dim) : - XDMFEntry(mesh_filename, solution_filename, time, nodes, cells, dim, dim) + const unsigned int dim) + : XDMFEntry(mesh_filename, solution_filename, time, nodes, cells, dim, dim) {} @@ -8445,15 +8481,15 @@ XDMFEntry::XDMFEntry(const std::string &mesh_filename, const unsigned int nodes, const unsigned int cells, const unsigned int dim, - const unsigned int spacedim) : - valid(true), - h5_sol_filename(solution_filename), - h5_mesh_filename(mesh_filename), - entry_time(time), - num_nodes(nodes), - num_cells(cells), - dimension(dim), - space_dimension(spacedim) + const unsigned int spacedim) + : valid(true) + , h5_sol_filename(solution_filename) + , h5_mesh_filename(mesh_filename) + , entry_time(time) + , num_nodes(nodes) + , num_cells(cells) + , dimension(dim) + , space_dimension(spacedim) {} diff --git a/source/base/event.cc b/source/base/event.cc index efd0663ef0..6187f4b5d0 100644 --- a/source/base/event.cc +++ b/source/base/event.cc @@ -40,7 +40,9 @@ namespace Algorithms } - Event::Event() : all_true(false), flags(names.size(), false) + Event::Event() + : all_true(false) + , flags(names.size(), false) {} diff --git a/source/base/exceptions.cc b/source/base/exceptions.cc index 69b2e5d2c7..5f869b9153 100644 --- a/source/base/exceptions.cc +++ b/source/base/exceptions.cc @@ -69,15 +69,15 @@ namespace deal_II_exceptions -ExceptionBase::ExceptionBase() : - file(""), - line(0), - function(""), - cond(""), - exc(""), - stacktrace(nullptr), - n_stacktrace_frames(0), - what_str("") +ExceptionBase::ExceptionBase() + : file("") + , line(0) + , function("") + , cond("") + , exc("") + , stacktrace(nullptr) + , n_stacktrace_frames(0) + , what_str("") { #ifdef DEAL_II_HAVE_GLIBC_STACKTRACE for (unsigned int i = 0; @@ -89,17 +89,17 @@ ExceptionBase::ExceptionBase() : -ExceptionBase::ExceptionBase(const ExceptionBase &exc) : - file(exc.file), - line(exc.line), - function(exc.function), - cond(exc.cond), - exc(exc.exc), - stacktrace( - nullptr), // don't copy stacktrace to avoid double de-allocation problem - n_stacktrace_frames(0), - what_str( - "") // don't copy the error message, it gets generated dynamically by what() +ExceptionBase::ExceptionBase(const ExceptionBase &exc) + : file(exc.file) + , line(exc.line) + , function(exc.function) + , cond(exc.cond) + , exc(exc.exc) + , stacktrace(nullptr) + , // don't copy stacktrace to avoid double de-allocation problem + n_stacktrace_frames(0) + , what_str("") // don't copy the error message, it gets generated dynamically + // by what() { #ifdef DEAL_II_HAVE_GLIBC_STACKTRACE for (unsigned int i = 0; @@ -347,7 +347,8 @@ ExceptionBase::generate_message() const #ifdef DEAL_II_WITH_MPI namespace StandardExceptions { - ExcMPI::ExcMPI(const int error_code) : error_code(error_code) + ExcMPI::ExcMPI(const int error_code) + : error_code(error_code) {} void diff --git a/source/base/flow_function.cc b/source/base/flow_function.cc index dbef91fb8c..6d3f527fff 100644 --- a/source/base/flow_function.cc +++ b/source/base/flow_function.cc @@ -28,11 +28,11 @@ DEAL_II_NAMESPACE_OPEN namespace Functions { template - FlowFunction::FlowFunction() : - Function(dim + 1), - mean_pressure(0), - aux_values(dim + 1), - aux_gradients(dim + 1) + FlowFunction::FlowFunction() + : Function(dim + 1) + , mean_pressure(0) + , aux_values(dim + 1) + , aux_gradients(dim + 1) {} @@ -188,9 +188,9 @@ namespace Functions //----------------------------------------------------------------------// template - PoisseuilleFlow::PoisseuilleFlow(const double r, const double Re) : - radius(r), - Reynolds(Re) + PoisseuilleFlow::PoisseuilleFlow(const double r, const double Re) + : radius(r) + , Reynolds(Re) { Assert(Reynolds != 0., ExcMessage("Reynolds number cannot be zero")); } @@ -289,9 +289,9 @@ namespace Functions //----------------------------------------------------------------------// template - StokesCosine::StokesCosine(const double nu, const double r) : - viscosity(nu), - reaction(r) + StokesCosine::StokesCosine(const double nu, const double r) + : viscosity(nu) + , reaction(r) {} @@ -495,11 +495,11 @@ namespace Functions const double StokesLSingularity::lambda = 0.54448373678246; - StokesLSingularity::StokesLSingularity() : - omega(3. / 2. * numbers::PI), - coslo(cos(lambda * omega)), - lp(1. + lambda), - lm(1. - lambda) + StokesLSingularity::StokesLSingularity() + : omega(3. / 2. * numbers::PI) + , coslo(cos(lambda * omega)) + , lp(1. + lambda) + , lm(1. - lambda) {} @@ -664,7 +664,9 @@ namespace Functions //----------------------------------------------------------------------// - Kovasznay::Kovasznay(double Re, bool stokes) : Reynolds(Re), stokes(stokes) + Kovasznay::Kovasznay(double Re, bool stokes) + : Reynolds(Re) + , stokes(stokes) { long double r2 = Reynolds / 2.; long double b = 4 * numbers::PI * numbers::PI; diff --git a/source/base/function_cspline.cc b/source/base/function_cspline.cc index affbc69974..46a26c4b80 100644 --- a/source/base/function_cspline.cc +++ b/source/base/function_cspline.cc @@ -25,9 +25,9 @@ namespace Functions { template CSpline::CSpline(const std::vector &x_, - const std::vector &y_) : - interpolation_points(x_), - interpolation_values(y_) + const std::vector &y_) + : interpolation_points(x_) + , interpolation_values(y_) { Assert(interpolation_points.size() > 0, ExcCSplineEmpty(interpolation_points.size())); @@ -39,15 +39,18 @@ namespace Functions // check that input vector @p interpolation_points is provided in ascending order: for (unsigned int i = 0; i < interpolation_points.size() - 1; i++) AssertThrow(interpolation_points[i] < interpolation_points[i + 1], - ExcCSplineOrder( - i, interpolation_points[i], interpolation_points[i + 1])); + ExcCSplineOrder(i, + interpolation_points[i], + interpolation_points[i + 1])); acc = gsl_interp_accel_alloc(); const unsigned int n = interpolation_points.size(); cspline = gsl_spline_alloc(gsl_interp_cspline, n); // gsl_spline_init returns something but it seems nobody knows what - gsl_spline_init( - cspline, interpolation_points.data(), interpolation_values.data(), n); + gsl_spline_init(cspline, + interpolation_points.data(), + interpolation_values.data(), + n); } @@ -75,8 +78,9 @@ namespace Functions const double &x = p[0]; Assert(x >= interpolation_points.front() && x <= interpolation_points.back(), - ExcCSplineRange( - x, interpolation_points.front(), interpolation_points.back())); + ExcCSplineRange(x, + interpolation_points.front(), + interpolation_points.back())); return gsl_spline_eval(cspline, x, acc); } @@ -95,8 +99,9 @@ namespace Functions const double &x = p[0]; Assert(x >= interpolation_points.front() && x <= interpolation_points.back(), - ExcCSplineRange( - x, interpolation_points.front(), interpolation_points.back())); + ExcCSplineRange(x, + interpolation_points.front(), + interpolation_points.back())); const double deriv = gsl_spline_eval_deriv(cspline, x, acc); Tensor<1, dim> res; @@ -118,8 +123,9 @@ namespace Functions const double &x = p[0]; Assert(x >= interpolation_points.front() && x <= interpolation_points.back(), - ExcCSplineRange( - x, interpolation_points.front(), interpolation_points.back())); + ExcCSplineRange(x, + interpolation_points.front(), + interpolation_points.back())); return gsl_spline_eval_deriv2(cspline, x, acc); } diff --git a/source/base/function_derivative.cc b/source/base/function_derivative.cc index 9c3605bd3d..e8abc4ddf6 100644 --- a/source/base/function_derivative.cc +++ b/source/base/function_derivative.cc @@ -25,11 +25,11 @@ DEAL_II_NAMESPACE_OPEN template FunctionDerivative::FunctionDerivative(const Function &f, const Point & dir, - const double h) : - AutoDerivativeFunction(h, f.n_components, f.get_time()), - f(f), - h(h), - incr(1, h * dir) + const double h) + : AutoDerivativeFunction(h, f.n_components, f.get_time()) + , f(f) + , h(h) + , incr(1, h * dir) { set_formula(); } @@ -39,11 +39,11 @@ FunctionDerivative::FunctionDerivative(const Function &f, template FunctionDerivative::FunctionDerivative(const Function & f, const std::vector> &dir, - const double h) : - AutoDerivativeFunction(h, f.n_components, f.get_time()), - f(f), - h(h), - incr(dir.size()) + const double h) + : AutoDerivativeFunction(h, f.n_components, f.get_time()) + , f(f) + , h(h) + , incr(dir.size()) { for (unsigned int i = 0; i < incr.size(); ++i) incr[i] = h * dir[i]; diff --git a/source/base/function_lib.cc b/source/base/function_lib.cc index fa4c2b47b9..02e6d62155 100644 --- a/source/base/function_lib.cc +++ b/source/base/function_lib.cc @@ -250,7 +250,8 @@ namespace Functions template - PillowFunction::PillowFunction(const double offset) : offset(offset) + PillowFunction::PillowFunction(const double offset) + : offset(offset) {} @@ -420,8 +421,8 @@ namespace Functions ////////////////////////////////////////////////////////////////////// template - CosineFunction::CosineFunction(const unsigned int n_components) : - Function(n_components) + CosineFunction::CosineFunction(const unsigned int n_components) + : Function(n_components) {} @@ -714,7 +715,8 @@ namespace Functions ////////////////////////////////////////////////////////////////////// template - CosineGradFunction::CosineGradFunction() : Function(dim) + CosineGradFunction::CosineGradFunction() + : Function(dim) {} @@ -1336,7 +1338,8 @@ namespace Functions ////////////////////////////////////////////////////////////////////// - LSingularityGradFunction::LSingularityGradFunction() : Function<2>(2) + LSingularityGradFunction::LSingularityGradFunction() + : Function<2>(2) {} @@ -1793,9 +1796,9 @@ namespace Functions template JumpFunction::JumpFunction(const Point &direction, - const double steepness) : - direction(direction), - steepness(steepness) + const double steepness) + : direction(direction) + , steepness(steepness) { switch (dim) { @@ -1922,9 +1925,9 @@ namespace Functions template FourierCosineFunction::FourierCosineFunction( - const Tensor<1, dim> &fourier_coefficients) : - Function(1), - fourier_coefficients(fourier_coefficients) + const Tensor<1, dim> &fourier_coefficients) + : Function(1) + , fourier_coefficients(fourier_coefficients) {} @@ -1972,9 +1975,9 @@ namespace Functions template FourierSineFunction::FourierSineFunction( - const Tensor<1, dim> &fourier_coefficients) : - Function(1), - fourier_coefficients(fourier_coefficients) + const Tensor<1, dim> &fourier_coefficients) + : Function(1) + , fourier_coefficients(fourier_coefficients) {} @@ -2023,10 +2026,10 @@ namespace Functions template FourierSineSum::FourierSineSum( const std::vector> &fourier_coefficients, - const std::vector & weights) : - Function(1), - fourier_coefficients(fourier_coefficients), - weights(weights) + const std::vector & weights) + : Function(1) + , fourier_coefficients(fourier_coefficients) + , weights(weights) { Assert(fourier_coefficients.size() > 0, ExcZero()); Assert(fourier_coefficients.size() == weights.size(), @@ -2097,10 +2100,10 @@ namespace Functions template FourierCosineSum::FourierCosineSum( const std::vector> &fourier_coefficients, - const std::vector & weights) : - Function(1), - fourier_coefficients(fourier_coefficients), - weights(weights) + const std::vector & weights) + : Function(1) + , fourier_coefficients(fourier_coefficients) + , weights(weights) { Assert(fourier_coefficients.size() > 0, ExcZero()); Assert(fourier_coefficients.size() == weights.size(), @@ -2170,9 +2173,9 @@ namespace Functions template Monomial::Monomial(const Tensor<1, dim> &exponents, - const unsigned int n_components) : - Function(n_components), - exponents(exponents) + const unsigned int n_components) + : Function(n_components) + , exponents(exponents) {} @@ -2234,10 +2237,10 @@ namespace Functions else { if (p[s] < 0) - Assert( - std::floor(exponents[s]) == exponents[s], - ExcMessage("Exponentiation of a negative base number with " - "a real exponent can't be performed.")); + Assert(std::floor(exponents[s]) == exponents[s], + ExcMessage( + "Exponentiation of a negative base number with " + "a real exponent can't be performed.")); prod *= (s == d ? exponents[s] * std::pow(p[s], exponents[s] - 1) : std::pow(p[s], exponents[s])); @@ -2268,10 +2271,10 @@ namespace Functions template Bessel1::Bessel1(const unsigned int order, const double wave_number, - const Point center) : - order(order), - wave_number(wave_number), - center(center) + const Point center) + : order(order) + , wave_number(wave_number) + , center(center) {} template @@ -2496,9 +2499,9 @@ namespace Functions template InterpolatedTensorProductGridData::InterpolatedTensorProductGridData( const std::array, dim> &coordinate_values, - const Table & data_values) : - coordinate_values(coordinate_values), - data_values(data_values) + const Table & data_values) + : coordinate_values(coordinate_values) + , data_values(data_values) { for (unsigned int d = 0; d < dim; ++d) { @@ -2512,9 +2515,9 @@ namespace Functions ExcMessage( "Coordinate arrays must be sorted in strictly ascending order.")); - Assert( - data_values.size()[d] == coordinate_values[d].size(), - ExcMessage("Data and coordinate tables do not have the same size.")); + Assert(data_values.size()[d] == coordinate_values[d].size(), + ExcMessage( + "Data and coordinate tables do not have the same size.")); } } @@ -2534,10 +2537,10 @@ namespace Functions { // get the index of the first element of the coordinate arrays that is // larger than p[d] - ix[d] = - (std::lower_bound( - coordinate_values[d].begin(), coordinate_values[d].end(), p[d]) - - coordinate_values[d].begin()); + ix[d] = (std::lower_bound(coordinate_values[d].begin(), + coordinate_values[d].end(), + p[d]) - + coordinate_values[d].begin()); // the one we want is the index of the coordinate to the left, however, // so decrease it by one (unless we have a point to the left of all, in @@ -2609,8 +2612,9 @@ namespace Functions Point p_unit; for (unsigned int d = 0; d < dim; ++d) - p_unit[d] = std::max( - std::min((p[d] - coordinate_values[d][ix[d]]) / dx[d], 1.), 0.0); + p_unit[d] = + std::max(std::min((p[d] - coordinate_values[d][ix[d]]) / dx[d], 1.), + 0.0); return gradient_interpolate(data_values, ix, p_unit, dx); } @@ -2621,10 +2625,10 @@ namespace Functions InterpolatedUniformGridData::InterpolatedUniformGridData( const std::array, dim> &interval_endpoints, const std::array & n_subintervals, - const Table & data_values) : - interval_endpoints(interval_endpoints), - n_subintervals(n_subintervals), - data_values(data_values) + const Table & data_values) + : interval_endpoints(interval_endpoints) + , n_subintervals(n_subintervals) + , data_values(data_values) { for (unsigned int d = 0; d < dim; ++d) { @@ -2677,11 +2681,11 @@ namespace Functions const double delta_x = ((interval_endpoints[d].second - interval_endpoints[d].first) / n_subintervals[d]); - p_unit[d] = std::max( - std::min((p[d] - interval_endpoints[d].first - ix[d] * delta_x) / - delta_x, - 1.), - 0.); + p_unit[d] = std::max(std::min((p[d] - interval_endpoints[d].first - + ix[d] * delta_x) / + delta_x, + 1.), + 0.); } return interpolate(data_values, ix, p_unit); @@ -2693,10 +2697,10 @@ namespace Functions template Polynomial::Polynomial(const Table<2, double> & exponents, - const std::vector &coefficients) : - Function(1), - exponents(exponents), - coefficients(coefficients) + const std::vector &coefficients) + : Function(1) + , exponents(exponents) + , coefficients(coefficients) { Assert(exponents.n_rows() == coefficients.size(), ExcDimensionMismatch(exponents.n_rows(), coefficients.size())); diff --git a/source/base/function_lib_cutoff.cc b/source/base/function_lib_cutoff.cc index d4cacab11f..e945f8683a 100644 --- a/source/base/function_lib_cutoff.cc +++ b/source/base/function_lib_cutoff.cc @@ -30,11 +30,11 @@ namespace Functions CutOffFunctionBase::CutOffFunctionBase(const double r, const Point p, const unsigned int n_components, - const unsigned int select) : - Function(n_components), - center(p), - radius(r), - selected(select) + const unsigned int select) + : Function(n_components) + , center(p) + , radius(r) + , selected(select) {} @@ -60,8 +60,8 @@ namespace Functions const double r, const Point p, const unsigned int n_components, - const unsigned int select) : - CutOffFunctionBase(r, p, n_components, select) + const unsigned int select) + : CutOffFunctionBase(r, p, n_components, select) {} @@ -126,8 +126,8 @@ namespace Functions CutOffFunctionW1::CutOffFunctionW1(const double r, const Point p, const unsigned int n_components, - const unsigned int select) : - CutOffFunctionBase(r, p, n_components, select) + const unsigned int select) + : CutOffFunctionBase(r, p, n_components, select) {} @@ -197,8 +197,8 @@ namespace Functions const double r, const Point p, const unsigned int n_components, - const unsigned int select) : - CutOffFunctionBase(r, p, n_components, select) + const unsigned int select) + : CutOffFunctionBase(r, p, n_components, select) {} diff --git a/source/base/function_parser.cc b/source/base/function_parser.cc index cf143b97ab..3b96b8a5cd 100644 --- a/source/base/function_parser.cc +++ b/source/base/function_parser.cc @@ -46,10 +46,10 @@ DEAL_II_NAMESPACE_OPEN template FunctionParser::FunctionParser(const unsigned int n_components, const double initial_time, - const double h) : - AutoDerivativeFunction(h, n_components, initial_time), - initialized(false), - n_vars(0) + const double h) + : AutoDerivativeFunction(h, n_components, initial_time) + , initialized(false) + , n_vars(0) {} diff --git a/source/base/function_spherical.cc b/source/base/function_spherical.cc index 23d8ce0612..78c3ed62c2 100644 --- a/source/base/function_spherical.cc +++ b/source/base/function_spherical.cc @@ -154,9 +154,9 @@ namespace Functions template Spherical::Spherical(const Point & p, - const unsigned int n_components) : - Function(n_components), - coordinate_system_offset(p) + const unsigned int n_components) + : Function(n_components) + , coordinate_system_offset(p) { AssertThrow(dim == 3, ExcNotImplemented()); } diff --git a/source/base/index_set.cc b/source/base/index_set.cc index c37c65ecc9..9b5fa12d27 100644 --- a/source/base/index_set.cc +++ b/source/base/index_set.cc @@ -38,10 +38,10 @@ DEAL_II_NAMESPACE_OPEN # ifdef DEAL_II_WITH_64BIT_INDICES -IndexSet::IndexSet(const Epetra_Map &map) : - is_compressed(true), - index_space_size(1 + map.MaxAllGID64()), - largest_range(numbers::invalid_unsigned_int) +IndexSet::IndexSet(const Epetra_Map &map) + : is_compressed(true) + , index_space_size(1 + map.MaxAllGID64()) + , largest_range(numbers::invalid_unsigned_int) { Assert(map.MinAllGID64() == 0, ExcMessage("The Epetra_Map does not contain the global index 0, which " @@ -64,10 +64,10 @@ IndexSet::IndexSet(const Epetra_Map &map) : // this is the standard 32-bit implementation -IndexSet::IndexSet(const Epetra_Map &map) : - is_compressed(true), - index_space_size(1 + map.MaxAllGID()), - largest_range(numbers::invalid_unsigned_int) +IndexSet::IndexSet(const Epetra_Map &map) + : is_compressed(true) + , index_space_size(1 + map.MaxAllGID()) + , largest_range(numbers::invalid_unsigned_int) { Assert(map.MinAllGID() == 0, ExcMessage("The Epetra_Map does not contain the global index 0, which " @@ -111,9 +111,10 @@ IndexSet::add_range(const size_type begin, const size_type end) if (ranges.size() == 0 || begin > ranges.back().end) ranges.push_back(new_range); else - ranges.insert( - Utilities::lower_bound(ranges.begin(), ranges.end(), new_range), - new_range); + ranges.insert(Utilities::lower_bound(ranges.begin(), + ranges.end(), + new_range), + new_range); is_compressed = false; } } @@ -380,8 +381,9 @@ IndexSet::add_indices(const IndexSet &other, const unsigned int offset) Assert(other.ranges.size() == 0 || other.ranges.back().end - 1 < index_space_size, - ExcIndexRangeType( - other.ranges.back().end - 1, 0, index_space_size)); + ExcIndexRangeType(other.ranges.back().end - 1, + 0, + index_space_size)); compress(); other.compress(); diff --git a/source/base/logstream.cc b/source/base/logstream.cc index e10858c292..941dcc0a87 100644 --- a/source/base/logstream.cc +++ b/source/base/logstream.cc @@ -37,14 +37,16 @@ LogStream deallog; -LogStream::Prefix::Prefix(const std::string &text) : stream(&deallog) +LogStream::Prefix::Prefix(const std::string &text) + : stream(&deallog) { stream->push(text); } -LogStream::Prefix::Prefix(const std::string &text, LogStream &s) : stream(&s) +LogStream::Prefix::Prefix(const std::string &text, LogStream &s) + : stream(&s) { stream->push(text); } @@ -61,21 +63,21 @@ LogStream::Prefix::~Prefix() } catch (...) { - AssertNothrow( - false, - ExcMessage("An exception occurred in LogStream::Prefix::~Prefix.")); + AssertNothrow(false, + ExcMessage( + "An exception occurred in LogStream::Prefix::~Prefix.")); } } -LogStream::LogStream() : - std_out(&std::cout), - file(nullptr), - std_depth(0), - file_depth(10000), - print_thread_id(false), - at_newline(true) +LogStream::LogStream() + : std_out(&std::cout) + , file(nullptr) + , std_depth(0) + , file_depth(10000) + , print_thread_id(false) + , at_newline(true) { get_prefixes().push("DEAL:"); } @@ -149,7 +151,9 @@ LogStream::operator<<(std::ostream &(*p)(std::ostream &)) // Implement a minimalistic stream buffer that only stores the fact // whether overflow or sync was called public: - QueryStreambuf() : flushed_(false), newline_written_(false) + QueryStreambuf() + : flushed_(false) + , newline_written_(false) {} bool flushed() diff --git a/source/base/mpi.cc b/source/base/mpi.cc index ec3ed8a8a9..707a19fa8c 100644 --- a/source/base/mpi.cc +++ b/source/base/mpi.cc @@ -192,9 +192,9 @@ namespace Utilities { Assert(destinations[i] < n_procs, ExcIndexRange(destinations[i], 0, n_procs)); - Assert( - destinations[i] != myid, - ExcMessage("There is no point in communicating with ourselves.")); + Assert(destinations[i] != myid, + ExcMessage( + "There is no point in communicating with ourselves.")); } @@ -212,8 +212,9 @@ namespace Utilities // in there, padded with -1's std::vector my_destinations(max_n_destinations, numbers::invalid_unsigned_int); - std::copy( - destinations.begin(), destinations.end(), my_destinations.begin()); + std::copy(destinations.begin(), + destinations.end(), + my_destinations.begin()); // now exchange these (we could communicate less data if we used // MPI_Allgatherv, but we'd have to communicate my_n_destinations to all diff --git a/source/base/mpi.inst.in b/source/base/mpi.inst.in index e0bfc3d3fe..efa5a49a34 100644 --- a/source/base/mpi.inst.in +++ b/source/base/mpi.inst.in @@ -16,38 +16,46 @@ for (S : REAL_SCALARS) { - template void sum( - const SparseMatrix &, const MPI_Comm &, SparseMatrix &); + template void sum(const SparseMatrix &, + const MPI_Comm &, + SparseMatrix &); } for (S : MPI_SCALARS) { - template void sum>( - const LAPACKFullMatrix &, const MPI_Comm &, LAPACKFullMatrix &); + template void sum>(const LAPACKFullMatrix &, + const MPI_Comm &, + LAPACKFullMatrix &); - template void sum>( - const Vector &, const MPI_Comm &, Vector &); + template void sum>(const Vector &, + const MPI_Comm &, + Vector &); - template void sum>( - const FullMatrix &, const MPI_Comm &, FullMatrix &); + template void sum>(const FullMatrix &, + const MPI_Comm &, + FullMatrix &); - template void sum( - const ArrayView &, const MPI_Comm &, const ArrayView &); + template void sum(const ArrayView &, + const MPI_Comm &, + const ArrayView &); template S sum(const S &, const MPI_Comm &); - template void sum>( - const std::vector &, const MPI_Comm &, std::vector &); + template void sum>(const std::vector &, + const MPI_Comm &, + std::vector &); template S max(const S &, const MPI_Comm &); - template void max>( - const std::vector &, const MPI_Comm &, std::vector &); + template void max>(const std::vector &, + const MPI_Comm &, + std::vector &); template S min(const S &, const MPI_Comm &); - template void min>( - const std::vector &, const MPI_Comm &, std::vector &); + template void min>(const std::vector &, + const MPI_Comm &, + std::vector &); // The fixed-length array (i.e., things declared like T(&values)[N]) // versions of the functions above live in the header file mpi.h since the diff --git a/source/base/multithread_info.cc b/source/base/multithread_info.cc index a921e982fa..a0579d4c1f 100644 --- a/source/base/multithread_info.cc +++ b/source/base/multithread_info.cc @@ -141,10 +141,10 @@ MultithreadInfo::set_thread_limit(const unsigned int max_threads) penv + ">")); } - AssertThrow( - max_threads_env > 0, - ExcMessage("When specifying the environment " - "variable, it needs to be a positive number.")); + AssertThrow(max_threads_env > 0, + ExcMessage( + "When specifying the environment " + "variable, it needs to be a positive number.")); if (n_max_threads != numbers::invalid_unsigned_int) n_max_threads = std::min(n_max_threads, max_threads_env); diff --git a/source/base/parallel.cc b/source/base/parallel.cc index a11cfc4183..e448c07b6a 100644 --- a/source/base/parallel.cc +++ b/source/base/parallel.cc @@ -54,19 +54,19 @@ namespace parallel namespace internal { #ifdef DEAL_II_WITH_THREADS - TBBPartitioner::TBBPartitioner() : - my_partitioner(std::make_shared()), - in_use(false) + TBBPartitioner::TBBPartitioner() + : my_partitioner(std::make_shared()) + , in_use(false) {} TBBPartitioner::~TBBPartitioner() { - AssertNothrow( - in_use == false, - ExcInternalError("A vector partitioner goes out of scope, but " - "it appears to be still in use.")); + AssertNothrow(in_use == false, + ExcInternalError( + "A vector partitioner goes out of scope, but " + "it appears to be still in use.")); } diff --git a/source/base/parameter_acceptor.cc b/source/base/parameter_acceptor.cc index 03e220c68b..cbe3d5d5cc 100644 --- a/source/base/parameter_acceptor.cc +++ b/source/base/parameter_acceptor.cc @@ -29,9 +29,9 @@ std::vector> ParameterAcceptor::class_list; // Static parameter handler ParameterHandler ParameterAcceptor::prm; -ParameterAcceptor::ParameterAcceptor(const std::string &name) : - acceptor_id(class_list.size()), - section_name(name) +ParameterAcceptor::ParameterAcceptor(const std::string &name) + : acceptor_id(class_list.size()) + , section_name(name) { SmartPointer pt( this, boost::core::demangle(typeid(*this).name()).c_str()); @@ -228,8 +228,9 @@ ParameterAcceptor::get_section_path() const if ((previous_path.size() > 0) && has_trailing == false) previous_path.resize(previous_path.size() - 1); - sections.insert( - sections.begin(), previous_path.begin(), previous_path.end()); + sections.insert(sections.begin(), + previous_path.begin(), + previous_path.end()); // Exit the for cycle break; } diff --git a/source/base/parameter_handler.cc b/source/base/parameter_handler.cc index f7485d1116..03a3cc0ce8 100644 --- a/source/base/parameter_handler.cc +++ b/source/base/parameter_handler.cc @@ -39,8 +39,8 @@ DEAL_II_NAMESPACE_OPEN -ParameterHandler::ParameterHandler() : - entries(new boost::property_tree::ptree()) +ParameterHandler::ParameterHandler() + : entries(new boost::property_tree::ptree()) {} @@ -383,8 +383,9 @@ ParameterHandler::parse_input(std::istream & input, if (!is_concatenated) { - scan_line_or_cleanup( - fully_concatenated_line, filename, current_logical_line_n); + scan_line_or_cleanup(fully_concatenated_line, + filename, + current_logical_line_n); fully_concatenated_line.clear(); } @@ -634,9 +635,9 @@ ParameterHandler::declare_entry(const std::string & entry, patterns.back()->description()); // as documented, do the default value checking at the very end - AssertThrow( - pattern.match(default_value), - ExcValueDoesNotMatchPattern(default_value, pattern.description())); + AssertThrow(pattern.match(default_value), + ExcValueDoesNotMatchPattern(default_value, + pattern.description())); } @@ -690,13 +691,13 @@ ParameterHandler::declare_alias(const std::string &existing_entry_name, ">, but the latter does not exist.")); // then also make sure that what is being referred to is in // fact a parameter (not an alias or subsection) - Assert( - entries->get_optional( - get_current_full_path(existing_entry_name) + path_separator + "value"), - ExcMessage("You are trying to declare an alias entry <" + alias_name + - "> that references an entry <" + existing_entry_name + - ">, but the latter does not seem to be a " - "parameter declaration.")); + Assert(entries->get_optional( + get_current_full_path(existing_entry_name) + path_separator + + "value"), + ExcMessage("You are trying to declare an alias entry <" + alias_name + + "> that references an entry <" + existing_entry_name + + ">, but the latter does not seem to be a " + "parameter declaration.")); // now also make sure that if the alias has already been @@ -704,29 +705,29 @@ ParameterHandler::declare_alias(const std::string &existing_entry_name, // entry if (entries->get_optional(get_current_full_path(alias_name))) { - Assert( - entries->get_optional(get_current_full_path(alias_name) + - path_separator + "alias"), - ExcMessage("You are trying to declare an alias entry <" + alias_name + - "> but a non-alias entry already exists in this " - "subsection (i.e., there is either a preexisting " - "further subsection, or a parameter entry, with " - "the same name as the alias).")); - Assert( - entries->get(get_current_full_path(alias_name) + - path_separator + "alias") == - existing_entry_name, - ExcMessage("You are trying to declare an alias entry <" + alias_name + - "> but an alias entry already exists in this " - "subsection and this existing alias references a " - "different parameter entry. Specifically, " - "you are trying to reference the entry <" + - existing_entry_name + - "> whereas the existing alias references " - "the entry <" + - entries->get(get_current_full_path(alias_name) + - path_separator + "alias") + - ">.")); + Assert(entries->get_optional( + get_current_full_path(alias_name) + path_separator + "alias"), + ExcMessage("You are trying to declare an alias entry <" + + alias_name + + "> but a non-alias entry already exists in this " + "subsection (i.e., there is either a preexisting " + "further subsection, or a parameter entry, with " + "the same name as the alias).")); + Assert(entries->get(get_current_full_path(alias_name) + + path_separator + "alias") == + existing_entry_name, + ExcMessage( + "You are trying to declare an alias entry <" + alias_name + + "> but an alias entry already exists in this " + "subsection and this existing alias references a " + "different parameter entry. Specifically, " + "you are trying to reference the entry <" + + existing_entry_name + + "> whereas the existing alias references " + "the entry <" + + entries->get(get_current_full_path(alias_name) + + path_separator + "alias") + + ">.")); } entries->put(get_current_full_path(alias_name) + path_separator + "alias", @@ -857,10 +858,10 @@ ParameterHandler::set(const std::string &entry_string, const unsigned int pattern_index = entries->get(path + path_separator + "pattern"); AssertThrow(patterns[pattern_index]->match(new_value), - ExcValueDoesNotMatchPattern( - new_value, - entries->get(path + path_separator + - "pattern_description"))); + ExcValueDoesNotMatchPattern(new_value, + entries->get( + path + path_separator + + "pattern_description"))); // then also execute the actions associated with this // parameter (if any have been provided) @@ -1046,8 +1047,9 @@ ParameterHandler::recursively_print_parameters( { longest_name = std::max(longest_name, demangle(p->first).length()); - longest_value = std::max( - longest_value, p->second.get("value").length()); + longest_value = + std::max(longest_value, + p->second.get("value").length()); } // print entries one by one. make sure they are sorted by using @@ -1396,8 +1398,10 @@ ParameterHandler::recursively_print_parameters( std::vector directory_path = target_subsection_path; directory_path.emplace_back(subsection); - recursively_print_parameters( - directory_path, style, overall_indent_level + 1, out); + recursively_print_parameters(directory_path, + style, + overall_indent_level + 1, + out); switch (style) { @@ -1530,8 +1534,9 @@ ParameterHandler::print_parameters_section( p != current_section.end(); ++p) if (is_parameter_node(p->second) == true) - longest_value = std::max( - longest_value, p->second.get("value").length()); + longest_value = + std::max(longest_value, + p->second.get("value").length()); // print entries one by one. make sure they are sorted by using @@ -1994,11 +1999,11 @@ ParameterHandler::scan_line(std::string line, const std::string subsection = Utilities::trim(line); // check whether subsection exists - AssertThrow( - entries->get_child_optional(get_current_full_path(subsection)), - ExcNoSubsection(current_line_n, - input_filename, - demangle(get_current_full_path(subsection)))); + AssertThrow(entries->get_child_optional( + get_current_full_path(subsection)), + ExcNoSubsection(current_line_n, + input_filename, + demangle(get_current_full_path(subsection)))); // subsection exists subsection_path.push_back(subsection); @@ -2133,8 +2138,9 @@ ParameterHandler::scan_line(std::string line, std::ifstream input(line.c_str()); AssertThrow(input, - ExcCannotOpenIncludeStatementFile( - current_line_n, input_filename, line)); + ExcCannotOpenIncludeStatementFile(current_line_n, + input_filename, + line)); parse_input(input); } else @@ -2190,7 +2196,8 @@ ParameterHandler::operator==(const ParameterHandler &prm2) const -MultipleParameterLoop::MultipleParameterLoop() : n_branches(0) +MultipleParameterLoop::MultipleParameterLoop() + : n_branches(0) {} @@ -2288,8 +2295,9 @@ MultipleParameterLoop::init_branches_current_section() { const std::string value = p->second.get("value"); if (value.find('{') != std::string::npos) - multiple_choices.emplace_back( - subsection_path, demangle(p->first), value); + multiple_choices.emplace_back(subsection_path, + demangle(p->first), + value); } // then loop over all subsections @@ -2368,11 +2376,11 @@ MultipleParameterLoop::memory_consumption() const MultipleParameterLoop::Entry::Entry(const std::vector &ssp, const std::string & Name, - const std::string & Value) : - subsection_path(ssp), - entry_name(Name), - entry_value(Value), - type(Entry::array) + const std::string & Value) + : subsection_path(ssp) + , entry_name(Name) + , entry_value(Value) + , type(Entry::array) {} @@ -2388,8 +2396,9 @@ MultipleParameterLoop::Entry::split_different_values() std::string multiple(entry_value, entry_value.find('{') + 1, entry_value.rfind('}') - entry_value.find('{') - 1); - std::string postfix( - entry_value, entry_value.rfind('}') + 1, std::string::npos); + std::string postfix(entry_value, + entry_value.rfind('}') + 1, + std::string::npos); // if array entry {{..}}: delete inner // pair of braces if (multiple[0] == '{') diff --git a/source/base/parsed_function.cc b/source/base/parsed_function.cc index 27ffb81725..cd48668092 100644 --- a/source/base/parsed_function.cc +++ b/source/base/parsed_function.cc @@ -24,9 +24,9 @@ namespace Functions { template ParsedFunction::ParsedFunction(const unsigned int n_components, - const double h) : - AutoDerivativeFunction(h, n_components), - function_object(n_components) + const double h) + : AutoDerivativeFunction(h, n_components) + , function_object(n_components) {} @@ -149,14 +149,14 @@ namespace Functions function_object.initialize(vnames, expression, constants, true); break; default: - AssertThrow( - false, - ExcMessage("The list of variables specified is <" + vnames + - "> which is a list of length " + - Utilities::int_to_string(nn) + - " but it has to be a list of length equal to" + - " either dim (for a time-independent function)" + - " or dim+1 (for a time-dependent function).")); + AssertThrow(false, + ExcMessage( + "The list of variables specified is <" + vnames + + "> which is a list of length " + + Utilities::int_to_string(nn) + + " but it has to be a list of length equal to" + + " either dim (for a time-independent function)" + + " or dim+1 (for a time-dependent function).")); } } diff --git a/source/base/partitioner.cc b/source/base/partitioner.cc index 9024873cd3..997de33251 100644 --- a/source/base/partitioner.cc +++ b/source/base/partitioner.cc @@ -22,33 +22,33 @@ namespace Utilities { namespace MPI { - Partitioner::Partitioner() : - global_size(0), - local_range_data( - std::pair(0, 0)), - n_ghost_indices_data(0), - n_import_indices_data(0), - n_ghost_indices_in_larger_set(0), - my_pid(0), - n_procs(1), - communicator(MPI_COMM_SELF), - have_ghost_indices(false) + Partitioner::Partitioner() + : global_size(0) + , local_range_data( + std::pair(0, 0)) + , n_ghost_indices_data(0) + , n_import_indices_data(0) + , n_ghost_indices_in_larger_set(0) + , my_pid(0) + , n_procs(1) + , communicator(MPI_COMM_SELF) + , have_ghost_indices(false) {} - Partitioner::Partitioner(const unsigned int size) : - global_size(size), - locally_owned_range_data(size), - local_range_data( - std::pair(0, size)), - n_ghost_indices_data(0), - n_import_indices_data(0), - n_ghost_indices_in_larger_set(0), - my_pid(0), - n_procs(1), - communicator(MPI_COMM_SELF), - have_ghost_indices(false) + Partitioner::Partitioner(const unsigned int size) + : global_size(size) + , locally_owned_range_data(size) + , local_range_data( + std::pair(0, size)) + , n_ghost_indices_data(0) + , n_import_indices_data(0) + , n_ghost_indices_in_larger_set(0) + , my_pid(0) + , n_procs(1) + , communicator(MPI_COMM_SELF) + , have_ghost_indices(false) { locally_owned_range_data.add_range(0, size); locally_owned_range_data.compress(); @@ -59,16 +59,16 @@ namespace Utilities Partitioner::Partitioner(const IndexSet &locally_owned_indices, const IndexSet &ghost_indices_in, - const MPI_Comm communicator_in) : - global_size( - static_cast(locally_owned_indices.size())), - n_ghost_indices_data(0), - n_import_indices_data(0), - n_ghost_indices_in_larger_set(0), - my_pid(0), - n_procs(1), - communicator(communicator_in), - have_ghost_indices(false) + const MPI_Comm communicator_in) + : global_size( + static_cast(locally_owned_indices.size())) + , n_ghost_indices_data(0) + , n_import_indices_data(0) + , n_ghost_indices_in_larger_set(0) + , my_pid(0) + , n_procs(1) + , communicator(communicator_in) + , have_ghost_indices(false) { set_owned_indices(locally_owned_indices); set_ghost_indices(ghost_indices_in); @@ -77,16 +77,16 @@ namespace Utilities Partitioner::Partitioner(const IndexSet &locally_owned_indices, - const MPI_Comm communicator_in) : - global_size( - static_cast(locally_owned_indices.size())), - n_ghost_indices_data(0), - n_import_indices_data(0), - n_ghost_indices_in_larger_set(0), - my_pid(0), - n_procs(1), - communicator(communicator_in), - have_ghost_indices(false) + const MPI_Comm communicator_in) + : global_size( + static_cast(locally_owned_indices.size())) + , n_ghost_indices_data(0) + , n_import_indices_data(0) + , n_ghost_indices_in_larger_set(0) + , my_pid(0) + , n_procs(1) + , communicator(communicator_in) + , have_ghost_indices(false) { set_owned_indices(locally_owned_indices); } @@ -409,8 +409,9 @@ namespace Utilities if (larger_ghost_index_set.size() == 0) { ghost_indices_subset_chunks_by_rank_data.clear(); - ghost_indices_subset_data.emplace_back( - local_size(), local_size() + n_ghost_indices()); + ghost_indices_subset_data.emplace_back(local_size(), + local_size() + + n_ghost_indices()); n_ghost_indices_in_larger_set = n_ghost_indices_data; } else @@ -455,8 +456,9 @@ namespace Utilities if (expanded_numbering[i] == last_index + 1) ghost_indices_subset.back().second++; else - ghost_indices_subset.emplace_back( - expanded_numbering[i], expanded_numbering[i] + 1); + ghost_indices_subset.emplace_back(expanded_numbering[i], + expanded_numbering[i] + + 1); last_index = expanded_numbering[i]; } shift += ghost_targets_data[p].second; @@ -480,8 +482,9 @@ namespace Utilities if (Utilities::MPI::job_supports_mpi()) { int communicators_same = 0; - const int ierr = MPI_Comm_compare( - part.communicator, communicator, &communicators_same); + const int ierr = MPI_Comm_compare(part.communicator, + communicator, + &communicators_same); AssertThrowMPI(ierr); if (!(communicators_same == MPI_IDENT || communicators_same == MPI_CONGRUENT)) diff --git a/source/base/partitioner.inst.in b/source/base/partitioner.inst.in index 6d12691228..5e74ab99c4 100644 --- a/source/base/partitioner.inst.in +++ b/source/base/partitioner.inst.in @@ -18,29 +18,25 @@ for (SCALAR : MPI_SCALARS) { #ifdef DEAL_II_WITH_MPI - template void - Utilities::MPI::Partitioner::export_to_ghosted_array_start( - const unsigned int, - const ArrayView &, - const ArrayView &, - const ArrayView &, - std::vector &) const; - template void - Utilities::MPI::Partitioner::export_to_ghosted_array_finish( - const ArrayView &, std::vector &) const; - template void - Utilities::MPI::Partitioner::import_from_ghosted_array_start( - const VectorOperation::values, - const unsigned int, - const ArrayView &, - const ArrayView &, - std::vector &) const; - template void - Utilities::MPI::Partitioner::import_from_ghosted_array_finish( - const VectorOperation::values, - const ArrayView &, - const ArrayView &, - const ArrayView &, - std::vector &) const; + template void Utilities::MPI::Partitioner::export_to_ghosted_array_start< + SCALAR>(const unsigned int, + const ArrayView &, + const ArrayView &, + const ArrayView &, + std::vector &) const; + template void Utilities::MPI::Partitioner::export_to_ghosted_array_finish< + SCALAR>(const ArrayView &, std::vector &) const; + template void Utilities::MPI::Partitioner::import_from_ghosted_array_start< + SCALAR>(const VectorOperation::values, + const unsigned int, + const ArrayView &, + const ArrayView &, + std::vector &) const; + template void Utilities::MPI::Partitioner::import_from_ghosted_array_finish< + SCALAR>(const VectorOperation::values, + const ArrayView &, + const ArrayView &, + const ArrayView &, + std::vector &) const; #endif } diff --git a/source/base/path_search.cc b/source/base/path_search.cc index 59fe396e69..4faee0bd51 100644 --- a/source/base/path_search.cc +++ b/source/base/path_search.cc @@ -100,11 +100,11 @@ PathSearch::get_suffix_list(const std::string &cls) } -PathSearch::PathSearch(const std::string &cls, const unsigned int debug) : - cls(cls), - my_path_list(get_path_list(cls)), - my_suffix_list(get_suffix_list(cls)), - debug(debug) +PathSearch::PathSearch(const std::string &cls, const unsigned int debug) + : cls(cls) + , my_path_list(get_path_list(cls)) + , my_suffix_list(get_suffix_list(cls)) + , debug(debug) {} diff --git a/source/base/patterns.cc b/source/base/patterns.cc index 0ace857cd1..52a8965610 100644 --- a/source/base/patterns.cc +++ b/source/base/patterns.cc @@ -206,9 +206,9 @@ namespace Patterns const char *Integer::description_init = "[Integer"; - Integer::Integer(const int lower_bound, const int upper_bound) : - lower_bound(lower_bound), - upper_bound(upper_bound) + Integer::Integer(const int lower_bound, const int upper_bound) + : lower_bound(lower_bound) + , upper_bound(upper_bound) {} @@ -307,8 +307,9 @@ namespace Patterns std::unique_ptr Integer::create(const std::string &description) { - if (description.compare( - 0, std::strlen(description_init), description_init) == 0) + if (description.compare(0, + std::strlen(description_init), + description_init) == 0) { std::istringstream is(description); @@ -344,9 +345,9 @@ namespace Patterns const char *Double::description_init = "[Double"; - Double::Double(const double lower_bound, const double upper_bound) : - lower_bound(lower_bound), - upper_bound(upper_bound) + Double::Double(const double lower_bound, const double upper_bound) + : lower_bound(lower_bound) + , upper_bound(upper_bound) {} @@ -486,8 +487,9 @@ namespace Patterns Double::create(const std::string &description) { const std::string description_init_str = description_init; - if (description.compare( - 0, description_init_str.size(), description_init_str) != 0) + if (description.compare(0, + description_init_str.size(), + description_init_str) != 0) return std::unique_ptr(); if (*description.rbegin() != ']') return std::unique_ptr(); @@ -525,7 +527,8 @@ namespace Patterns const char *Selection::description_init = "[Selection"; - Selection::Selection(const std::string &seq) : sequence(seq) + Selection::Selection(const std::string &seq) + : sequence(seq) { while (sequence.find(" |") != std::string::npos) sequence.replace(sequence.find(" |"), 2, "|"); @@ -621,8 +624,9 @@ namespace Patterns std::unique_ptr Selection::create(const std::string &description) { - if (description.compare( - 0, std::strlen(description_init), description_init) == 0) + if (description.compare(0, + std::strlen(description_init), + description_init) == 0) { std::string sequence(description); @@ -646,11 +650,11 @@ namespace Patterns List::List(const PatternBase &p, const unsigned int min_elements, const unsigned int max_elements, - const std::string &separator) : - pattern(p.clone()), - min_elements(min_elements), - max_elements(max_elements), - separator(separator) + const std::string &separator) + : pattern(p.clone()) + , min_elements(min_elements) + , max_elements(max_elements) + , separator(separator) { Assert(min_elements <= max_elements, ExcInvalidRange(min_elements, max_elements)); @@ -660,11 +664,11 @@ namespace Patterns - List::List(const List &other) : - pattern(other.pattern->clone()), - min_elements(other.min_elements), - max_elements(other.max_elements), - separator(other.separator) + List::List(const List &other) + : pattern(other.pattern->clone()) + , min_elements(other.min_elements) + , max_elements(other.max_elements) + , separator(other.separator) {} @@ -768,8 +772,9 @@ namespace Patterns std::unique_ptr List::create(const std::string &description) { - if (description.compare( - 0, std::strlen(description_init), description_init) == 0) + if (description.compare(0, + std::strlen(description_init), + description_init) == 0) { unsigned int min_elements = 0, max_elements = 0; @@ -796,8 +801,10 @@ namespace Patterns else separator = ","; - return std_cxx14::make_unique( - *base_pattern, min_elements, max_elements, separator); + return std_cxx14::make_unique(*base_pattern, + min_elements, + max_elements, + separator); } else return std::unique_ptr(); @@ -816,13 +823,13 @@ namespace Patterns const unsigned int min_elements, const unsigned int max_elements, const std::string &separator, - const std::string &key_value_separator) : - key_pattern(p_key.clone()), - value_pattern(p_value.clone()), - min_elements(min_elements), - max_elements(max_elements), - separator(separator), - key_value_separator(key_value_separator) + const std::string &key_value_separator) + : key_pattern(p_key.clone()) + , value_pattern(p_value.clone()) + , min_elements(min_elements) + , max_elements(max_elements) + , separator(separator) + , key_value_separator(key_value_separator) { Assert(min_elements <= max_elements, ExcInvalidRange(min_elements, max_elements)); @@ -830,22 +837,22 @@ namespace Patterns ExcMessage("The separator must have a non-zero length.")); Assert(key_value_separator.size() > 0, ExcMessage("The key_value_separator must have a non-zero length.")); - Assert( - separator != key_value_separator, - ExcMessage("The separator can not be the same of the key_value_separator " - "since that is used as the separator between the two elements " - "of pairs")); + Assert(separator != key_value_separator, + ExcMessage( + "The separator can not be the same of the key_value_separator " + "since that is used as the separator between the two elements " + "of pairs")); } - Map::Map(const Map &other) : - key_pattern(other.key_pattern->clone()), - value_pattern(other.value_pattern->clone()), - min_elements(other.min_elements), - max_elements(other.max_elements), - separator(other.separator), - key_value_separator(other.key_value_separator) + Map::Map(const Map &other) + : key_pattern(other.key_pattern->clone()) + , value_pattern(other.value_pattern->clone()) + , min_elements(other.min_elements) + , max_elements(other.max_elements) + , separator(other.separator) + , key_value_separator(other.key_value_separator) {} @@ -957,8 +964,9 @@ namespace Patterns std::unique_ptr Map::create(const std::string &description) { - if (description.compare( - 0, std::strlen(description_init), description_init) == 0) + if (description.compare(0, + std::strlen(description_init), + description_init) == 0) { unsigned int min_elements = 0, max_elements = 0; @@ -984,8 +992,9 @@ namespace Patterns is.ignore(strlen("...")); if (!(is >> max_elements)) - return std_cxx14::make_unique( - *key_pattern, *value_pattern, min_elements); + return std_cxx14::make_unique(*key_pattern, + *value_pattern, + min_elements); is.ignore(strlen(" (inclusive) separated by <")); std::string separator; @@ -1042,8 +1051,8 @@ namespace Patterns Tuple::Tuple(const std::vector> &ps, - const std::string & separator) : - separator(separator) + const std::string & separator) + : separator(separator) { Assert(ps.size() > 0, ExcMessage("The Patterns list must have a non-zero length.")); @@ -1057,13 +1066,14 @@ namespace Patterns Tuple::Tuple(const std::vector> &ps, - const char * separator) : - Tuple(ps, std::string(separator)) + const char * separator) + : Tuple(ps, std::string(separator)) {} - Tuple::Tuple(const Tuple &other) : separator(other.separator) + Tuple::Tuple(const Tuple &other) + : separator(other.separator) { patterns.resize(other.patterns.size()); for (unsigned int i = 0; i < other.patterns.size(); ++i) @@ -1160,8 +1170,9 @@ namespace Patterns std::unique_ptr Tuple::create(const std::string &description) { - if (description.compare( - 0, std::strlen(description_init), description_init) == 0) + if (description.compare(0, + std::strlen(description_init), + description_init) == 0) { std::vector> patterns; @@ -1357,8 +1368,9 @@ namespace Patterns std::unique_ptr MultipleSelection::create(const std::string &description) { - if (description.compare( - 0, std::strlen(description_init), description_init) == 0) + if (description.compare(0, + std::strlen(description_init), + description_init) == 0) { std::string sequence(description); @@ -1376,7 +1388,8 @@ namespace Patterns const char *Bool::description_init = "[Bool"; - Bool::Bool() : Selection("true|false") + Bool::Bool() + : Selection("true|false") {} @@ -1420,8 +1433,9 @@ namespace Patterns std::unique_ptr Bool::create(const std::string &description) { - if (description.compare( - 0, std::strlen(description_init), description_init) == 0) + if (description.compare(0, + std::strlen(description_init), + description_init) == 0) return std_cxx14::make_unique(); else return std::unique_ptr(); @@ -1480,8 +1494,9 @@ namespace Patterns std::unique_ptr Anything::create(const std::string &description) { - if (description.compare( - 0, std::strlen(description_init), description_init) == 0) + if (description.compare(0, + std::strlen(description_init), + description_init) == 0) return std_cxx14::make_unique(); else return std::unique_ptr(); @@ -1492,7 +1507,8 @@ namespace Patterns const char *FileName::description_init = "[FileName"; - FileName::FileName(const FileType type) : file_type(type) + FileName::FileName(const FileType type) + : file_type(type) {} @@ -1552,8 +1568,9 @@ namespace Patterns std::unique_ptr FileName::create(const std::string &description) { - if (description.compare( - 0, std::strlen(description_init), description_init) == 0) + if (description.compare(0, + std::strlen(description_init), + description_init) == 0) { std::istringstream is(description); std::string file_type; @@ -1627,8 +1644,9 @@ namespace Patterns std::unique_ptr DirectoryName::create(const std::string &description) { - if (description.compare( - 0, std::strlen(description_init), description_init) == 0) + if (description.compare(0, + std::strlen(description_init), + description_init) == 0) return std_cxx14::make_unique(); else return std::unique_ptr(); diff --git a/source/base/polynomial.cc b/source/base/polynomial.cc index 4fb96a4943..eca63433ca 100644 --- a/source/base/polynomial.cc +++ b/source/base/polynomial.cc @@ -49,27 +49,27 @@ namespace Polynomials template - Polynomial::Polynomial(const std::vector &a) : - coefficients(a), - in_lagrange_product_form(false), - lagrange_weight(1.) + Polynomial::Polynomial(const std::vector &a) + : coefficients(a) + , in_lagrange_product_form(false) + , lagrange_weight(1.) {} template - Polynomial::Polynomial(const unsigned int n) : - coefficients(n + 1, 0.), - in_lagrange_product_form(false), - lagrange_weight(1.) + Polynomial::Polynomial(const unsigned int n) + : coefficients(n + 1, 0.) + , in_lagrange_product_form(false) + , lagrange_weight(1.) {} template Polynomial::Polynomial(const std::vector> &supp, - const unsigned int center) : - in_lagrange_product_form(true) + const unsigned int center) + : in_lagrange_product_form(true) { Assert(supp.size() > 0, ExcEmptyObject()); AssertIndexRange(center, supp.size()); @@ -675,8 +675,8 @@ namespace Polynomials template - Monomial::Monomial(unsigned int n, double coefficient) : - Polynomial(make_vector(n, coefficient)) + Monomial::Monomial(unsigned int n, double coefficient) + : Polynomial(make_vector(n, coefficient)) {} @@ -715,10 +715,10 @@ namespace Polynomials LagrangeEquidistant::LagrangeEquidistant(const unsigned int n, - const unsigned int support_point) : - Polynomial(internal::LagrangeEquidistantImplementation:: - generate_equidistant_unit_points(n), - support_point) + const unsigned int support_point) + : Polynomial(internal::LagrangeEquidistantImplementation:: + generate_equidistant_unit_points(n), + support_point) { Assert(coefficients.size() == 0, ExcInternalError()); @@ -836,7 +836,8 @@ namespace Polynomials - Legendre::Legendre(const unsigned int k) : Polynomial(0) + Legendre::Legendre(const unsigned int k) + : Polynomial(0) { this->coefficients.clear(); this->in_lagrange_product_form = true; @@ -876,8 +877,8 @@ namespace Polynomials // ------------------ class Lobatto -------------------- // - Lobatto::Lobatto(const unsigned int p) : - Polynomial(compute_coefficients(p)) + Lobatto::Lobatto(const unsigned int p) + : Polynomial(compute_coefficients(p)) {} std::vector @@ -989,8 +990,8 @@ namespace Polynomials - Hierarchical::Hierarchical(const unsigned int k) : - Polynomial(get_coefficients(k)) + Hierarchical::Hierarchical(const unsigned int k) + : Polynomial(get_coefficients(k)) {} @@ -1174,8 +1175,8 @@ namespace Polynomials // ------------------ HermiteInterpolation --------------- // - HermiteInterpolation::HermiteInterpolation(const unsigned int p) : - Polynomial(0) + HermiteInterpolation::HermiteInterpolation(const unsigned int p) + : Polynomial(0) { this->coefficients.clear(); this->in_lagrange_product_form = true; @@ -1293,8 +1294,8 @@ namespace Polynomials HermiteLikeInterpolation::HermiteLikeInterpolation(const unsigned int degree, - const unsigned int index) : - Polynomial(0) + const unsigned int index) + : Polynomial(0) { AssertIndexRange(index, degree + 1); diff --git a/source/base/polynomials_abf.cc b/source/base/polynomials_abf.cc index b5c486f717..e52d5001b6 100644 --- a/source/base/polynomials_abf.cc +++ b/source/base/polynomials_abf.cc @@ -46,10 +46,10 @@ namespace } // namespace template -PolynomialsABF::PolynomialsABF(const unsigned int k) : - my_degree(k), - polynomial_space(get_abf_polynomials(k)), - n_pols(compute_n_pols(k)) +PolynomialsABF::PolynomialsABF(const unsigned int k) + : my_degree(k) + , polynomial_space(get_abf_polynomials(k)) + , n_pols(compute_n_pols(k)) { // check that the dimensions match. we only store one of the 'dim' // anisotropic polynomials that make up the vector-valued space, so diff --git a/source/base/polynomials_adini.cc b/source/base/polynomials_adini.cc index 2e26621356..de81570580 100644 --- a/source/base/polynomials_adini.cc +++ b/source/base/polynomials_adini.cc @@ -35,13 +35,13 @@ DEAL_II_NAMESPACE_OPEN -PolynomialsAdini::PolynomialsAdini() : - coef(12, 12), - dx(12, 12), - dy(12, 12), - dxx(12, 12), - dyy(12, 12), - dxy(12, 12) +PolynomialsAdini::PolynomialsAdini() + : coef(12, 12) + , dx(12, 12) + , dy(12, 12) + , dxx(12, 12) + , dyy(12, 12) + , dxy(12, 12) { // 1 x y xx yy xy 3x 3y xyy xxy 3xy x3y // 0 1 2 3 4 5 6 7 8 9 10 11 diff --git a/source/base/polynomials_bdm.cc b/source/base/polynomials_bdm.cc index 99d51454b7..d93fe476f6 100644 --- a/source/base/polynomials_bdm.cc +++ b/source/base/polynomials_bdm.cc @@ -26,13 +26,13 @@ DEAL_II_NAMESPACE_OPEN template -PolynomialsBDM::PolynomialsBDM(const unsigned int k) : - polynomial_space(Polynomials::Legendre::generate_complete_basis(k)), - monomials((dim == 2) ? (1) : (k + 2)), - n_pols(compute_n_pols(k)), - p_values(polynomial_space.n()), - p_grads(polynomial_space.n()), - p_grad_grads(polynomial_space.n()) +PolynomialsBDM::PolynomialsBDM(const unsigned int k) + : polynomial_space(Polynomials::Legendre::generate_complete_basis(k)) + , monomials((dim == 2) ? (1) : (k + 2)) + , n_pols(compute_n_pols(k)) + , p_values(polynomial_space.n()) + , p_grads(polynomial_space.n()) + , p_grad_grads(polynomial_space.n()) { switch (dim) { diff --git a/source/base/polynomials_bernstein.cc b/source/base/polynomials_bernstein.cc index 3cb0f88ed6..24a9e07a74 100644 --- a/source/base/polynomials_bernstein.cc +++ b/source/base/polynomials_bernstein.cc @@ -43,9 +43,9 @@ namespace template PolynomialsBernstein::PolynomialsBernstein(const unsigned int index, - const unsigned int degree) : - Polynomials::Polynomial( - get_bernstein_coefficients(index, degree)) + const unsigned int degree) + : Polynomials::Polynomial( + get_bernstein_coefficients(index, degree)) {} diff --git a/source/base/polynomials_integrated_legendre_sz.cc b/source/base/polynomials_integrated_legendre_sz.cc index 695dbbd8f8..0733a93df2 100644 --- a/source/base/polynomials_integrated_legendre_sz.cc +++ b/source/base/polynomials_integrated_legendre_sz.cc @@ -18,8 +18,8 @@ DEAL_II_NAMESPACE_OPEN -IntegratedLegendreSZ::IntegratedLegendreSZ(const unsigned int k) : - Polynomials::Polynomial(get_coefficients(k)) +IntegratedLegendreSZ::IntegratedLegendreSZ(const unsigned int k) + : Polynomials::Polynomial(get_coefficients(k)) {} diff --git a/source/base/polynomials_nedelec.cc b/source/base/polynomials_nedelec.cc index 76b5d74374..5484e308fb 100644 --- a/source/base/polynomials_nedelec.cc +++ b/source/base/polynomials_nedelec.cc @@ -25,10 +25,10 @@ DEAL_II_NAMESPACE_OPEN template -PolynomialsNedelec::PolynomialsNedelec(const unsigned int k) : - my_degree(k), - polynomial_space(create_polynomials(k)), - n_pols(compute_n_pols(k)) +PolynomialsNedelec::PolynomialsNedelec(const unsigned int k) + : my_degree(k) + , polynomial_space(create_polynomials(k)) + , n_pols(compute_n_pols(k)) {} template diff --git a/source/base/polynomials_p.cc b/source/base/polynomials_p.cc index e23bd2291b..693ac2964b 100644 --- a/source/base/polynomials_p.cc +++ b/source/base/polynomials_p.cc @@ -20,10 +20,10 @@ DEAL_II_NAMESPACE_OPEN template -PolynomialsP::PolynomialsP(const unsigned int p) : - PolynomialSpace( - Polynomials::Monomial::generate_complete_basis(p)), - p(p) +PolynomialsP::PolynomialsP(const unsigned int p) + : PolynomialSpace( + Polynomials::Monomial::generate_complete_basis(p)) + , p(p) { std::vector index_map(this->n()); create_polynomial_ordering(index_map); @@ -78,11 +78,11 @@ PolynomialsP<2>::create_polynomial_ordering( namespace { - const unsigned int imap3[4][20] = { - {0}, - {0, 1, 2, 3}, - {0, 1, 3, 6, 4, 7, 8, 2, 5, 9}, - {0, 1, 4, 10, 5, 11, 13, 2, 7, 16, 14, 6, 12, 8, 15, 17, 18, 3, 9, 19}}; + const unsigned int imap3[4][20] = {{0}, + {0, 1, 2, 3}, + {0, 1, 3, 6, 4, 7, 8, 2, 5, 9}, + {0, 1, 4, 10, 5, 11, 13, 2, 7, 16, + 14, 6, 12, 8, 15, 17, 18, 3, 9, 19}}; } template <> diff --git a/source/base/polynomials_piecewise.cc b/source/base/polynomials_piecewise.cc index 7f050c59dc..f81b90f130 100644 --- a/source/base/polynomials_piecewise.cc +++ b/source/base/polynomials_piecewise.cc @@ -27,11 +27,11 @@ namespace Polynomials const Polynomial &coefficients_on_interval, const unsigned int n_intervals, const unsigned int interval, - const bool spans_next_interval) : - polynomial(coefficients_on_interval), - n_intervals(n_intervals), - interval(interval), - spans_two_intervals(spans_next_interval) + const bool spans_next_interval) + : polynomial(coefficients_on_interval) + , n_intervals(n_intervals) + , interval(interval) + , spans_two_intervals(spans_next_interval) { Assert(n_intervals > 0, ExcMessage("No intervals given")); AssertIndexRange(interval, n_intervals); diff --git a/source/base/polynomials_raviart_thomas.cc b/source/base/polynomials_raviart_thomas.cc index c7525d98a3..6b4bd50a82 100644 --- a/source/base/polynomials_raviart_thomas.cc +++ b/source/base/polynomials_raviart_thomas.cc @@ -34,10 +34,10 @@ DEAL_II_NAMESPACE_OPEN template -PolynomialsRaviartThomas::PolynomialsRaviartThomas(const unsigned int k) : - my_degree(k), - polynomial_space(create_polynomials(k)), - n_pols(compute_n_pols(k)) +PolynomialsRaviartThomas::PolynomialsRaviartThomas(const unsigned int k) + : my_degree(k) + , polynomial_space(create_polynomials(k)) + , n_pols(compute_n_pols(k)) {} diff --git a/source/base/polynomials_rt_bubbles.cc b/source/base/polynomials_rt_bubbles.cc index 2cb1ea017a..b79ef3ee3e 100644 --- a/source/base/polynomials_rt_bubbles.cc +++ b/source/base/polynomials_rt_bubbles.cc @@ -26,11 +26,11 @@ DEAL_II_NAMESPACE_OPEN template -PolynomialsRT_Bubbles::PolynomialsRT_Bubbles(const unsigned int k) : - my_degree(k), - raviart_thomas_space(k - 1), - monomials(k + 2), - n_pols(compute_n_pols(k)) +PolynomialsRT_Bubbles::PolynomialsRT_Bubbles(const unsigned int k) + : my_degree(k) + , raviart_thomas_space(k - 1) + , monomials(k + 2) + , n_pols(compute_n_pols(k)) { Assert(dim >= 2, ExcImpossibleInDim(dim)); @@ -124,8 +124,9 @@ PolynomialsRT_Bubbles::compute( // monoval_i = x^i, // monoval_plus = x^(k+1) for (unsigned int d = 0; d < dim; ++d) - monomials[my_degree + 1].value( - unit_point(d), n_derivatives, monoval_plus[d]); + monomials[my_degree + 1].value(unit_point(d), + n_derivatives, + monoval_plus[d]); for (unsigned int i = 0; i <= my_degree; ++i, ++start) { @@ -209,8 +210,9 @@ PolynomialsRT_Bubbles::compute( // monoval_* = x^*, monoval_jplus = x^(j+1) for (unsigned int d = 0; d < dim; ++d) { - monomials[my_degree + 1].value( - unit_point(d), n_derivatives, monoval_plus[d]); + monomials[my_degree + 1].value(unit_point(d), + n_derivatives, + monoval_plus[d]); monomials[my_degree].value(unit_point(d), n_derivatives, monoval[d]); } @@ -225,10 +227,12 @@ PolynomialsRT_Bubbles::compute( { for (unsigned int d = 0; d < dim; ++d) { - monomials[j].value( - unit_point(d), n_derivatives, monoval_j[d]); - monomials[j + 1].value( - unit_point(d), n_derivatives, monoval_jplus[d]); + monomials[j].value(unit_point(d), + n_derivatives, + monoval_j[d]); + monomials[j + 1].value(unit_point(d), + n_derivatives, + monoval_jplus[d]); } if (values.size() != 0) diff --git a/source/base/process_grid.cc b/source/base/process_grid.cc index 26c505c9b7..d0fecc6e44 100644 --- a/source/base/process_grid.cc +++ b/source/base/process_grid.cc @@ -79,13 +79,13 @@ namespace // finally, get the rows: int n_process_rows = Np / n_process_columns; - Assert( - n_process_columns >= 1 && n_process_rows >= 1 && - n_processes >= n_process_rows * n_process_columns, - ExcMessage("error in process grid: " + std::to_string(n_process_rows) + - "x" + std::to_string(n_process_columns) + "=" + - std::to_string(n_process_rows * n_process_columns) + - " out of " + std::to_string(n_processes))); + Assert(n_process_columns >= 1 && n_process_rows >= 1 && + n_processes >= n_process_rows * n_process_columns, + ExcMessage( + "error in process grid: " + std::to_string(n_process_rows) + "x" + + std::to_string(n_process_columns) + "=" + + std::to_string(n_process_rows * n_process_columns) + " out of " + + std::to_string(n_processes))); return std::make_pair(n_process_rows, n_process_columns); @@ -103,12 +103,12 @@ namespace Utilities { ProcessGrid::ProcessGrid( MPI_Comm mpi_comm, - const std::pair &grid_dimensions) : - mpi_communicator(mpi_comm), - this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)), - n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)), - n_process_rows(grid_dimensions.first), - n_process_columns(grid_dimensions.second) + const std::pair &grid_dimensions) + : mpi_communicator(mpi_comm) + , this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)) + , n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)) + , n_process_rows(grid_dimensions.first) + , n_process_columns(grid_dimensions.second) { Assert(grid_dimensions.first > 0, ExcMessage("Number of process grid rows has to be positive.")); @@ -208,21 +208,21 @@ namespace Utilities const unsigned int n_rows_matrix, const unsigned int n_columns_matrix, const unsigned int row_block_size, - const unsigned int column_block_size) : - ProcessGrid(mpi_comm, - compute_processor_grid_sizes(mpi_comm, - n_rows_matrix, - n_columns_matrix, - row_block_size, - column_block_size)) + const unsigned int column_block_size) + : ProcessGrid(mpi_comm, + compute_processor_grid_sizes(mpi_comm, + n_rows_matrix, + n_columns_matrix, + row_block_size, + column_block_size)) {} ProcessGrid::ProcessGrid(MPI_Comm mpi_comm, const unsigned int n_rows, - const unsigned int n_columns) : - ProcessGrid(mpi_comm, std::make_pair(n_rows, n_columns)) + const unsigned int n_columns) + : ProcessGrid(mpi_comm, std::make_pair(n_rows, n_columns)) {} diff --git a/source/base/quadrature.cc b/source/base/quadrature.cc index 4928497644..296e8dd99a 100644 --- a/source/base/quadrature.cc +++ b/source/base/quadrature.cc @@ -28,19 +28,19 @@ DEAL_II_NAMESPACE_OPEN template <> -Quadrature<0>::Quadrature(const unsigned int n_q) : - quadrature_points(n_q), - weights(n_q, 0), - is_tensor_product_flag(false) +Quadrature<0>::Quadrature(const unsigned int n_q) + : quadrature_points(n_q) + , weights(n_q, 0) + , is_tensor_product_flag(false) {} template -Quadrature::Quadrature(const unsigned int n_q) : - quadrature_points(n_q, Point()), - weights(n_q, 0), - is_tensor_product_flag(dim == 1) +Quadrature::Quadrature(const unsigned int n_q) + : quadrature_points(n_q, Point()) + , weights(n_q, 0) + , is_tensor_product_flag(dim == 1) {} @@ -59,10 +59,10 @@ Quadrature::initialize(const std::vector> &p, template Quadrature::Quadrature(const std::vector> &points, - const std::vector & weights) : - quadrature_points(points), - weights(weights), - is_tensor_product_flag(dim == 1) + const std::vector & weights) + : quadrature_points(points) + , weights(weights) + , is_tensor_product_flag(dim == 1) { Assert(weights.size() == points.size(), ExcDimensionMismatch(weights.size(), points.size())); @@ -71,10 +71,10 @@ Quadrature::Quadrature(const std::vector> &points, template -Quadrature::Quadrature(const std::vector> &points) : - quadrature_points(points), - weights(points.size(), std::numeric_limits::infinity()), - is_tensor_product_flag(dim == 1) +Quadrature::Quadrature(const std::vector> &points) + : quadrature_points(points) + , weights(points.size(), std::numeric_limits::infinity()) + , is_tensor_product_flag(dim == 1) { Assert(weights.size() == points.size(), ExcDimensionMismatch(weights.size(), points.size())); @@ -83,11 +83,11 @@ Quadrature::Quadrature(const std::vector> &points) : template -Quadrature::Quadrature(const Point &point) : - quadrature_points(std::vector>(1, point)), - weights(std::vector(1, 1.)), - is_tensor_product_flag(true), - tensor_basis(new std::array, dim>()) +Quadrature::Quadrature(const Point &point) + : quadrature_points(std::vector>(1, point)) + , weights(std::vector(1, 1.)) + , is_tensor_product_flag(true) + , tensor_basis(new std::array, dim>()) { for (unsigned int i = 0; i < dim; ++i) { @@ -99,10 +99,10 @@ Quadrature::Quadrature(const Point &point) : template <> -Quadrature<1>::Quadrature(const Point<1> &point) : - quadrature_points(std::vector>(1, point)), - weights(std::vector(1, 1.)), - is_tensor_product_flag(true) +Quadrature<1>::Quadrature(const Point<1> &point) + : quadrature_points(std::vector>(1, point)) + , weights(std::vector(1, 1.)) + , is_tensor_product_flag(true) {} @@ -116,10 +116,10 @@ Quadrature<0>::Quadrature(const SubQuadrature &, const Quadrature<1> &) template -Quadrature::Quadrature(const SubQuadrature &q1, const Quadrature<1> &q2) : - quadrature_points(q1.size() * q2.size()), - weights(q1.size() * q2.size()), - is_tensor_product_flag(q1.is_tensor_product()) +Quadrature::Quadrature(const SubQuadrature &q1, const Quadrature<1> &q2) + : quadrature_points(q1.size() * q2.size()) + , weights(q1.size() * q2.size()) + , is_tensor_product_flag(q1.is_tensor_product()) { unsigned int present_index = 0; for (unsigned int i2 = 0; i2 < q2.size(); ++i2) @@ -162,10 +162,10 @@ Quadrature::Quadrature(const SubQuadrature &q1, const Quadrature<1> &q2) : template <> -Quadrature<1>::Quadrature(const SubQuadrature &, const Quadrature<1> &q2) : - quadrature_points(q2.size()), - weights(q2.size()), - is_tensor_product_flag(true) +Quadrature<1>::Quadrature(const SubQuadrature &, const Quadrature<1> &q2) + : quadrature_points(q2.size()) + , weights(q2.size()) + , is_tensor_product_flag(true) { unsigned int present_index = 0; for (unsigned int i2 = 0; i2 < q2.size(); ++i2) @@ -197,16 +197,18 @@ Quadrature<1>::Quadrature(const SubQuadrature &, const Quadrature<1> &q2) : template <> -Quadrature<0>::Quadrature(const Quadrature<1> &) : - Subscriptor(), +Quadrature<0>::Quadrature(const Quadrature<1> &) + : Subscriptor() + , // quadrature_points(1), - weights(1, 1.), - is_tensor_product_flag(false) + weights(1, 1.) + , is_tensor_product_flag(false) {} template <> -Quadrature<1>::Quadrature(const Quadrature<0> &) : Subscriptor() +Quadrature<1>::Quadrature(const Quadrature<0> &) + : Subscriptor() { // this function should never be // called -- this should be the @@ -217,11 +219,11 @@ Quadrature<1>::Quadrature(const Quadrature<0> &) : Subscriptor() template -Quadrature::Quadrature(const Quadrature &q) : - Subscriptor(), - quadrature_points(Utilities::fixed_power(q.size())), - weights(Utilities::fixed_power(q.size())), - is_tensor_product_flag(true) +Quadrature::Quadrature(const Quadrature &q) + : Subscriptor() + , quadrature_points(Utilities::fixed_power(q.size())) + , weights(Utilities::fixed_power(q.size())) + , is_tensor_product_flag(true) { Assert(dim <= 3, ExcNotImplemented()); @@ -255,11 +257,11 @@ Quadrature::Quadrature(const Quadrature &q) : template -Quadrature::Quadrature(const Quadrature &q) : - Subscriptor(), - quadrature_points(q.quadrature_points), - weights(q.weights), - is_tensor_product_flag(q.is_tensor_product_flag) +Quadrature::Quadrature(const Quadrature &q) + : Subscriptor() + , quadrature_points(q.quadrature_points) + , weights(q.weights) + , is_tensor_product_flag(q.is_tensor_product_flag) { if (dim > 1 && is_tensor_product_flag) tensor_basis = @@ -338,8 +340,8 @@ Quadrature<1>::get_tensor_basis() const //--------------------------------------------------------------------------- template -QAnisotropic::QAnisotropic(const Quadrature<1> &qx) : - Quadrature(qx.size()) +QAnisotropic::QAnisotropic(const Quadrature<1> &qx) + : Quadrature(qx.size()) { Assert(dim == 1, ExcImpossibleInDim(dim)); unsigned int k = 0; @@ -356,8 +358,8 @@ QAnisotropic::QAnisotropic(const Quadrature<1> &qx) : template QAnisotropic::QAnisotropic(const Quadrature<1> &qx, - const Quadrature<1> &qy) : - Quadrature(qx.size() * qy.size()) + const Quadrature<1> &qy) + : Quadrature(qx.size() * qy.size()) { Assert(dim == 2, ExcImpossibleInDim(dim)); } @@ -365,9 +367,8 @@ QAnisotropic::QAnisotropic(const Quadrature<1> &qx, template <> -QAnisotropic<2>::QAnisotropic(const Quadrature<1> &qx, - const Quadrature<1> &qy) : - Quadrature<2>(qx.size() * qy.size()) +QAnisotropic<2>::QAnisotropic(const Quadrature<1> &qx, const Quadrature<1> &qy) + : Quadrature<2>(qx.size() * qy.size()) { unsigned int k = 0; for (unsigned int k2 = 0; k2 < qy.size(); ++k2) @@ -389,8 +390,8 @@ QAnisotropic<2>::QAnisotropic(const Quadrature<1> &qx, template QAnisotropic::QAnisotropic(const Quadrature<1> &qx, const Quadrature<1> &qy, - const Quadrature<1> &qz) : - Quadrature(qx.size() * qy.size() * qz.size()) + const Quadrature<1> &qz) + : Quadrature(qx.size() * qy.size() * qz.size()) { Assert(dim == 3, ExcImpossibleInDim(dim)); } @@ -400,8 +401,8 @@ QAnisotropic::QAnisotropic(const Quadrature<1> &qx, template <> QAnisotropic<3>::QAnisotropic(const Quadrature<1> &qx, const Quadrature<1> &qy, - const Quadrature<1> &qz) : - Quadrature<3>(qx.size() * qy.size() * qz.size()) + const Quadrature<1> &qz) + : Quadrature<3>(qx.size() * qy.size() * qz.size()) { unsigned int k = 0; for (unsigned int k3 = 0; k3 < qz.size(); ++k3) @@ -1069,8 +1070,9 @@ QProjector::project_to_child(const Quadrature &quadrature, std::vector> q_points(n_q_points); for (unsigned int i = 0; i < n_q_points; ++i) - q_points[i] = GeometryInfo::child_to_cell_coordinates( - quadrature.point(i), child_no); + q_points[i] = + GeometryInfo::child_to_cell_coordinates(quadrature.point(i), + child_no); // for the weights, things are // equally simple: copy them and @@ -1652,8 +1654,8 @@ namespace internal template <> -QIterated<0>::QIterated(const Quadrature<1> &, const unsigned int) : - Quadrature<0>() +QIterated<0>::QIterated(const Quadrature<1> &, const unsigned int) + : Quadrature<0>() { Assert(false, ExcNotImplemented()); } @@ -1662,11 +1664,11 @@ QIterated<0>::QIterated(const Quadrature<1> &, const unsigned int) : template <> QIterated<1>::QIterated(const Quadrature<1> &base_quadrature, - const unsigned int n_copies) : - Quadrature<1>( - internal::QIteratedImplementation::uses_both_endpoints(base_quadrature) ? - (base_quadrature.size() - 1) * n_copies + 1 : - base_quadrature.size() * n_copies) + const unsigned int n_copies) + : Quadrature<1>( + internal::QIteratedImplementation::uses_both_endpoints(base_quadrature) ? + (base_quadrature.size() - 1) * n_copies + 1 : + base_quadrature.size() * n_copies) { // fill(*this, base_quadrature, n_copies); Assert(base_quadrature.size() > 0, ExcNotInitialized()); @@ -1773,9 +1775,9 @@ QIterated<1>::QIterated(const Quadrature<1> &base_quadrature, // of lower dimensional iterated quadrature formulae template QIterated::QIterated(const Quadrature<1> &base_quadrature, - const unsigned int N) : - Quadrature(QIterated(base_quadrature, N), - QIterated<1>(base_quadrature, N)) + const unsigned int N) + : Quadrature(QIterated(base_quadrature, N), + QIterated<1>(base_quadrature, N)) {} diff --git a/source/base/quadrature_lib.cc b/source/base/quadrature_lib.cc index 78c2056d33..1e0ab46bb5 100644 --- a/source/base/quadrature_lib.cc +++ b/source/base/quadrature_lib.cc @@ -33,9 +33,9 @@ DEAL_II_NAMESPACE_OPEN template <> -QGauss<0>::QGauss(const unsigned int) : - // there are n_q^dim == 1 - // points +QGauss<0>::QGauss(const unsigned int) + : // there are n_q^dim == 1 + // points Quadrature<0>(1) { // the single quadrature point gets unit @@ -46,9 +46,9 @@ QGauss<0>::QGauss(const unsigned int) : template <> -QGaussLobatto<0>::QGaussLobatto(const unsigned int) : - // there are n_q^dim == 1 - // points +QGaussLobatto<0>::QGaussLobatto(const unsigned int) + : // there are n_q^dim == 1 + // points Quadrature<0>(1) { // the single quadrature point gets unit @@ -59,7 +59,8 @@ QGaussLobatto<0>::QGaussLobatto(const unsigned int) : template <> -QGauss<1>::QGauss(const unsigned int n) : Quadrature<1>(n) +QGauss<1>::QGauss(const unsigned int n) + : Quadrature<1>(n) { if (n == 0) return; @@ -137,7 +138,8 @@ namespace internal template <> -QGaussLobatto<1>::QGaussLobatto(const unsigned int n) : Quadrature<1>(n) +QGaussLobatto<1>::QGaussLobatto(const unsigned int n) + : Quadrature<1>(n) { Assert(n >= 2, ExcNotImplemented()); @@ -159,7 +161,8 @@ QGaussLobatto<1>::QGaussLobatto(const unsigned int n) : Quadrature<1>(n) template <> -QMidpoint<1>::QMidpoint() : Quadrature<1>(1) +QMidpoint<1>::QMidpoint() + : Quadrature<1>(1) { this->quadrature_points[0] = Point<1>(0.5); this->weights[0] = 1.0; @@ -168,7 +171,8 @@ QMidpoint<1>::QMidpoint() : Quadrature<1>(1) template <> -QTrapez<1>::QTrapez() : Quadrature<1>(2) +QTrapez<1>::QTrapez() + : Quadrature<1>(2) { static const double xpts[] = {0.0, 1.0}; static const double wts[] = {0.5, 0.5}; @@ -183,7 +187,8 @@ QTrapez<1>::QTrapez() : Quadrature<1>(2) template <> -QSimpson<1>::QSimpson() : Quadrature<1>(3) +QSimpson<1>::QSimpson() + : Quadrature<1>(3) { static const double xpts[] = {0.0, 0.5, 1.0}; static const double wts[] = {1. / 6., 2. / 3., 1. / 6.}; @@ -198,7 +203,8 @@ QSimpson<1>::QSimpson() : Quadrature<1>(3) template <> -QMilne<1>::QMilne() : Quadrature<1>(5) +QMilne<1>::QMilne() + : Quadrature<1>(5) { static const double xpts[] = {0.0, .25, .5, .75, 1.0}; static const double wts[] = { @@ -214,7 +220,8 @@ QMilne<1>::QMilne() : Quadrature<1>(5) template <> -QWeddle<1>::QWeddle() : Quadrature<1>(7) +QWeddle<1>::QWeddle() + : Quadrature<1>(7) { static const double xpts[] = { 0.0, 1. / 6., 1. / 3., .5, 2. / 3., 5. / 6., 1.0}; @@ -235,8 +242,8 @@ QWeddle<1>::QWeddle() : Quadrature<1>(7) template <> -QGaussLog<1>::QGaussLog(const unsigned int n, const bool revert) : - Quadrature<1>(n) +QGaussLog<1>::QGaussLog(const unsigned int n, const bool revert) + : Quadrature<1>(n) { std::vector p = get_quadrature_points(n); std::vector w = get_quadrature_weights(n); @@ -521,10 +528,10 @@ template <> QGaussLogR<1>::QGaussLogR(const unsigned int n, const Point<1> origin, const double alpha, - const bool factor_out_singularity) : - Quadrature<1>( - ((origin[0] == 0) || (origin[0] == 1)) ? (alpha == 1 ? n : 2 * n) : 4 * n), - fraction(((origin[0] == 0) || (origin[0] == 1.)) ? 1. : origin[0]) + const bool factor_out_singularity) + : Quadrature<1>( + ((origin[0] == 0) || (origin[0] == 1)) ? (alpha == 1 ? n : 2 * n) : 4 * n) + , fraction(((origin[0] == 0) || (origin[0] == 1.)) ? 1. : origin[0]) { // The three quadrature formulas that make this one up. There are // at most two when the origin is one of the extremes, and there is @@ -621,8 +628,8 @@ QGaussOneOverR<2>::quad_size(const Point<2> singularity, const unsigned int n) template <> QGaussOneOverR<2>::QGaussOneOverR(const unsigned int n, const Point<2> singularity, - const bool factor_out_singularity) : - Quadrature<2>(quad_size(singularity, n)) + const bool factor_out_singularity) + : Quadrature<2>(quad_size(singularity, n)) { // We treat all the cases in the // same way. Split the element in 4 @@ -670,8 +677,8 @@ QGaussOneOverR<2>::QGaussOneOverR(const unsigned int n, template <> QGaussOneOverR<2>::QGaussOneOverR(const unsigned int n, const unsigned int vertex_index, - const bool factor_out_singularity) : - Quadrature<2>(2 * n * n) + const bool factor_out_singularity) + : Quadrature<2>(2 * n * n) { // This version of the constructor // works only for the 4 @@ -758,7 +765,8 @@ QGaussOneOverR<2>::QGaussOneOverR(const unsigned int n, template -QSorted::QSorted(const Quadrature &quad) : Quadrature(quad) +QSorted::QSorted(const Quadrature &quad) + : Quadrature(quad) { std::vector permutation(quad.size()); for (unsigned int i = 0; i < quad.size(); ++i) @@ -800,53 +808,57 @@ QSorted::compare_weights(const unsigned int a, const unsigned int b) const // tensor product of lower dimensions template -QGauss::QGauss(const unsigned int n) : - Quadrature(QGauss(n), QGauss<1>(n)) +QGauss::QGauss(const unsigned int n) + : Quadrature(QGauss(n), QGauss<1>(n)) {} template -QGaussLobatto::QGaussLobatto(const unsigned int n) : - Quadrature(QGaussLobatto(n), QGaussLobatto<1>(n)) +QGaussLobatto::QGaussLobatto(const unsigned int n) + : Quadrature(QGaussLobatto(n), QGaussLobatto<1>(n)) {} template -QMidpoint::QMidpoint() : - Quadrature(QMidpoint(), QMidpoint<1>()) +QMidpoint::QMidpoint() + : Quadrature(QMidpoint(), QMidpoint<1>()) {} template -QTrapez::QTrapez() : Quadrature(QTrapez(), QTrapez<1>()) +QTrapez::QTrapez() + : Quadrature(QTrapez(), QTrapez<1>()) {} template -QSimpson::QSimpson() : Quadrature(QSimpson(), QSimpson<1>()) +QSimpson::QSimpson() + : Quadrature(QSimpson(), QSimpson<1>()) {} template -QMilne::QMilne() : Quadrature(QMilne(), QMilne<1>()) +QMilne::QMilne() + : Quadrature(QMilne(), QMilne<1>()) {} template -QWeddle::QWeddle() : Quadrature(QWeddle(), QWeddle<1>()) +QWeddle::QWeddle() + : Quadrature(QWeddle(), QWeddle<1>()) {} template QTelles::QTelles(const Quadrature<1> &base_quad, - const Point & singularity) : - // We need the explicit implementation if dim == 1. If dim > 1 we use the - // former implementation and apply a tensorial product to obtain the higher - // dimensions. + const Point & singularity) + : // We need the explicit implementation if dim == 1. If dim > 1 we use the + // former implementation and apply a tensorial product to obtain the higher + // dimensions. Quadrature( dim == 2 ? QAnisotropic(QTelles<1>(base_quad, Point<1>(singularity[0])), @@ -859,18 +871,17 @@ QTelles::QTelles(const Quadrature<1> &base_quad, {} template -QTelles::QTelles(const unsigned int n, const Point &singularity) : - // In this case we map the standard Gauss Legendre formula using the given - // singularity point coordinates. +QTelles::QTelles(const unsigned int n, const Point &singularity) + : // In this case we map the standard Gauss Legendre formula using the given + // singularity point coordinates. Quadrature(QTelles(QGauss<1>(n), singularity)) {} template <> -QTelles<1>::QTelles(const Quadrature<1> &base_quad, - const Point<1> & singularity) : - // We explicitly implement the Telles' variable change if dim == 1. +QTelles<1>::QTelles(const Quadrature<1> &base_quad, const Point<1> &singularity) + : // We explicitly implement the Telles' variable change if dim == 1. Quadrature<1>(base_quad) { // We define all the constants to be used in the implementation of @@ -989,7 +1000,8 @@ namespace internal template <> -QGaussChebyshev<1>::QGaussChebyshev(const unsigned int n) : Quadrature<1>(n) +QGaussChebyshev<1>::QGaussChebyshev(const unsigned int n) + : Quadrature<1>(n) { Assert(n > 0, ExcMessage("Need at least one point for the quadrature rule")); std::vector p = internal::QGaussChebyshev::get_quadrature_points(n); @@ -1004,8 +1016,8 @@ QGaussChebyshev<1>::QGaussChebyshev(const unsigned int n) : Quadrature<1>(n) template -QGaussChebyshev::QGaussChebyshev(const unsigned int n) : - Quadrature(QGaussChebyshev<1>(n)) +QGaussChebyshev::QGaussChebyshev(const unsigned int n) + : Quadrature(QGaussChebyshev<1>(n)) {} @@ -1084,10 +1096,9 @@ namespace internal template <> -QGaussRadauChebyshev<1>::QGaussRadauChebyshev(const unsigned int n, - EndPoint ep) : - Quadrature<1>(n), - ep(ep) +QGaussRadauChebyshev<1>::QGaussRadauChebyshev(const unsigned int n, EndPoint ep) + : Quadrature<1>(n) + , ep(ep) { Assert(n > 0, ExcMessage("Need at least one point for quadrature rules")); std::vector p = @@ -1105,11 +1116,11 @@ QGaussRadauChebyshev<1>::QGaussRadauChebyshev(const unsigned int n, template QGaussRadauChebyshev::QGaussRadauChebyshev(const unsigned int n, - EndPoint ep) : - Quadrature(QGaussRadauChebyshev<1>( - n, - static_cast::EndPoint>(ep))), - ep(ep) + EndPoint ep) + : Quadrature(QGaussRadauChebyshev<1>( + n, + static_cast::EndPoint>(ep))) + , ep(ep) {} @@ -1157,12 +1168,12 @@ namespace internal template <> -QGaussLobattoChebyshev<1>::QGaussLobattoChebyshev(const unsigned int n) : - Quadrature<1>(n) +QGaussLobattoChebyshev<1>::QGaussLobattoChebyshev(const unsigned int n) + : Quadrature<1>(n) { - Assert( - n > 1, - ExcMessage("Need at least two points for Gauss-Lobatto quadrature rule")); + Assert(n > 1, + ExcMessage( + "Need at least two points for Gauss-Lobatto quadrature rule")); std::vector p = internal::QGaussLobattoChebyshev::get_quadrature_points(n); std::vector w = @@ -1177,8 +1188,8 @@ QGaussLobattoChebyshev<1>::QGaussLobattoChebyshev(const unsigned int n) : template -QGaussLobattoChebyshev::QGaussLobattoChebyshev(const unsigned int n) : - Quadrature(QGaussLobattoChebyshev<1>(n)) +QGaussLobattoChebyshev::QGaussLobattoChebyshev(const unsigned int n) + : Quadrature(QGaussLobattoChebyshev<1>(n)) {} @@ -1235,8 +1246,8 @@ QSimplex::compute_affine_transformation( QTrianglePolar::QTrianglePolar(const Quadrature<1> &radial_quadrature, - const Quadrature<1> &angular_quadrature) : - QSimplex<2>(Quadrature<2>()) + const Quadrature<1> &angular_quadrature) + : QSimplex<2>(Quadrature<2>()) { const QAnisotropic<2> base(radial_quadrature, angular_quadrature); this->quadrature_points.resize(base.size()); @@ -1264,16 +1275,16 @@ QTrianglePolar::QTrianglePolar(const Quadrature<1> &radial_quadrature, -QTrianglePolar::QTrianglePolar(const unsigned int &n) : - QTrianglePolar(QGauss<1>(n), QGauss<1>(n)) +QTrianglePolar::QTrianglePolar(const unsigned int &n) + : QTrianglePolar(QGauss<1>(n), QGauss<1>(n)) {} QDuffy::QDuffy(const Quadrature<1> &radial_quadrature, const Quadrature<1> &angular_quadrature, - const double beta) : - QSimplex<2>(Quadrature<2>()) + const double beta) + : QSimplex<2>(Quadrature<2>()) { const QAnisotropic<2> base(radial_quadrature, angular_quadrature); this->quadrature_points.resize(base.size()); @@ -1298,8 +1309,8 @@ QDuffy::QDuffy(const Quadrature<1> &radial_quadrature, -QDuffy::QDuffy(const unsigned int n, const double beta) : - QDuffy(QGauss<1>(n), QGauss<1>(n), beta) +QDuffy::QDuffy(const unsigned int n, const double beta) + : QDuffy(QGauss<1>(n), QGauss<1>(n), beta) {} @@ -1307,9 +1318,9 @@ QDuffy::QDuffy(const unsigned int n, const double beta) : template QSplit::QSplit(const QSimplex &base, const Point &split_point) { - AssertThrow( - GeometryInfo::is_inside_unit_cell(split_point, 1e-12), - ExcMessage("The split point should be inside the unit reference cell.")); + AssertThrow(GeometryInfo::is_inside_unit_cell(split_point, 1e-12), + ExcMessage( + "The split point should be inside the unit reference cell.")); std::array, dim + 1> vertices; vertices[0] = split_point; diff --git a/source/base/quadrature_selector.cc b/source/base/quadrature_selector.cc index df6c3f1222..d97d83395a 100644 --- a/source/base/quadrature_selector.cc +++ b/source/base/quadrature_selector.cc @@ -57,9 +57,9 @@ QuadratureSelector::create_quadrature(const std::string &s, template QuadratureSelector::QuadratureSelector(const std::string &s, - const unsigned int order) : - Quadrature(create_quadrature(s, order).get_points(), - create_quadrature(s, order).get_weights()) + const unsigned int order) + : Quadrature(create_quadrature(s, order).get_points(), + create_quadrature(s, order).get_weights()) {} diff --git a/source/base/subscriptor.cc b/source/base/subscriptor.cc index b54565f65f..a378ea911f 100644 --- a/source/base/subscriptor.cc +++ b/source/base/subscriptor.cc @@ -27,7 +27,9 @@ DEAL_II_NAMESPACE_OPEN static const char *unknown_subscriber = "unknown subscriber"; -Subscriptor::Subscriptor() : counter(0), object_info(nullptr) +Subscriptor::Subscriptor() + : counter(0) + , object_info(nullptr) { // this has to go somewhere to avoid an extra warning. (void)unknown_subscriber; @@ -35,14 +37,16 @@ Subscriptor::Subscriptor() : counter(0), object_info(nullptr) -Subscriptor::Subscriptor(const Subscriptor &) : counter(0), object_info(nullptr) +Subscriptor::Subscriptor(const Subscriptor &) + : counter(0) + , object_info(nullptr) {} -Subscriptor::Subscriptor(Subscriptor &&subscriptor) noexcept : - counter(0), - object_info(subscriptor.object_info) +Subscriptor::Subscriptor(Subscriptor &&subscriptor) noexcept + : counter(0) + , object_info(subscriptor.object_info) { subscriptor.check_no_subscribers(); } @@ -95,9 +99,10 @@ Subscriptor::check_no_subscribers() const noexcept if (infostring == "") infostring = ""; - AssertNothrow( - counter == 0, - ExcInUse(counter.load(), object_info->name(), infostring)); + AssertNothrow(counter == 0, + ExcInUse(counter.load(), + object_info->name(), + infostring)); } else { diff --git a/source/base/table_handler.cc b/source/base/table_handler.cc index 2ec27b1902..66b3090c65 100644 --- a/source/base/table_handler.cc +++ b/source/base/table_handler.cc @@ -134,24 +134,24 @@ namespace internal /* ------------------------------------------------ */ -TableHandler::Column::Column(const std::string &tex_caption) : - tex_caption(tex_caption), - tex_format("c"), - precision(4), - scientific(false), - flag(0), - max_length(0) +TableHandler::Column::Column(const std::string &tex_caption) + : tex_caption(tex_caption) + , tex_format("c") + , precision(4) + , scientific(false) + , flag(0) + , max_length(0) {} -TableHandler::Column::Column() : - tex_caption(), - tex_format("c"), - precision(4), - scientific(false), - flag(0), - max_length(0) +TableHandler::Column::Column() + : tex_caption() + , tex_format("c") + , precision(4) + , scientific(false) + , flag(0) + , max_length(0) {} @@ -196,7 +196,8 @@ TableHandler::Column::invalidate_cache() /*---------------------------------------------------------------------*/ -TableHandler::TableHandler() : auto_fill_mode(false) +TableHandler::TableHandler() + : auto_fill_mode(false) {} @@ -223,8 +224,9 @@ TableHandler::start_new_row() for (std::map::iterator p = columns.begin(); p != columns.end(); ++p) - max_col_length = std::max( - max_col_length, static_cast(p->second.entries.size())); + max_col_length = + std::max(max_col_length, + static_cast(p->second.entries.size())); // then pad all columns to that length with empty strings @@ -236,9 +238,10 @@ TableHandler::start_new_row() col->second.entries.emplace_back(""); internal::TableEntry &entry = col->second.entries.back(); entry.cache_string(col->second.scientific, col->second.precision); - col->second.max_length = std::max( - col->second.max_length, - static_cast(entry.get_cached_string().length())); + col->second.max_length = + std::max(col->second.max_length, + static_cast( + entry.get_cached_string().length())); } } diff --git a/source/base/tensor_product_polynomials.cc b/source/base/tensor_product_polynomials.cc index aadd565203..f656e485fc 100644 --- a/source/base/tensor_product_polynomials.cc +++ b/source/base/tensor_product_polynomials.cc @@ -85,8 +85,10 @@ TensorProductPolynomials::compute_index( { Assert(i < Utilities::fixed_power(polynomials.size()), ExcInternalError()); - internal::compute_tensor_index( - index_map[i], polynomials.size(), polynomials.size(), indices); + internal::compute_tensor_index(index_map[i], + polynomials.size(), + polynomials.size(), + indices); } @@ -298,8 +300,9 @@ TensorProductPolynomials::compute( else for (unsigned int i = 0; i < n_polynomials; ++i) for (unsigned d = 0; d < dim; ++d) - polynomials[i].value( - p(d), n_values_and_derivatives, &values_1d[i][d][0]); + polynomials[i].value(p(d), + n_values_and_derivatives, + &values_1d[i][d][0]); unsigned int indices[3]; unsigned int ind = 0; @@ -408,9 +411,9 @@ TensorProductPolynomials::compute( template AnisotropicPolynomials::AnisotropicPolynomials( - const std::vector>> &pols) : - polynomials(pols), - n_tensor_pols(get_n_tensor_pols(pols)) + const std::vector>> &pols) + : polynomials(pols) + , n_tensor_pols(get_n_tensor_pols(pols)) { Assert(pols.size() == dim, ExcDimensionMismatch(pols.size(), dim)); for (unsigned int d = 0; d < dim; ++d) @@ -434,11 +437,15 @@ AnisotropicPolynomials::compute_index(const unsigned int i, #endif if (dim == 1) - internal::compute_tensor_index( - i, polynomials[0].size(), 0 /*not used*/, indices); + internal::compute_tensor_index(i, + polynomials[0].size(), + 0 /*not used*/, + indices); else - internal::compute_tensor_index( - i, polynomials[0].size(), polynomials[1].size(), indices); + internal::compute_tensor_index(i, + polynomials[0].size(), + polynomials[1].size(), + indices); } diff --git a/source/base/tensor_product_polynomials_bubbles.cc b/source/base/tensor_product_polynomials_bubbles.cc index ab303aed43..c8525f1a2a 100644 --- a/source/base/tensor_product_polynomials_bubbles.cc +++ b/source/base/tensor_product_polynomials_bubbles.cc @@ -237,12 +237,14 @@ TensorProductPolynomialsBubbles::compute( ExcDimensionMismatch2(grad_grads.size(), max_q_indices + n_bubbles, 0)); Assert(third_derivatives.size() == max_q_indices + n_bubbles || third_derivatives.size() == 0, - ExcDimensionMismatch2( - third_derivatives.size(), max_q_indices + n_bubbles, 0)); + ExcDimensionMismatch2(third_derivatives.size(), + max_q_indices + n_bubbles, + 0)); Assert(fourth_derivatives.size() == max_q_indices + n_bubbles || fourth_derivatives.size() == 0, - ExcDimensionMismatch2( - fourth_derivatives.size(), max_q_indices + n_bubbles, 0)); + ExcDimensionMismatch2(fourth_derivatives.size(), + max_q_indices + n_bubbles, + 0)); bool do_values = false, do_grads = false, do_grad_grads = false; bool do_3rd_derivatives = false, do_4th_derivatives = false; diff --git a/source/base/tensor_product_polynomials_const.cc b/source/base/tensor_product_polynomials_const.cc index 44d6984c03..f59ef3298f 100644 --- a/source/base/tensor_product_polynomials_const.cc +++ b/source/base/tensor_product_polynomials_const.cc @@ -103,12 +103,14 @@ TensorProductPolynomialsConst::compute( ExcDimensionMismatch2(grad_grads.size(), this->n_tensor_pols + 1, 0)); Assert(third_derivatives.size() == this->n_tensor_pols + 1 || third_derivatives.size() == 0, - ExcDimensionMismatch2( - third_derivatives.size(), this->n_tensor_pols + 1, 0)); + ExcDimensionMismatch2(third_derivatives.size(), + this->n_tensor_pols + 1, + 0)); Assert(fourth_derivatives.size() == this->n_tensor_pols + 1 || fourth_derivatives.size() == 0, - ExcDimensionMismatch2( - fourth_derivatives.size(), this->n_tensor_pols + 1, 0)); + ExcDimensionMismatch2(fourth_derivatives.size(), + this->n_tensor_pols + 1, + 0)); // remove slot for const value, go into the base class compute method and // finally append the const value again diff --git a/source/base/thread_management.cc b/source/base/thread_management.cc index 07b9278747..cb504a5247 100644 --- a/source/base/thread_management.cc +++ b/source/base/thread_management.cc @@ -172,8 +172,8 @@ namespace Threads PosixThreadBarrier::PosixThreadBarrier(const unsigned int count, const char *, - void *) : - count(count) + void *) + : count(count) { // throw an exception unless we // have the special case that a diff --git a/source/base/timer.cc b/source/base/timer.cc index fb3517ea79..3de8a76218 100644 --- a/source/base/timer.cc +++ b/source/base/timer.cc @@ -136,10 +136,10 @@ CPUClock::now() noexcept template -Timer::ClockMeasurements::ClockMeasurements() : - current_lap_start_time(clock_type::now()), - accumulated_time(duration_type::zero()), - last_lap_time(duration_type::zero()) +Timer::ClockMeasurements::ClockMeasurements() + : current_lap_start_time(clock_type::now()) + , accumulated_time(duration_type::zero()) + , last_lap_time(duration_type::zero()) {} @@ -155,15 +155,16 @@ Timer::ClockMeasurements::reset() -Timer::Timer() : Timer(MPI_COMM_SELF, /*sync_lap_times=*/false) +Timer::Timer() + : Timer(MPI_COMM_SELF, /*sync_lap_times=*/false) {} -Timer::Timer(MPI_Comm mpi_communicator, const bool sync_lap_times_) : - running(false), - mpi_communicator(mpi_communicator), - sync_lap_times(sync_lap_times_) +Timer::Timer(MPI_Comm mpi_communicator, const bool sync_lap_times_) + : running(false) + , mpi_communicator(mpi_communicator) + , sync_lap_times(sync_lap_times_) { reset(); start(); @@ -200,9 +201,10 @@ Timer::stop() cpu_times.last_lap_time = cpu_clock_type::now() - cpu_times.current_lap_start_time; - last_lap_wall_time_data = Utilities::MPI::min_max_avg( - internal::TimerImplementation::to_seconds(wall_times.last_lap_time), - mpi_communicator); + last_lap_wall_time_data = + Utilities::MPI::min_max_avg(internal::TimerImplementation::to_seconds( + wall_times.last_lap_time), + mpi_communicator); if (sync_lap_times) { wall_times.last_lap_time = @@ -219,9 +221,10 @@ Timer::stop() } wall_times.accumulated_time += wall_times.last_lap_time; cpu_times.accumulated_time += cpu_times.last_lap_time; - accumulated_wall_time_data = Utilities::MPI::min_max_avg( - internal::TimerImplementation::to_seconds(wall_times.accumulated_time), - mpi_communicator); + accumulated_wall_time_data = + Utilities::MPI::min_max_avg(internal::TimerImplementation::to_seconds( + wall_times.accumulated_time), + mpi_communicator); } return internal::TimerImplementation::to_seconds(cpu_times.accumulated_time); } @@ -240,9 +243,9 @@ Timer::cpu_time() const } else { - return Utilities::MPI::sum( - internal::TimerImplementation::to_seconds(cpu_times.accumulated_time), - mpi_communicator); + return Utilities::MPI::sum(internal::TimerImplementation::to_seconds( + cpu_times.accumulated_time), + mpi_communicator); } } @@ -312,24 +315,24 @@ Timer::reset() TimerOutput::TimerOutput(std::ostream & stream, const OutputFrequency output_frequency, - const OutputType output_type) : - output_frequency(output_frequency), - output_type(output_type), - out_stream(stream, true), - output_is_enabled(true), - mpi_communicator(MPI_COMM_SELF) + const OutputType output_type) + : output_frequency(output_frequency) + , output_type(output_type) + , out_stream(stream, true) + , output_is_enabled(true) + , mpi_communicator(MPI_COMM_SELF) {} TimerOutput::TimerOutput(ConditionalOStream & stream, const OutputFrequency output_frequency, - const OutputType output_type) : - output_frequency(output_frequency), - output_type(output_type), - out_stream(stream), - output_is_enabled(true), - mpi_communicator(MPI_COMM_SELF) + const OutputType output_type) + : output_frequency(output_frequency) + , output_type(output_type) + , out_stream(stream) + , output_is_enabled(true) + , mpi_communicator(MPI_COMM_SELF) {} @@ -337,12 +340,12 @@ TimerOutput::TimerOutput(ConditionalOStream & stream, TimerOutput::TimerOutput(MPI_Comm mpi_communicator, std::ostream & stream, const OutputFrequency output_frequency, - const OutputType output_type) : - output_frequency(output_frequency), - output_type(output_type), - out_stream(stream, true), - output_is_enabled(true), - mpi_communicator(mpi_communicator) + const OutputType output_type) + : output_frequency(output_frequency) + , output_type(output_type) + , out_stream(stream, true) + , output_is_enabled(true) + , mpi_communicator(mpi_communicator) {} @@ -350,12 +353,12 @@ TimerOutput::TimerOutput(MPI_Comm mpi_communicator, TimerOutput::TimerOutput(MPI_Comm mpi_communicator, ConditionalOStream & stream, const OutputFrequency output_frequency, - const OutputType output_type) : - output_frequency(output_frequency), - output_type(output_type), - out_stream(stream), - output_is_enabled(true), - mpi_communicator(mpi_communicator) + const OutputType output_type) + : output_frequency(output_frequency) + , output_type(output_type) + , out_stream(stream) + , output_is_enabled(true) + , mpi_communicator(mpi_communicator) {} @@ -505,8 +508,9 @@ TimerOutput::leave_subsection(const std::string §ion_name) // delete the index from the list of // active ones - active_sections.erase(std::find( - active_sections.begin(), active_sections.end(), actual_section_name)); + active_sections.erase(std::find(active_sections.begin(), + active_sections.end(), + actual_section_name)); } diff --git a/source/base/utilities.cc b/source/base/utilities.cc index a32b9de10e..aca7488e66 100644 --- a/source/base/utilities.cc +++ b/source/base/utilities.cc @@ -216,9 +216,9 @@ namespace Utilities char *p; errno = 0; const int i = std::strtol(s.c_str(), &p, 10); - AssertThrow( - !((errno != 0) || (s.size() == 0) || ((s.size() > 0) && (*p != '\0'))), - ExcMessage("Can't convert <" + s + "> to an integer.")); + AssertThrow(!((errno != 0) || (s.size() == 0) || + ((s.size() > 0) && (*p != '\0'))), + ExcMessage("Can't convert <" + s + "> to an integer.")); return i; } @@ -255,9 +255,9 @@ namespace Utilities char *p; errno = 0; const double d = std::strtod(s.c_str(), &p); - AssertThrow( - !((errno != 0) || (s.size() == 0) || ((s.size() > 0) && (*p != '\0'))), - ExcMessage("Can't convert <" + s + "> to a double.")); + AssertThrow(!((errno != 0) || (s.size() == 0) || + ((s.size() > 0) && (*p != '\0'))), + ExcMessage("Can't convert <" + s + "> to a double.")); return d; } diff --git a/source/distributed/grid_refinement.cc b/source/distributed/grid_refinement.cc index 3b4d218627..6de9b6a6b8 100644 --- a/source/distributed/grid_refinement.cc +++ b/source/distributed/grid_refinement.cc @@ -253,10 +253,12 @@ namespace // count how many of our own elements would be above this threshold // and then add to it the number for all the others - unsigned int my_count = std::count_if( - criteria.begin(), criteria.end(), [test_threshold](const double c) { - return c > test_threshold; - }); + unsigned int my_count = + std::count_if(criteria.begin(), + criteria.end(), + [test_threshold](const double c) { + return c > test_threshold; + }); unsigned int total_count; ierr = MPI_Reduce(&my_count, diff --git a/source/distributed/p4est_wrappers.cc b/source/distributed/p4est_wrappers.cc index 5170a059d5..50eea5d56c 100644 --- a/source/distributed/p4est_wrappers.cc +++ b/source/distributed/p4est_wrappers.cc @@ -90,8 +90,9 @@ namespace internal { typename dealii::parallel::distributed:: Triangulation::cell_iterator cell = - cell_from_quad( - triangulation, sides[i].treeid, *(sides[i].quad)); + cell_from_quad(triangulation, + sides[i].treeid, + *(sides[i].quad)); Assert(cell->is_ghost(), ExcMessage("ghost quad did not find ghost cell")); dealii::types::subdomain_id *subid = @@ -115,8 +116,9 @@ namespace internal { typename dealii::parallel::distributed:: Triangulation::cell_iterator cell = - cell_from_quad( - triangulation, sides[i].treeid, *(sides[i].quad)); + cell_from_quad(triangulation, + sides[i].treeid, + *(sides[i].quad)); Assert(!cell->is_ghost(), ExcMessage("local quad found ghost cell")); diff --git a/source/distributed/shared_tria.cc b/source/distributed/shared_tria.cc index cdaa2f47c9..76710b5294 100644 --- a/source/distributed/shared_tria.cc +++ b/source/distributed/shared_tria.cc @@ -41,12 +41,12 @@ namespace parallel const typename dealii::Triangulation::MeshSmoothing smooth_grid, const bool allow_artificial_cells, - const Settings settings) : - dealii::parallel::Triangulation(mpi_communicator, - smooth_grid, - false), - settings(settings), - allow_artificial_cells(allow_artificial_cells) + const Settings settings) + : dealii::parallel::Triangulation(mpi_communicator, + smooth_grid, + false) + , settings(settings) + , allow_artificial_cells(allow_artificial_cells) { const auto partition_settings = (partition_zoltan | partition_metis | partition_zorder | @@ -102,13 +102,13 @@ namespace parallel if (partition_settings == partition_zoltan) { # ifndef DEAL_II_TRILINOS_WITH_ZOLTAN - AssertThrow( - false, - ExcMessage("Choosing 'partition_zoltan' requires the library " - "to be compiled with support for Zoltan! " - "Instead, you might use 'partition_auto' to select " - "a partitioning algorithm that is supported " - "by your current configuration.")); + AssertThrow(false, + ExcMessage( + "Choosing 'partition_zoltan' requires the library " + "to be compiled with support for Zoltan! " + "Instead, you might use 'partition_auto' to select " + "a partitioning algorithm that is supported " + "by your current configuration.")); # else GridTools::partition_triangulation( this->n_subdomains, *this, SparsityTools::Partitioner::zoltan); @@ -117,16 +117,17 @@ namespace parallel else if (partition_settings == partition_metis) { # ifndef DEAL_II_WITH_METIS - AssertThrow( - false, - ExcMessage("Choosing 'partition_metis' requires the library " - "to be compiled with support for METIS! " - "Instead, you might use 'partition_auto' to select " - "a partitioning algorithm that is supported " - "by your current configuration.")); + AssertThrow(false, + ExcMessage( + "Choosing 'partition_metis' requires the library " + "to be compiled with support for METIS! " + "Instead, you might use 'partition_auto' to select " + "a partitioning algorithm that is supported " + "by your current configuration.")); # else - GridTools::partition_triangulation( - this->n_subdomains, *this, SparsityTools::Partitioner::metis); + GridTools::partition_triangulation(this->n_subdomains, + *this, + SparsityTools::Partitioner::metis); # endif } else if (partition_settings == partition_zorder) diff --git a/source/distributed/solution_transfer.cc b/source/distributed/solution_transfer.cc index c4beaa56ed..05e60d7461 100644 --- a/source/distributed/solution_transfer.cc +++ b/source/distributed/solution_transfer.cc @@ -46,9 +46,9 @@ namespace parallel { template SolutionTransfer::SolutionTransfer( - const DoFHandlerType &dof) : - dof_handler(&dof, typeid(*this).name()), - handle(numbers::invalid_unsigned_int) + const DoFHandlerType &dof) + : dof_handler(&dof, typeid(*this).name()) + , handle(numbers::invalid_unsigned_int) { Assert( (dynamic_cast::cell_iterator cell( - tria, i, dealii_index); + typename Triangulation::cell_iterator cell(tria, + i, + dealii_index); if (cell->has_children() == false) { cell->clear_coarsen_flag(); @@ -561,8 +562,9 @@ namespace dealii_index = cell->child_index(child_id); } - typename Triangulation::cell_iterator cell( - tria, l, dealii_index); + typename Triangulation::cell_iterator cell(tria, + l, + dealii_index); if (cell->has_children()) delete_all_children(cell); else @@ -909,8 +911,8 @@ namespace template PartitionWeights::PartitionWeights( - const std::vector &cell_weights) : - cell_weights_list(cell_weights) + const std::vector &cell_weights) + : cell_weights_list(cell_weights) { // set the current pointer to the first element of the list, given that // we will walk through it sequentially @@ -1134,10 +1136,10 @@ namespace parallel MPI_Comm mpi_communicator, const typename dealii::Triangulation::MeshSmoothing smooth_grid, - const Settings settings_) : - // Do not check for distorted cells. - // For multigrid, we need limit_level_difference_at_vertices - // to make sure the transfer operators only need to consider two levels. + const Settings settings_) + : // Do not check for distorted cells. + // For multigrid, we need limit_level_difference_at_vertices + // to make sure the transfer operators only need to consider two levels. dealii::parallel::Triangulation( mpi_communicator, (settings_ & construct_multigrid_hierarchy) ? @@ -1146,12 +1148,12 @@ namespace parallel smooth_grid | Triangulation::limit_level_difference_at_vertices) : smooth_grid, - false), - settings(settings_), - triangulation_has_content(false), - connectivity(nullptr), - parallel_forest(nullptr), - cell_attached_data({0, 0, 0, {}}) + false) + , settings(settings_) + , triangulation_has_content(false) + , connectivity(nullptr) + , parallel_forest(nullptr) + , cell_attached_data({0, 0, 0, {}}) { parallel_ghost = nullptr; } @@ -1280,8 +1282,9 @@ namespace parallel std::memcpy(ptr, &num_cells, sizeof(unsigned int)); ptr += sizeof(unsigned int); - std::memcpy( - ptr, tree_index.data(), num_cells * sizeof(unsigned int)); + std::memcpy(ptr, + tree_index.data(), + num_cells * sizeof(unsigned int)); ptr += num_cells * sizeof(unsigned int); std::memcpy( @@ -1318,11 +1321,11 @@ namespace parallel ptr += sizeof(unsigned int) * cells; quadrants.resize(cells); - memcpy( - quadrants.data(), - ptr, - sizeof(typename dealii::internal::p4est::types::quadrant) * - cells); + memcpy(quadrants.data(), + ptr, + sizeof( + typename dealii::internal::p4est::types::quadrant) * + cells); ptr += sizeof(typename dealii::internal::p4est::types::quadrant) * cells; @@ -1663,8 +1666,9 @@ namespace parallel { Assert(parallel_forest != nullptr, ExcMessage("Can't produce output when no forest is created yet.")); - dealii::internal::p4est::functions::vtk_write_file( - parallel_forest, nullptr, file_basename); + dealii::internal::p4est::functions::vtk_write_file(parallel_forest, + nullptr, + file_basename); } @@ -1729,8 +1733,10 @@ namespace parallel // and release the data void *userptr = parallel_forest->user_pointer; - dealii::internal::p4est::functions::reset_data( - parallel_forest, 0, nullptr, nullptr); + dealii::internal::p4est::functions::reset_data(parallel_forest, + 0, + nullptr, + nullptr); parallel_forest->user_pointer = userptr; } @@ -1850,9 +1856,9 @@ namespace parallel unsigned int Triangulation::get_checksum() const { - Assert( - parallel_forest != nullptr, - ExcMessage("Can't produce a check sum when no forest is created yet.")); + Assert(parallel_forest != nullptr, + ExcMessage( + "Can't produce a check sum when no forest is created yet.")); return dealii::internal::p4est::functions::checksum(parallel_forest); } @@ -1905,8 +1911,10 @@ namespace parallel unsigned int>>> vertex_to_cell; get_vertex_to_cell_mappings(*this, vertex_touch_count, vertex_to_cell); - const dealii::internal::p4est::types<2>::locidx num_vtt = std::accumulate( - vertex_touch_count.begin(), vertex_touch_count.end(), 0u); + const dealii::internal::p4est::types<2>::locidx num_vtt = + std::accumulate(vertex_touch_count.begin(), + vertex_touch_count.end(), + 0u); // now create a connectivity object with the right sizes for all // arrays. set vertex information only in debug mode (saves a few bytes @@ -1970,8 +1978,10 @@ namespace parallel unsigned int>>> vertex_to_cell; get_vertex_to_cell_mappings(*this, vertex_touch_count, vertex_to_cell); - const dealii::internal::p4est::types<2>::locidx num_vtt = std::accumulate( - vertex_touch_count.begin(), vertex_touch_count.end(), 0u); + const dealii::internal::p4est::types<2>::locidx num_vtt = + std::accumulate(vertex_touch_count.begin(), + vertex_touch_count.end(), + 0u); // now create a connectivity object with the right sizes for all // arrays. set vertex information only in debug mode (saves a few bytes @@ -2032,8 +2042,10 @@ namespace parallel std::pair::active_cell_iterator, unsigned int>>> vertex_to_cell; get_vertex_to_cell_mappings(*this, vertex_touch_count, vertex_to_cell); - const dealii::internal::p4est::types<2>::locidx num_vtt = std::accumulate( - vertex_touch_count.begin(), vertex_touch_count.end(), 0u); + const dealii::internal::p4est::types<2>::locidx num_vtt = + std::accumulate(vertex_touch_count.begin(), + vertex_touch_count.end(), + 0u); std::vector edge_touch_count; std::vector( - this, coarse_cell_index, *quadr, ghost_owner); + match_quadrant(this, + coarse_cell_index, + *quadr, + ghost_owner); } // fix all the flags to make sure we have a consistent mesh @@ -2777,10 +2791,10 @@ namespace parallel cell != this->end(); ++cell) if (cell->is_locally_owned() && cell->refine_flag_set()) - Assert( - cell->refine_flag_set() == - RefinementPossibilities::isotropic_refinement, - ExcMessage("This class does not support anisotropic refinement")); + Assert(cell->refine_flag_set() == + RefinementPossibilities::isotropic_refinement, + ExcMessage( + "This class does not support anisotropic refinement")); # endif @@ -3071,9 +3085,9 @@ namespace parallel Triangulation::communicate_locally_moved_vertices( const std::vector &vertex_locally_moved) { - Assert( - vertex_locally_moved.size() == this->n_vertices(), - ExcDimensionMismatch(vertex_locally_moved.size(), this->n_vertices())); + Assert(vertex_locally_moved.size() == this->n_vertices(), + ExcDimensionMismatch(vertex_locally_moved.size(), + this->n_vertices())); # ifdef DEBUG { const std::vector locally_owned_vertices = @@ -3208,14 +3222,14 @@ namespace parallel dealii::internal::p4est::init_coarse_quadrant( p4est_coarse_cell); - CommunicateLocallyMovedVertices:: - set_vertices_recursively( - *this, - p4est_coarse_cell, - cell, - cellinfo.quadrants[c], - cellinfo.first_vertices[c], - cellinfo.first_vertex_indices[c]); + CommunicateLocallyMovedVertices::set_vertices_recursively< + dim, + spacedim>(*this, + p4est_coarse_cell, + cell, + cellinfo.quadrants[c], + cellinfo.first_vertices[c], + cellinfo.first_vertex_indices[c]); } } @@ -3364,8 +3378,10 @@ namespace parallel // and release the data void *userptr = parallel_forest->user_pointer; - dealii::internal::p4est::functions::reset_data( - parallel_forest, 0, nullptr, nullptr); + dealii::internal::p4est::functions::reset_data(parallel_forest, + 0, + nullptr, + nullptr); parallel_forest->user_pointer = userptr; } } @@ -3398,9 +3414,9 @@ namespace parallel { Assert(dim > 1, ExcNotImplemented()); - return dealii::internal::p4est:: - compute_vertices_with_ghost_neighbors( - *this, this->parallel_forest, this->parallel_ghost); + return dealii::internal::p4est::compute_vertices_with_ghost_neighbors< + dim, + spacedim>(*this, this->parallel_forest, this->parallel_ghost); } @@ -3717,10 +3733,10 @@ namespace parallel // separate) triangulation_has_content = true; - Assert( - other_tria.n_levels() == 1, - ExcMessage("Parallel distributed triangulations can only be copied, " - "if they are not refined!")); + Assert(other_tria.n_levels() == 1, + ExcMessage( + "Parallel distributed triangulations can only be copied, " + "if they are not refined!")); if (const dealii::parallel::distributed::Triangulation *other_tria_x = @@ -3969,10 +3985,10 @@ namespace parallel MPI_Comm mpi_communicator, const typename dealii::Triangulation<1, spacedim>::MeshSmoothing smooth_grid, - const Settings /*settings*/) : - dealii::parallel::Triangulation<1, spacedim>(mpi_communicator, - smooth_grid, - false) + const Settings /*settings*/) + : dealii::parallel::Triangulation<1, spacedim>(mpi_communicator, + smooth_grid, + false) { Assert(false, ExcNotImplemented()); } diff --git a/source/distributed/tria_base.cc b/source/distributed/tria_base.cc index 5e736baf67..6b8c6be65a 100644 --- a/source/distributed/tria_base.cc +++ b/source/distributed/tria_base.cc @@ -44,12 +44,12 @@ namespace parallel MPI_Comm mpi_communicator, const typename dealii::Triangulation::MeshSmoothing smooth_grid, - const bool check_for_distorted_cells) : - dealii::Triangulation(smooth_grid, - check_for_distorted_cells), - mpi_communicator(mpi_communicator), - my_subdomain(Utilities::MPI::this_mpi_process(this->mpi_communicator)), - n_subdomains(Utilities::MPI::n_mpi_processes(this->mpi_communicator)) + const bool check_for_distorted_cells) + : dealii::Triangulation(smooth_grid, + check_for_distorted_cells) + , mpi_communicator(mpi_communicator) + , my_subdomain(Utilities::MPI::this_mpi_process(this->mpi_communicator)) + , n_subdomains(Utilities::MPI::n_mpi_processes(this->mpi_communicator)) { #ifndef DEAL_II_WITH_MPI Assert(false, @@ -116,9 +116,9 @@ namespace parallel } template - Triangulation::NumberCache::NumberCache() : - n_global_active_cells(0), - n_global_levels(0) + Triangulation::NumberCache::NumberCache() + : n_global_active_cells(0) + , n_global_levels(0) {} template diff --git a/source/dofs/dof_accessor.cc b/source/dofs/dof_accessor.cc index 8a4b5b3f42..008758fadf 100644 --- a/source/dofs/dof_accessor.cc +++ b/source/dofs/dof_accessor.cc @@ -61,9 +61,9 @@ DoFInvalidAccessor::DoFInvalidAccessor( template DoFInvalidAccessor::DoFInvalidAccessor( - const DoFInvalidAccessor &i) : - InvalidAccessor( - static_cast &>(i)) + const DoFInvalidAccessor &i) + : InvalidAccessor( + static_cast &>(i)) { Assert(false, ExcMessage("You are attempting an illegal conversion between " diff --git a/source/dofs/dof_accessor_get.cc b/source/dofs/dof_accessor_get.cc index d99971712a..6b8aeabdfa 100644 --- a/source/dofs/dof_accessor_get.cc +++ b/source/dofs/dof_accessor_get.cc @@ -88,17 +88,17 @@ DoFCellAccessor::get_interpolated_dof_values( // mesh). consequently, we cannot interpolate from children's FE // space to this cell's (unknown) FE space unless an explicit // fe_index is given - Assert( - (dynamic_cast *>( - this->dof_handler) != nullptr) || - (fe_index != DoFHandlerType::default_fe_index), - ExcMessage("You cannot call this function on non-active cells " - "of hp::DoFHandler objects unless you provide an explicit " - "finite element index because they do not have naturally " - "associated finite element spaces associated: degrees " - "of freedom are only distributed on active cells for which " - "the active_fe_index has been set.")); + Assert((dynamic_cast *>( + this->dof_handler) != nullptr) || + (fe_index != DoFHandlerType::default_fe_index), + ExcMessage( + "You cannot call this function on non-active cells " + "of hp::DoFHandler objects unless you provide an explicit " + "finite element index because they do not have naturally " + "associated finite element spaces associated: degrees " + "of freedom are only distributed on active cells for which " + "the active_fe_index has been set.")); const FiniteElement &fe = this->get_dof_handler().get_fe(fe_index); @@ -155,8 +155,9 @@ DoFCellAccessor::get_interpolated_dof_values( // interpolation itself either from its own children or // by interpolating from the finite element on an active // child to the finite element space requested here - this->child(child)->get_interpolated_dof_values( - values, tmp1, fe_index); + this->child(child)->get_interpolated_dof_values(values, + tmp1, + fe_index); // interpolate these to the mother cell fe.get_restriction_matrix(child, this->refinement_case()) .vmult(tmp2, tmp1); diff --git a/source/dofs/dof_accessor_get.inst.in b/source/dofs/dof_accessor_get.inst.in index 3f0ca2cfe6..2c236318c4 100644 --- a/source/dofs/dof_accessor_get.inst.in +++ b/source/dofs/dof_accessor_get.inst.in @@ -18,9 +18,9 @@ for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS; lda : BOOL) { template void DoFCellAccessor, lda>:: - get_interpolated_dof_values( - const VEC &, Vector &, const unsigned int fe_index) - const; + get_interpolated_dof_values(const VEC &, + Vector &, + const unsigned int fe_index) const; #if deal_II_dimension != 3 @@ -46,9 +46,9 @@ for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS; lda : BOOL) for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS; lda : BOOL) { template void DoFCellAccessor, lda>:: - get_interpolated_dof_values( - const VEC &, Vector &, const unsigned int fe_index) - const; + get_interpolated_dof_values(const VEC &, + Vector &, + const unsigned int fe_index) const; #if deal_II_dimension != 3 diff --git a/source/dofs/dof_accessor_set.cc b/source/dofs/dof_accessor_set.cc index c6d75c65f6..2c63ef8790 100644 --- a/source/dofs/dof_accessor_set.cc +++ b/source/dofs/dof_accessor_set.cc @@ -87,17 +87,17 @@ DoFCellAccessor::set_dof_values_by_interpolation( else // otherwise distribute them to the children { - Assert( - (dynamic_cast *>( - this->dof_handler) != nullptr) || - (fe_index != DoFHandlerType::default_fe_index), - ExcMessage("You cannot call this function on non-active cells " - "of hp::DoFHandler objects unless you provide an explicit " - "finite element index because they do not have naturally " - "associated finite element spaces associated: degrees " - "of freedom are only distributed on active cells for which " - "the active_fe_index has been set.")); + Assert((dynamic_cast *>( + this->dof_handler) != nullptr) || + (fe_index != DoFHandlerType::default_fe_index), + ExcMessage( + "You cannot call this function on non-active cells " + "of hp::DoFHandler objects unless you provide an explicit " + "finite element index because they do not have naturally " + "associated finite element spaces associated: degrees " + "of freedom are only distributed on active cells for which " + "the active_fe_index has been set.")); const FiniteElement &fe = this->get_dof_handler().get_fe(fe_index); @@ -117,8 +117,9 @@ DoFCellAccessor::set_dof_values_by_interpolation( if (tmp.size() > 0) fe.get_prolongation_matrix(child, this->refinement_case()) .vmult(tmp, local_values); - this->child(child)->set_dof_values_by_interpolation( - tmp, values, fe_index); + this->child(child)->set_dof_values_by_interpolation(tmp, + values, + fe_index); } } } diff --git a/source/dofs/dof_accessor_set.inst.in b/source/dofs/dof_accessor_set.inst.in index 958e46f14e..9f19991b14 100644 --- a/source/dofs/dof_accessor_set.inst.in +++ b/source/dofs/dof_accessor_set.inst.in @@ -18,9 +18,9 @@ for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS; lda : BOOL) { template void DoFCellAccessor, lda>:: - set_dof_values_by_interpolation( - const Vector &, VEC &, const unsigned int fe_index) - const; + set_dof_values_by_interpolation(const Vector &, + VEC &, + const unsigned int fe_index) const; #if deal_II_dimension != 3 @@ -46,9 +46,9 @@ for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS; lda : BOOL) for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS; lda : BOOL) { template void DoFCellAccessor, lda>:: - set_dof_values_by_interpolation( - const Vector &, VEC &, const unsigned int fe_index) - const; + set_dof_values_by_interpolation(const Vector &, + VEC &, + const unsigned int fe_index) const; #if deal_II_dimension != 3 diff --git a/source/dofs/dof_handler.cc b/source/dofs/dof_handler.cc index 1de0ef9a2b..7da33fb08a 100644 --- a/source/dofs/dof_handler.cc +++ b/source/dofs/dof_handler.cc @@ -522,8 +522,9 @@ namespace internal Assert(min_level[vertex] < n_levels, ExcInternalError()); Assert(max_level[vertex] >= min_level[vertex], ExcInternalError()); - dof_handler.mg_vertex_dofs[vertex].init( - min_level[vertex], max_level[vertex], fe.dofs_per_vertex); + dof_handler.mg_vertex_dofs[vertex].init(min_level[vertex], + max_level[vertex], + fe.dofs_per_vertex); } else @@ -598,8 +599,9 @@ namespace internal Assert(min_level[vertex] < n_levels, ExcInternalError()); Assert(max_level[vertex] >= min_level[vertex], ExcInternalError()); - dof_handler.mg_vertex_dofs[vertex].init( - min_level[vertex], max_level[vertex], fe.dofs_per_vertex); + dof_handler.mg_vertex_dofs[vertex].init(min_level[vertex], + max_level[vertex], + fe.dofs_per_vertex); } else @@ -625,8 +627,10 @@ namespace internal const unsigned int local_index, const std::integral_constant) { - return mg_level->dof_object.get_dof_index( - dof_handler, obj_index, fe_index, local_index); + return mg_level->dof_object.get_dof_index(dof_handler, + obj_index, + fe_index, + local_index); } template @@ -642,8 +646,10 @@ namespace internal const unsigned int local_index, const std::integral_constant) { - return mg_faces->lines.get_dof_index( - dof_handler, obj_index, fe_index, local_index); + return mg_faces->lines.get_dof_index(dof_handler, + obj_index, + fe_index, + local_index); } template @@ -659,8 +665,10 @@ namespace internal const unsigned int local_index, const std::integral_constant) { - return mg_level->dof_object.get_dof_index( - dof_handler, obj_index, fe_index, local_index); + return mg_level->dof_object.get_dof_index(dof_handler, + obj_index, + fe_index, + local_index); } template @@ -676,8 +684,10 @@ namespace internal const unsigned int local_index, const std::integral_constant) { - return mg_faces->lines.get_dof_index( - dof_handler, obj_index, fe_index, local_index); + return mg_faces->lines.get_dof_index(dof_handler, + obj_index, + fe_index, + local_index); } template @@ -693,8 +703,10 @@ namespace internal const unsigned int local_index, const std::integral_constant) { - return mg_faces->quads.get_dof_index( - dof_handler, obj_index, fe_index, local_index); + return mg_faces->quads.get_dof_index(dof_handler, + obj_index, + fe_index, + local_index); } template @@ -710,8 +722,10 @@ namespace internal const unsigned int local_index, const std::integral_constant) { - return mg_level->dof_object.get_dof_index( - dof_handler, obj_index, fe_index, local_index); + return mg_level->dof_object.get_dof_index(dof_handler, + obj_index, + fe_index, + local_index); } template @@ -828,11 +842,10 @@ namespace internal template -DoFHandler::DoFHandler( - const Triangulation &tria) : - tria(&tria, typeid(*this).name()), - faces(nullptr), - mg_faces(nullptr) +DoFHandler::DoFHandler(const Triangulation &tria) + : tria(&tria, typeid(*this).name()) + , faces(nullptr) + , mg_faces(nullptr) { // decide whether we need a sequential or a parallel distributed policy if (dynamic_cast *>( @@ -856,7 +869,8 @@ DoFHandler::DoFHandler( template -DoFHandler::DoFHandler() : tria(nullptr, typeid(*this).name()) +DoFHandler::DoFHandler() + : tria(nullptr, typeid(*this).name()) {} @@ -1316,9 +1330,9 @@ void DoFHandler::renumber_dofs( const std::vector &new_numbers) { - Assert( - levels.size() > 0, - ExcMessage("You need to distribute DoFs before you can renumber them.")); + Assert(levels.size() > 0, + ExcMessage( + "You need to distribute DoFs before you can renumber them.")); #ifdef DEBUG if (dynamic_cast *>( @@ -1359,9 +1373,9 @@ DoFHandler::renumber_dofs( } else for (types::global_dof_index i = 0; i < new_numbers.size(); ++i) - Assert( - new_numbers[i] < n_dofs(), - ExcMessage("New DoF index is not less than the total number of dofs.")); + Assert(new_numbers[i] < n_dofs(), + ExcMessage( + "New DoF index is not less than the total number of dofs.")); #endif number_cache = policy->renumber_dofs(new_numbers); @@ -1398,9 +1412,9 @@ DoFHandler::renumber_dofs( } else for (types::global_dof_index i = 0; i < new_numbers.size(); ++i) - Assert( - new_numbers[i] < n_dofs(level), - ExcMessage("New DoF index is not less than the total number of dofs.")); + Assert(new_numbers[i] < n_dofs(level), + ExcMessage( + "New DoF index is not less than the total number of dofs.")); #endif mg_number_cache[level] = policy->renumber_mg_dofs(level, new_numbers); @@ -1514,9 +1528,9 @@ DoFHandler::set_dof_index( template -DoFHandler::MGVertexDoFs::MGVertexDoFs() : - coarsest_level(numbers::invalid_unsigned_int), - finest_level(0) +DoFHandler::MGVertexDoFs::MGVertexDoFs() + : coarsest_level(numbers::invalid_unsigned_int) + , finest_level(0) {} @@ -1537,8 +1551,9 @@ DoFHandler::MGVertexDoFs::init( const unsigned int n_indices = n_levels * dofs_per_vertex; indices = std_cxx14::make_unique(n_indices); - std::fill( - indices.get(), indices.get() + n_indices, numbers::invalid_dof_index); + std::fill(indices.get(), + indices.get() + n_indices, + numbers::invalid_dof_index); } else indices.reset(); diff --git a/source/dofs/dof_handler_policy.cc b/source/dofs/dof_handler_policy.cc index 3560386e78..aa8d6e857b 100644 --- a/source/dofs/dof_handler_policy.cc +++ b/source/dofs/dof_handler_policy.cc @@ -472,15 +472,17 @@ namespace internal numbers::invalid_dof_index) for (unsigned int d = 0; d < fe.dofs_per_vertex; ++d, ++next_free_dof) - cell->set_vertex_dof_index( - vertex, d, next_free_dof, fe_index); + cell->set_vertex_dof_index(vertex, + d, + next_free_dof, + fe_index); // finally for the line. this one shouldn't be numbered yet if (fe.dofs_per_line > 0) { - Assert( - (cell->dof_index(0, fe_index) == numbers::invalid_dof_index), - ExcInternalError()); + Assert((cell->dof_index(0, fe_index) == + numbers::invalid_dof_index), + ExcInternalError()); for (unsigned int d = 0; d < fe.dofs_per_line; ++d, ++next_free_dof) @@ -520,8 +522,10 @@ namespace internal numbers::invalid_dof_index) for (unsigned int d = 0; d < fe.dofs_per_vertex; ++d, ++next_free_dof) - cell->set_vertex_dof_index( - vertex, d, next_free_dof, fe_index); + cell->set_vertex_dof_index(vertex, + d, + next_free_dof, + fe_index); // next the sides. do the same as above: check whether the // line is already numbered for the present fe_index, and if @@ -542,9 +546,9 @@ namespace internal // finally for the quad. this one shouldn't be numbered yet if (fe.dofs_per_quad > 0) { - Assert( - (cell->dof_index(0, fe_index) == numbers::invalid_dof_index), - ExcInternalError()); + Assert((cell->dof_index(0, fe_index) == + numbers::invalid_dof_index), + ExcInternalError()); for (unsigned int d = 0; d < fe.dofs_per_quad; ++d, ++next_free_dof) @@ -584,8 +588,10 @@ namespace internal numbers::invalid_dof_index) for (unsigned int d = 0; d < fe.dofs_per_vertex; ++d, ++next_free_dof) - cell->set_vertex_dof_index( - vertex, d, next_free_dof, fe_index); + cell->set_vertex_dof_index(vertex, + d, + next_free_dof, + fe_index); // next the four lines. do the same as above: check whether // the line is already numbered for the present fe_index, @@ -619,9 +625,9 @@ namespace internal // finally for the hex. this one shouldn't be numbered yet if (fe.dofs_per_hex > 0) { - Assert( - (cell->dof_index(0, fe_index) == numbers::invalid_dof_index), - ExcInternalError()); + Assert((cell->dof_index(0, fe_index) == + numbers::invalid_dof_index), + ExcInternalError()); for (unsigned int d = 0; d < fe.dofs_per_hex; ++d, ++next_free_dof) @@ -701,8 +707,9 @@ namespace internal { const unsigned int first_fe_index = dealii::internal::DoFAccessorImplementation:: - Implementation::nth_active_vertex_fe_index( - dof_handler, vertex_index, 0); + Implementation::nth_active_vertex_fe_index(dof_handler, + vertex_index, + 0); // loop over all the other FEs with which we want // to identify the DoF indices of the first FE of @@ -1007,15 +1014,16 @@ namespace internal identities[i].first, most_dominating_fe_index); const types::global_dof_index - slave_dof_index = line->dof_index( - identities[i].second, other_fe_index); + slave_dof_index = + line->dof_index(identities[i].second, + other_fe_index); - Assert( - (dof_identities.find(master_dof_index) == - dof_identities.end()) || - (dof_identities[slave_dof_index] == - master_dof_index), - ExcInternalError()); + Assert((dof_identities.find( + master_dof_index) == + dof_identities.end()) || + (dof_identities[slave_dof_index] == + master_dof_index), + ExcInternalError()); dof_identities[slave_dof_index] = master_dof_index; @@ -1298,8 +1306,10 @@ namespace internal // finally, do the renumbering. verify that previous dof indices // were indeed all valid on all cells that we touch if we were // told to do so - renumber_dofs( - new_dof_indices, IndexSet(0), dof_handler, check_validity); + renumber_dofs(new_dof_indices, + IndexSet(0), + dof_handler, + check_validity); return next_free_dof; @@ -1332,8 +1342,10 @@ namespace internal if (!cell->is_artificial()) if ((subdomain_id == numbers::invalid_subdomain_id) || (cell->subdomain_id() == subdomain_id)) - next_free_dof = Implementation::distribute_dofs_on_cell( - dof_handler, cell, next_free_dof); + next_free_dof = + Implementation::distribute_dofs_on_cell(dof_handler, + cell, + next_free_dof); // Step 2: unify dof indices in case this is an hp DoFHandler // @@ -1395,8 +1407,9 @@ namespace internal cell->level(), 0, d, - neighbor->mg_vertex_dof_index( - cell->level(), 1, d)); + neighbor->mg_vertex_dof_index(cell->level(), + 1, + d)); else for (unsigned int d = 0; d < cell->get_fe().dofs_per_vertex; @@ -1405,8 +1418,9 @@ namespace internal cell->level(), 1, d, - neighbor->mg_vertex_dof_index( - cell->level(), 0, d)); + neighbor->mg_vertex_dof_index(cell->level(), + 0, + d)); // next neighbor continue; @@ -1416,8 +1430,10 @@ namespace internal // otherwise: create dofs newly for (unsigned int d = 0; d < cell->get_fe().dofs_per_vertex; ++d) - cell->set_mg_vertex_dof_index( - cell->level(), v, d, next_free_dof++); + cell->set_mg_vertex_dof_index(cell->level(), + v, + d, + next_free_dof++); } // dofs of line @@ -1452,8 +1468,10 @@ namespace internal numbers::invalid_dof_index) for (unsigned int d = 0; d < cell->get_fe().dofs_per_vertex; ++d) - cell->set_mg_vertex_dof_index( - cell->level(), vertex, d, next_free_dof++); + cell->set_mg_vertex_dof_index(cell->level(), + vertex, + d, + next_free_dof++); // for the four sides if (cell->get_fe().dofs_per_line > 0) @@ -1506,8 +1524,10 @@ namespace internal numbers::invalid_dof_index) for (unsigned int d = 0; d < cell->get_fe().dofs_per_vertex; ++d) - cell->set_mg_vertex_dof_index( - cell->level(), vertex, d, next_free_dof++); + cell->set_mg_vertex_dof_index(cell->level(), + vertex, + d, + next_free_dof++); // for the lines if (cell->get_fe().dofs_per_line > 0) @@ -1826,8 +1846,9 @@ namespace internal { const unsigned int fe_index = dealii::internal::DoFAccessorImplementation:: - Implementation::nth_active_vertex_fe_index( - dof_handler, vertex_index, f); + Implementation::nth_active_vertex_fe_index(dof_handler, + vertex_index, + f); for (unsigned int d = 0; d < dof_handler.get_fe(fe_index).dofs_per_vertex; @@ -1835,8 +1856,10 @@ namespace internal { const types::global_dof_index old_dof_index = dealii::internal::DoFAccessorImplementation:: - Implementation::get_vertex_dof_index( - dof_handler, vertex_index, fe_index, d); + Implementation::get_vertex_dof_index(dof_handler, + vertex_index, + fe_index, + d); // if check_validity was set, then we are to verify that // the previous indices were all valid. this really should @@ -2141,8 +2164,10 @@ namespace internal // work on separate data structures Threads::TaskGroup<> tasks; tasks += Threads::new_task([&]() { - renumber_vertex_dofs( - new_numbers, indices, dof_handler, check_validity); + renumber_vertex_dofs(new_numbers, + indices, + dof_handler, + check_validity); }); tasks += Threads::new_task( [&]() { renumber_face_dofs(new_numbers, indices, dof_handler); }); @@ -2189,8 +2214,10 @@ namespace internal for (unsigned int d = 0; d < dof_handler.get_fe().dofs_per_vertex; ++d) { - const dealii::types::global_dof_index idx = i->get_index( - level, d, dof_handler.get_fe().dofs_per_vertex); + const dealii::types::global_dof_index idx = + i->get_index(level, + d, + dof_handler.get_fe().dofs_per_vertex); if (check_validity) Assert(idx != numbers::invalid_dof_index, @@ -2489,8 +2516,8 @@ namespace internal template - Sequential::Sequential(DoFHandlerType &dof_handler) : - dof_handler(&dof_handler) + Sequential::Sequential(DoFHandlerType &dof_handler) + : dof_handler(&dof_handler) {} @@ -2499,8 +2526,9 @@ namespace internal NumberCache Sequential::distribute_dofs() const { - const types::global_dof_index n_dofs = Implementation::distribute_dofs( - numbers::invalid_subdomain_id, *dof_handler); + const types::global_dof_index n_dofs = + Implementation::distribute_dofs(numbers::invalid_subdomain_id, + *dof_handler); // return a sequential, complete index set return NumberCache(n_dofs); @@ -2550,8 +2578,10 @@ namespace internal Sequential::renumber_dofs( const std::vector &new_numbers) const { - Implementation::renumber_dofs( - new_numbers, IndexSet(0), *dof_handler, true); + Implementation::renumber_dofs(new_numbers, + IndexSet(0), + *dof_handler, + true); // return a sequential, complete index set. take into account that the // number of DoF indices may in fact be smaller than there were before @@ -2586,8 +2616,8 @@ namespace internal template ParallelShared::ParallelShared( - DoFHandlerType &dof_handler) : - dof_handler(&dof_handler) + DoFHandlerType &dof_handler) + : dof_handler(&dof_handler) {} @@ -2766,8 +2796,9 @@ namespace internal // first let the sequential algorithm do its magic. it is going to // enumerate DoFs on all cells, regardless of owner - const types::global_dof_index n_dofs = Implementation::distribute_dofs( - numbers::invalid_subdomain_id, *this->dof_handler); + const types::global_dof_index n_dofs = + Implementation::distribute_dofs(numbers::invalid_subdomain_id, + *this->dof_handler); // then re-enumerate them based on their subdomain association. // for this, we first have to identify for each current DoF @@ -2814,8 +2845,10 @@ namespace internal // version of the function because we do things on all // cells and all cells have their subdomain ids and DoFs // correctly set - Implementation::renumber_dofs( - new_dof_indices, IndexSet(0), *this->dof_handler, true); + Implementation::renumber_dofs(new_dof_indices, + IndexSet(0), + *this->dof_handler, + true); // update the number cache. for this, we first have to find the // subdomain association for each DoF again following renumbering, from @@ -2957,8 +2990,10 @@ namespace internal // determine the total number of subdomain ids used const std::vector level_subdomain_association = - get_dof_level_subdomain_association( - *this->dof_handler, n_dofs_on_level, n_procs, lvl); + get_dof_level_subdomain_association(*this->dof_handler, + n_dofs_on_level, + n_procs, + lvl); // then renumber the subdomains by first looking at those // belonging to subdomain 0, then those of subdomain 1, etc. note @@ -3005,8 +3040,10 @@ namespace internal // the IndexSets cheap. an assertion at the top verifies that this // assumption is true const std::vector level_subdomain_association = - get_dof_level_subdomain_association( - *this->dof_handler, n_dofs_on_level, n_procs, lvl); + get_dof_level_subdomain_association(*this->dof_handler, + n_dofs_on_level, + n_procs, + lvl); for (unsigned int i = 1; i < n_dofs_on_level; ++i) Assert(level_subdomain_association[i] >= @@ -3217,8 +3254,10 @@ namespace internal // let the sequential algorithm do its magic; ignore the // return type, but reconstruct the number cache based on // which DoFs each process owns - Implementation::renumber_dofs( - global_gathered_numbers, IndexSet(0), *this->dof_handler, true); + Implementation::renumber_dofs(global_gathered_numbers, + IndexSet(0), + *this->dof_handler, + true); const NumberCache number_cache( DoFTools::locally_owned_dofs_per_subdomain(*this->dof_handler), @@ -3651,8 +3690,10 @@ namespace internal MPI_Status status; int len; - int ierr = MPI_Probe( - MPI_ANY_SOURCE, 10101, tria.get_communicator(), &status); + int ierr = MPI_Probe(MPI_ANY_SOURCE, + 10101, + tria.get_communicator(), + &status); AssertThrowMPI(ierr); ierr = MPI_Get_count(&status, MPI_BYTE, &len); AssertThrowMPI(ierr); @@ -3714,8 +3755,10 @@ namespace internal MPI_Status status; int len; - int ierr = MPI_Probe( - MPI_ANY_SOURCE, 10102, tria.get_communicator(), &status); + int ierr = MPI_Probe(MPI_ANY_SOURCE, + 10102, + tria.get_communicator(), + &status); AssertThrowMPI(ierr); ierr = MPI_Get_count(&status, MPI_BYTE, &len); AssertThrowMPI(ierr); @@ -3769,8 +3812,9 @@ namespace internal // buffers. if (requests.size() > 0) { - const int ierr = MPI_Waitall( - requests.size(), requests.data(), MPI_STATUSES_IGNORE); + const int ierr = MPI_Waitall(requests.size(), + requests.data(), + MPI_STATUSES_IGNORE); AssertThrowMPI(ierr); } if (reply_requests.size() > 0) @@ -3977,10 +4021,10 @@ namespace internal else // we already know the dof index. check that there // is no conflict - Assert( - (received_dof_indices[i] == numbers::invalid_dof_index) || - (received_dof_indices[i] == local_dof_indices[i]), - ExcInternalError()); + Assert((received_dof_indices[i] == + numbers::invalid_dof_index) || + (received_dof_indices[i] == local_dof_indices[i]), + ExcInternalError()); const_cast(cell) ->set_dof_indices(local_dof_indices); @@ -4035,8 +4079,8 @@ namespace internal template ParallelDistributed::ParallelDistributed( - DoFHandlerType &dof_handler) : - dof_handler(&dof_handler) + DoFHandlerType &dof_handler) + : dof_handler(&dof_handler) {} @@ -4149,8 +4193,10 @@ namespace internal // now re-enumerate all dofs to this shifted and condensed // numbering form. we renumber some dofs as invalid, so // choose the nocheck-version. - Implementation::renumber_dofs( - renumbering, IndexSet(0), *dof_handler, false); + Implementation::renumber_dofs(renumbering, + IndexSet(0), + *dof_handler, + false); // now a little bit of housekeeping const dealii::types::global_dof_index n_global_dofs = @@ -4172,12 +4218,11 @@ namespace internal } NumberCache number_cache(locally_owned_dofs_per_processor, triangulation->locally_owned_subdomain()); - Assert( - number_cache - .locally_owned_dofs_per_processor[triangulation - ->locally_owned_subdomain()] - .n_elements() == number_cache.n_locally_owned_dofs, - ExcInternalError()); + Assert(number_cache + .locally_owned_dofs_per_processor + [triangulation->locally_owned_subdomain()] + .n_elements() == number_cache.n_locally_owned_dofs, + ExcInternalError()); Assert( !number_cache .locally_owned_dofs_per_processor[triangulation @@ -4273,11 +4318,11 @@ namespace internal { if (cell->is_ghost()) { - Assert( - false, - ExcMessage("A ghost cell ended up with incomplete " - "DoF index information. This should not " - "have happened!")); + Assert(false, + ExcMessage( + "A ghost cell ended up with incomplete " + "DoF index information. This should not " + "have happened!")); } else { @@ -4315,13 +4360,13 @@ namespace internal &dof_handler->get_triangulation()))); Assert(triangulation != nullptr, ExcInternalError()); - AssertThrow( - (triangulation->settings & - parallel::distributed::Triangulation:: - construct_multigrid_hierarchy), - ExcMessage("Multigrid DoFs can only be distributed on a parallel " - "Triangulation if the flag construct_multigrid_hierarchy " - "is set in the constructor.")); + AssertThrow((triangulation->settings & + parallel::distributed::Triangulation:: + construct_multigrid_hierarchy), + ExcMessage( + "Multigrid DoFs can only be distributed on a parallel " + "Triangulation if the flag construct_multigrid_hierarchy " + "is set in the constructor.")); const unsigned int n_cpus = @@ -4753,8 +4798,9 @@ namespace internal } // determine maximum size of IndexSet - const unsigned int max_size = Utilities::MPI::max( - my_data.size(), triangulation->get_communicator()); + const unsigned int max_size = + Utilities::MPI::max(my_data.size(), + triangulation->get_communicator()); // as the MPI_Allgather call will be reading max_size elements, and // as this may be past the end of my_data, we need to increase the @@ -4806,9 +4852,9 @@ namespace internal } } - return NumberCache( - locally_owned_dofs_per_processor, - Utilities::MPI::this_mpi_process(triangulation->get_communicator())); + return NumberCache(locally_owned_dofs_per_processor, + Utilities::MPI::this_mpi_process( + triangulation->get_communicator())); #endif } @@ -4852,13 +4898,15 @@ namespace internal // use Utilities::MPI::Partitioner for handling the data exchange // of the new numbers, which is simply the extraction of ghost data IndexSet relevant_dofs; - DoFTools::extract_locally_relevant_level_dofs( - *dof_handler, level, relevant_dofs); + DoFTools::extract_locally_relevant_level_dofs(*dof_handler, + level, + relevant_dofs); std::vector ghosted_new_numbers( relevant_dofs.n_elements()); { - Utilities::MPI::Partitioner partitioner( - index_sets[my_rank], relevant_dofs, tr->get_communicator()); + Utilities::MPI::Partitioner partitioner(index_sets[my_rank], + relevant_dofs, + tr->get_communicator()); std::vector temp_array( partitioner.n_import_indices()); const unsigned int communication_channel = 17; diff --git a/source/dofs/dof_renumbering.cc b/source/dofs/dof_renumbering.cc index 3bf4d5c38c..d9d8a2e626 100644 --- a/source/dofs/dof_renumbering.cc +++ b/source/dofs/dof_renumbering.cc @@ -129,8 +129,10 @@ namespace DoFRenumbering { std::vector renumbering( dof_handler.n_dofs(), numbers::invalid_dof_index); - compute_Cuthill_McKee( - renumbering, dof_handler, reversed_numbering, use_constraints); + compute_Cuthill_McKee(renumbering, + dof_handler, + reversed_numbering, + use_constraints); // actually perform renumbering; // this is dimension specific and @@ -189,8 +191,10 @@ namespace DoFRenumbering { std::vector renumbering( dof_handler.n_dofs(), numbers::invalid_dof_index); - compute_king_ordering( - renumbering, dof_handler, reversed_numbering, use_constraints); + compute_king_ordering(renumbering, + dof_handler, + reversed_numbering, + use_constraints); // actually perform renumbering; // this is dimension specific and @@ -243,8 +247,10 @@ namespace DoFRenumbering { std::vector renumbering( dof_handler.n_dofs(), numbers::invalid_dof_index); - compute_minimum_degree( - renumbering, dof_handler, reversed_numbering, use_constraints); + compute_minimum_degree(renumbering, + dof_handler, + reversed_numbering, + use_constraints); // actually perform renumbering; // this is dimension specific and @@ -327,8 +333,9 @@ namespace DoFRenumbering make_iterator_property_map(degree.begin(), id, degree[0]), inverse_perm.data(), perm.data(), - make_iterator_property_map( - supernode_sizes.begin(), id, supernode_sizes[0]), + make_iterator_property_map(supernode_sizes.begin(), + id, + supernode_sizes[0]), delta, id); @@ -346,8 +353,9 @@ namespace DoFRenumbering if (reversed_numbering == true) std::copy(perm.begin(), perm.end(), new_dof_indices.begin()); else - std::copy( - inverse_perm.begin(), inverse_perm.end(), new_dof_indices.begin()); + std::copy(inverse_perm.begin(), + inverse_perm.end(), + new_dof_indices.begin()); } } // namespace boost @@ -420,8 +428,9 @@ namespace DoFRenumbering DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints); - SparsityTools::reorder_Cuthill_McKee( - dsp, new_indices, starting_indices); + SparsityTools::reorder_Cuthill_McKee(dsp, + new_indices, + starting_indices); if (reversed_numbering) new_indices = Utilities::reverse_permutation(new_indices); } @@ -463,8 +472,9 @@ namespace DoFRenumbering // then create first the global sparsity pattern, and then the local // sparsity pattern from the global one by transferring its indices to // processor-local (locally owned or locally active) index space - DynamicSparsityPattern dsp( - dof_handler.n_dofs(), dof_handler.n_dofs(), index_set_to_use); + DynamicSparsityPattern dsp(dof_handler.n_dofs(), + dof_handler.n_dofs(), + index_set_to_use); DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints); DynamicSparsityPattern local_sparsity(index_set_to_use.n_elements(), @@ -482,8 +492,10 @@ namespace DoFRenumbering if (col != row && index_set_to_use.is_element(col)) row_entries.push_back(index_set_to_use.index_within_set(col)); } - local_sparsity.add_entries( - i, row_entries.begin(), row_entries.end(), true); + local_sparsity.add_entries(i, + row_entries.begin(), + row_entries.end(), + true); } // translate starting indices from global to local indices @@ -497,8 +509,9 @@ namespace DoFRenumbering AssertDimension(new_indices.size(), locally_owned_dofs.n_elements()); std::vector my_new_indices( index_set_to_use.n_elements()); - SparsityTools::reorder_Cuthill_McKee( - local_sparsity, my_new_indices, local_starting_indices); + SparsityTools::reorder_Cuthill_McKee(local_sparsity, + my_new_indices, + local_starting_indices); if (reversed_numbering) my_new_indices = Utilities::reverse_permutation(my_new_indices); @@ -716,9 +729,10 @@ namespace DoFRenumbering fe_collection.n_components())); for (unsigned int i = 0; i < component_order.size(); ++i) - Assert( - component_order[i] < fe_collection.n_components(), - ExcIndexRange(component_order[i], 0, fe_collection.n_components())); + Assert(component_order[i] < fe_collection.n_components(), + ExcIndexRange(component_order[i], + 0, + fe_collection.n_components())); // vector to hold the dof indices on // the cell we visit at a time @@ -945,8 +959,10 @@ namespace DoFRenumbering dim, spacedim, typename DoFHandler::active_cell_iterator, - typename DoFHandler::level_cell_iterator>( - renumbering, start, end, false); + typename DoFHandler::level_cell_iterator>(renumbering, + start, + end, + false); if (result == 0) return; @@ -983,8 +999,10 @@ namespace DoFRenumbering dim, spacedim, typename hp::DoFHandler::active_cell_iterator, - typename hp::DoFHandler::level_cell_iterator>( - renumbering, start, end, false); + typename hp::DoFHandler::level_cell_iterator>(renumbering, + start, + end, + false); if (result == 0) return; @@ -1015,8 +1033,10 @@ namespace DoFRenumbering dim, spacedim, typename DoFHandler::level_cell_iterator, - typename DoFHandler::level_cell_iterator>( - renumbering, start, end, true); + typename DoFHandler::level_cell_iterator>(renumbering, + start, + end, + true); if (result == 0) return; @@ -1448,8 +1468,10 @@ namespace DoFRenumbering std::vector renumbering( dof_handler.n_dofs(level), numbers::invalid_dof_index); - compute_sort_selected_dofs_back( - renumbering, dof_handler, selected_dofs, level); + compute_sort_selected_dofs_back(renumbering, + dof_handler, + selected_dofs, + level); dof_handler.renumber_dofs(level, renumbering); } @@ -1614,11 +1636,11 @@ namespace DoFRenumbering } } } - Assert( - global_index == n_global_dofs, - ExcMessage("Traversing over the given set of cells did not cover all " - "degrees of freedom in the DoFHandler. Does the set of cells " - "not include all active cells?")); + Assert(global_index == n_global_dofs, + ExcMessage( + "Traversing over the given set of cells did not cover all " + "degrees of freedom in the DoFHandler. Does the set of cells " + "not include all active cells?")); for (types::global_dof_index i = 0; i < reverse.size(); ++i) new_indices[reverse[i]] = i; @@ -1691,11 +1713,11 @@ namespace DoFRenumbering } } } - Assert( - global_index == n_global_dofs, - ExcMessage("Traversing over the given set of cells did not cover all " - "degrees of freedom in the DoFHandler. Does the set of cells " - "not include all cells of the specified level?")); + Assert(global_index == n_global_dofs, + ExcMessage( + "Traversing over the given set of cells did not cover all " + "degrees of freedom in the DoFHandler. Does the set of cells " + "not include all cells of the specified level?")); for (types::global_dof_index i = 0; i < new_order.size(); ++i) new_order[reverse[i]] = i; @@ -1784,8 +1806,9 @@ namespace DoFRenumbering fe_collection[comp].get_unit_support_points())); } hp::FEValues - hp_fe_values( - fe_collection, quadrature_collection, update_quadrature_points); + hp_fe_values(fe_collection, + quadrature_collection, + update_quadrature_points); std::vector already_touched(n_dofs, false); @@ -1815,8 +1838,9 @@ namespace DoFRenumbering ComparePointwiseDownstream comparator( direction); - std::sort( - support_point_list.begin(), support_point_list.end(), comparator); + std::sort(support_point_list.begin(), + support_point_list.end(), + comparator); for (types::global_dof_index i = 0; i < n_dofs; ++i) new_indices[support_point_list[i].second] = i; } @@ -1914,8 +1938,9 @@ namespace DoFRenumbering ComparePointwiseDownstream comparator( direction); - std::sort( - support_point_list.begin(), support_point_list.end(), comparator); + std::sort(support_point_list.begin(), + support_point_list.end(), + comparator); for (types::global_dof_index i = 0; i < n_dofs; ++i) new_indices[support_point_list[i].second] = i; } @@ -1943,9 +1968,9 @@ namespace DoFRenumbering /** * Constructor. */ - ClockCells(const Point ¢er, bool counter) : - center(center), - counter(counter) + ClockCells(const Point ¢er, bool counter) + : center(center) + , counter(counter) {} /** @@ -2097,8 +2122,9 @@ namespace DoFRenumbering for (unsigned int i = 1; i < n_dofs; ++i) { // get a random number between 0 and i (inclusive) - const unsigned int j = ::boost::random::uniform_int_distribution<>( - 0, i)(random_number_generator); + const unsigned int j = + ::boost::random::uniform_int_distribution<>(0, i)( + random_number_generator); // if possible, swap the elements if (i != j) diff --git a/source/dofs/dof_tools.cc b/source/dofs/dof_tools.cc index fbbb9ad32c..75075ab289 100644 --- a/source/dofs/dof_tools.cc +++ b/source/dofs/dof_tools.cc @@ -261,9 +261,9 @@ namespace DoFTools DoFHandlerType::space_dimension> &fe_collection = dof.get_fe_collection(); Assert(fe_collection.n_components() < 256, ExcNotImplemented()); - Assert( - dofs_by_block.size() == dof.n_locally_owned_dofs(), - ExcDimensionMismatch(dofs_by_block.size(), dof.n_locally_owned_dofs())); + Assert(dofs_by_block.size() == dof.n_locally_owned_dofs(), + ExcDimensionMismatch(dofs_by_block.size(), + dof.n_locally_owned_dofs())); // next set up a table for the degrees of freedom on each of the // cells (regardless of the fact whether it is listed in the @@ -410,9 +410,9 @@ namespace DoFTools ExcMessage( "The given component mask is not sized correctly to represent the " "components of the given finite element.")); - Assert( - selected_dofs.size() == dof.n_locally_owned_dofs(), - ExcDimensionMismatch(selected_dofs.size(), dof.n_locally_owned_dofs())); + Assert(selected_dofs.size() == dof.n_locally_owned_dofs(), + ExcDimensionMismatch(selected_dofs.size(), + dof.n_locally_owned_dofs())); // two special cases: no component is selected, and all components are // selected; both rather stupid, but easy to catch @@ -578,8 +578,10 @@ namespace DoFTools std::vector & selected_dofs) { // simply defer to the other extract_level_dofs() function - extract_level_dofs( - level, dof, dof.get_fe().component_mask(block_mask), selected_dofs); + extract_level_dofs(level, + dof, + dof.get_fe().component_mask(block_mask), + selected_dofs); } @@ -1170,9 +1172,9 @@ namespace DoFTools // sort, compress out duplicates, fill into index set std::sort(dofs_on_ghosts.begin(), dofs_on_ghosts.end()); - dof_set.add_indices( - dofs_on_ghosts.begin(), - std::unique(dofs_on_ghosts.begin(), dofs_on_ghosts.end())); + dof_set.add_indices(dofs_on_ghosts.begin(), + std::unique(dofs_on_ghosts.begin(), + dofs_on_ghosts.end())); dof_set.compress(); } @@ -1218,9 +1220,9 @@ namespace DoFTools // sort, compress out duplicates, fill into index set std::sort(dofs_on_ghosts.begin(), dofs_on_ghosts.end()); - dof_set.add_indices( - dofs_on_ghosts.begin(), - std::unique(dofs_on_ghosts.begin(), dofs_on_ghosts.end())); + dof_set.add_indices(dofs_on_ghosts.begin(), + std::unique(dofs_on_ghosts.begin(), + dofs_on_ghosts.end())); dof_set.compress(); } @@ -1239,8 +1241,9 @@ namespace DoFTools std::vector dofs_by_component( dof_handler.n_locally_owned_dofs()); - internal::get_component_association( - dof_handler, component_mask, dofs_by_component); + internal::get_component_association(dof_handler, + component_mask, + dofs_by_component); unsigned int n_selected_dofs = 0; for (unsigned int i = 0; i < n_components; ++i) if (component_mask[i] == true) @@ -1346,15 +1349,15 @@ namespace DoFTools // If the Triangulation is distributed, the only thing we can usefully // ask is for its locally owned subdomain - Assert( - (dynamic_cast *>( - &dof_handler.get_triangulation()) == nullptr), - ExcMessage("For parallel::distributed::Triangulation objects and " - "associated DoF handler objects, asking for any information " - "related to a subdomain other than the locally owned one does " - "not make sense.")); + Assert((dynamic_cast *>( + &dof_handler.get_triangulation()) == nullptr), + ExcMessage( + "For parallel::distributed::Triangulation objects and " + "associated DoF handler objects, asking for any information " + "related to a subdomain other than the locally owned one does " + "not make sense.")); // The following is a random process (flip of a coin), thus should be called // once only. @@ -1443,15 +1446,15 @@ namespace DoFTools { // If the Triangulation is distributed, the only thing we can usefully // ask is for its locally owned subdomain - Assert( - (dynamic_cast *>( - &dof_handler.get_triangulation()) == nullptr), - ExcMessage("For parallel::distributed::Triangulation objects and " - "associated DoF handler objects, asking for any information " - "related to a subdomain other than the locally owned one does " - "not make sense.")); + Assert((dynamic_cast *>( + &dof_handler.get_triangulation()) == nullptr), + ExcMessage( + "For parallel::distributed::Triangulation objects and " + "associated DoF handler objects, asking for any information " + "related to a subdomain other than the locally owned one does " + "not make sense.")); // Collect all the locally owned DoFs // Note: Even though the distribution of DoFs by the @@ -1531,9 +1534,9 @@ namespace DoFTools "associated DoF handler objects, asking for any subdomain other " "than the locally owned one does not make sense.")); - Assert( - subdomain_association.size() == dof_handler.n_dofs(), - ExcDimensionMismatch(subdomain_association.size(), dof_handler.n_dofs())); + Assert(subdomain_association.size() == dof_handler.n_dofs(), + ExcDimensionMismatch(subdomain_association.size(), + dof_handler.n_dofs())); // catch an error that happened in some versions of the shared tria // distribute_dofs() function where we were trying to call this @@ -1622,8 +1625,9 @@ namespace DoFTools dof_handler.n_dofs()); get_subdomain_association(dof_handler, subdomain_association); - return std::count( - subdomain_association.begin(), subdomain_association.end(), subdomain); + return std::count(subdomain_association.begin(), + subdomain_association.end(), + subdomain); } @@ -1672,9 +1676,9 @@ namespace DoFTools } // sort indices and remove duplicates std::sort(subdomain_indices.begin(), subdomain_indices.end()); - subdomain_indices.erase( - std::unique(subdomain_indices.begin(), subdomain_indices.end()), - subdomain_indices.end()); + subdomain_indices.erase(std::unique(subdomain_indices.begin(), + subdomain_indices.end()), + subdomain_indices.end()); // insert into IndexSet index_set.add_indices(subdomain_indices.begin(), subdomain_indices.end()); @@ -1723,8 +1727,9 @@ namespace DoFTools get_subdomain_association(dof_handler, subdomain_association); std::vector component_association(dof_handler.n_dofs()); - internal::get_component_association( - dof_handler, std::vector(), component_association); + internal::get_component_association(dof_handler, + std::vector(), + component_association); for (unsigned int c = 0; c < dof_handler.get_fe(0).n_components(); ++c) { @@ -1910,8 +1915,9 @@ namespace DoFTools // do so in parallel std::vector dofs_by_component( dof_handler.n_locally_owned_dofs()); - internal::get_component_association( - dof_handler, ComponentMask(), dofs_by_component); + internal::get_component_association(dof_handler, + ComponentMask(), + dofs_by_component); // next count what we got unsigned int component = 0; @@ -2052,8 +2058,9 @@ namespace DoFTools std::vector &mapping) { mapping.clear(); - mapping.insert( - mapping.end(), dof_handler.n_dofs(), numbers::invalid_dof_index); + mapping.insert(mapping.end(), + dof_handler.n_dofs(), + numbers::invalid_dof_index); std::vector dofs_on_face; dofs_on_face.reserve(max_dofs_per_face(dof_handler)); @@ -2099,8 +2106,9 @@ namespace DoFTools ExcInvalidBoundaryIndicator()); mapping.clear(); - mapping.insert( - mapping.end(), dof_handler.n_dofs(), numbers::invalid_dof_index); + mapping.insert(mapping.end(), + dof_handler.n_dofs(), + numbers::invalid_dof_index); // return if there is nothing to do if (boundary_ids.size() == 0) @@ -2170,8 +2178,10 @@ namespace DoFTools // // The weights of the quadrature rule have been set to invalid // values by the used constructor. - hp::FEValues hp_fe_values( - mapping, fe_collection, q_coll_dummy, update_quadrature_points); + hp::FEValues hp_fe_values(mapping, + fe_collection, + q_coll_dummy, + update_quadrature_points); typename DoFHandlerType::active_cell_iterator cell = dof_handler .begin_active(), endc = dof_handler.end(); @@ -2241,8 +2251,9 @@ namespace DoFTools // gets a MappingCollection const hp::MappingCollection mapping_collection(mapping); - internal::map_dofs_to_support_points( - mapping_collection, dof_handler, support_points); + internal::map_dofs_to_support_points(mapping_collection, + dof_handler, + support_points); } @@ -2280,8 +2291,9 @@ namespace DoFTools // gets a MappingCollection const hp::MappingCollection mapping_collection(mapping); - internal::map_dofs_to_support_points( - mapping_collection, dof_handler, support_points); + internal::map_dofs_to_support_points(mapping_collection, + dof_handler, + support_points); } @@ -2420,8 +2432,9 @@ namespace DoFTools for (cell = dof_handler.begin(level); cell != endc; ++cell) if (cell->is_locally_owned_on_level()) ++i; - block_list.reinit( - i, dof_handler.n_dofs(), dof_handler.get_fe().dofs_per_cell); + block_list.reinit(i, + dof_handler.n_dofs(), + dof_handler.get_fe().dofs_per_cell); i = 0; for (cell = dof_handler.begin(level); cell != endc; ++cell) if (cell->is_locally_owned_on_level()) @@ -2666,8 +2679,9 @@ namespace DoFTools // At this point, the list of patches is ready. Now we enter the dofs // into the sparsity pattern. - block_list.reinit( - vertex_dof_count.size(), dof_handler.n_dofs(level), vertex_dof_count); + block_list.reinit(vertex_dof_count.size(), + dof_handler.n_dofs(level), + vertex_dof_count); std::vector indices; std::vector exclude; diff --git a/source/dofs/dof_tools.inst.in b/source/dofs/dof_tools.inst.in index 75e1ff9583..eb30ae240d 100644 --- a/source/dofs/dof_tools.inst.in +++ b/source/dofs/dof_tools.inst.in @@ -136,12 +136,11 @@ for (deal_II_dimension : DIMENSIONS) std::vector &); #endif - template void - DoFTools::extract_boundary_dofs>( - const DoFHandler &, - const ComponentMask &, - std::vector &, - const std::set &); + template void DoFTools::extract_boundary_dofs< + DoFHandler>(const DoFHandler &, + const ComponentMask &, + std::vector &, + const std::set &); template void DoFTools::extract_boundary_dofs>( @@ -150,12 +149,11 @@ for (deal_II_dimension : DIMENSIONS) std::vector &, const std::set &); - template void - DoFTools::extract_boundary_dofs>( - const DoFHandler &, - const ComponentMask &, - IndexSet &, - const std::set &); + template void DoFTools::extract_boundary_dofs< + DoFHandler>(const DoFHandler &, + const ComponentMask &, + IndexSet &, + const std::set &); template void DoFTools::extract_boundary_dofs>( @@ -369,17 +367,14 @@ for (deal_II_dimension : DIMENSIONS) DoFTools::locally_relevant_dofs_per_subdomain>( const hp::DoFHandler<1, 3> &dof_handler); - template unsigned int - DoFTools::count_dofs_with_subdomain_association>( - const DoFHandler<1, 3> &, const types::subdomain_id); - template IndexSet - DoFTools::dof_indices_with_subdomain_association>( - const DoFHandler<1, 3> &, const types::subdomain_id); - template void - DoFTools::count_dofs_with_subdomain_association>( - const DoFHandler<1, 3> &, - const types::subdomain_id, - std::vector &); + template unsigned int DoFTools::count_dofs_with_subdomain_association< + DoFHandler<1, 3>>(const DoFHandler<1, 3> &, const types::subdomain_id); + template IndexSet DoFTools::dof_indices_with_subdomain_association< + DoFHandler<1, 3>>(const DoFHandler<1, 3> &, const types::subdomain_id); + template void DoFTools::count_dofs_with_subdomain_association< + DoFHandler<1, 3>>(const DoFHandler<1, 3> &, + const types::subdomain_id, + std::vector &); template unsigned int DoFTools::count_dofs_with_subdomain_association>( @@ -387,21 +382,19 @@ for (deal_II_dimension : DIMENSIONS) template IndexSet DoFTools::dof_indices_with_subdomain_association>( const hp::DoFHandler<1, 3> &, const types::subdomain_id); - template void - DoFTools::count_dofs_with_subdomain_association>( - const hp::DoFHandler<1, 3> &, - const types::subdomain_id, - std::vector &); + template void DoFTools::count_dofs_with_subdomain_association< + hp::DoFHandler<1, 3>>(const hp::DoFHandler<1, 3> &, + const types::subdomain_id, + std::vector &); #endif - template void - DoFTools::count_dofs_per_component>( - const DoFHandler &, - std::vector &, - bool, - std::vector); + template void DoFTools::count_dofs_per_component< + DoFHandler>(const DoFHandler &, + std::vector &, + bool, + std::vector); template void DoFTools::count_dofs_per_component>( @@ -469,16 +462,14 @@ for (deal_II_dimension : DIMENSIONS) std::vector &, const std::vector &); - template void - DoFTools::map_dof_to_boundary_indices>( - const DoFHandler &, - const std::set &, - std::vector &); + template void DoFTools::map_dof_to_boundary_indices< + DoFHandler>(const DoFHandler &, + const std::set &, + std::vector &); - template void - DoFTools::map_dof_to_boundary_indices>( - const DoFHandler &, - std::vector &); + template void DoFTools::map_dof_to_boundary_indices< + DoFHandler>(const DoFHandler &, + std::vector &); diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index ca5ba56afd..50e5f0d307 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -318,8 +318,10 @@ namespace DoFTools { master_dof_mask = std_cxx14::make_unique>(fe1.dofs_per_face); - select_master_dofs_for_face_restriction( - fe1, fe2, face_interpolation_matrix, *master_dof_mask); + select_master_dofs_for_face_restriction(fe1, + fe2, + face_interpolation_matrix, + *master_dof_mask); } } @@ -340,8 +342,9 @@ namespace DoFTools { if (matrix == nullptr) { - matrix = std_cxx14::make_unique>( - fe2.dofs_per_face, fe1.dofs_per_face); + matrix = + std_cxx14::make_unique>(fe2.dofs_per_face, + fe1.dofs_per_face); fe1.get_face_interpolation_matrix(fe2, *matrix); } } @@ -361,8 +364,9 @@ namespace DoFTools { if (matrix == nullptr) { - matrix = std_cxx14::make_unique>( - fe2.dofs_per_face, fe1.dofs_per_face); + matrix = + std_cxx14::make_unique>(fe2.dofs_per_face, + fe1.dofs_per_face); fe1.get_subface_interpolation_matrix(fe2, subface, *matrix); } } @@ -382,10 +386,11 @@ namespace DoFTools &split_matrix) { AssertDimension(master_dof_mask.size(), face_interpolation_matrix.m()); - Assert( - std::count(master_dof_mask.begin(), master_dof_mask.end(), true) == - static_cast(face_interpolation_matrix.n()), - ExcInternalError()); + Assert(std::count(master_dof_mask.begin(), + master_dof_mask.end(), + true) == + static_cast(face_interpolation_matrix.n()), + ExcInternalError()); if (split_matrix == nullptr) { @@ -717,9 +722,9 @@ namespace DoFTools dofs_on_children.clear(); dofs_on_children.reserve(n_dofs_on_children); - Assert( - n_dofs_on_mother == fe.constraints().n(), - ExcDimensionMismatch(n_dofs_on_mother, fe.constraints().n())); + Assert(n_dofs_on_mother == fe.constraints().n(), + ExcDimensionMismatch(n_dofs_on_mother, + fe.constraints().n())); Assert(n_dofs_on_children == fe.constraints().m(), ExcDimensionMismatch(n_dofs_on_children, fe.constraints().m())); @@ -903,9 +908,9 @@ namespace DoFTools dofs_on_children.clear(); dofs_on_children.reserve(n_dofs_on_children); - Assert( - n_dofs_on_mother == fe.constraints().n(), - ExcDimensionMismatch(n_dofs_on_mother, fe.constraints().n())); + Assert(n_dofs_on_mother == fe.constraints().n(), + ExcDimensionMismatch(n_dofs_on_mother, + fe.constraints().n())); Assert(n_dofs_on_children == fe.constraints().m(), ExcDimensionMismatch(n_dofs_on_children, fe.constraints().m())); @@ -2440,10 +2445,11 @@ namespace DoFTools // In the case that both faces have children, we loop over all // children and apply make_periodicty_constrains recursively: - Assert( - face_1->n_children() == GeometryInfo::max_children_per_face && - face_2->n_children() == GeometryInfo::max_children_per_face, - ExcNotImplemented()); + Assert(face_1->n_children() == + GeometryInfo::max_children_per_face && + face_2->n_children() == + GeometryInfo::max_children_per_face, + ExcNotImplemented()); for (unsigned int i = 0; i < GeometryInfo::max_children_per_face; ++i) @@ -2537,15 +2543,16 @@ namespace DoFTools // face_1. Therefore face_flip has to be toggled if // face_rotation is true: // In case of inverted orientation, nothing has to be done. - set_periodicity_constraints( - face_1, - face_2, - transformation, - constraint_matrix, - component_mask, - face_orientation, - face_orientation ? face_rotation ^ face_flip : face_flip, - face_rotation); + set_periodicity_constraints(face_1, + face_2, + transformation, + constraint_matrix, + component_mask, + face_orientation, + face_orientation ? + face_rotation ^ face_flip : + face_flip, + face_rotation); } } } @@ -2625,8 +2632,9 @@ namespace DoFTools GridTools::collect_periodic_faces( dof_handler, b_id1, b_id2, direction, matched_faces); - make_periodicity_constraints( - matched_faces, constraints, component_mask); + make_periodicity_constraints(matched_faces, + constraints, + component_mask); } @@ -2654,11 +2662,14 @@ namespace DoFTools matched_faces; // Collect matching periodic cells on the coarsest level: - GridTools::collect_periodic_faces( - dof_handler, b_id, direction, matched_faces); - - make_periodicity_constraints( - matched_faces, constraints, component_mask); + GridTools::collect_periodic_faces(dof_handler, + b_id, + direction, + matched_faces); + + make_periodicity_constraints(matched_faces, + constraints, + component_mask); } @@ -3097,8 +3108,9 @@ namespace DoFTools dof_is_interesting[local_dof_indices[i]] = true; }; - n_parameters_on_fine_grid = std::count( - dof_is_interesting.begin(), dof_is_interesting.end(), true); + n_parameters_on_fine_grid = std::count(dof_is_interesting.begin(), + dof_is_interesting.end(), + true); }; @@ -3533,8 +3545,9 @@ namespace DoFTools // Find out if a dof has a contribution in this // component, and if so, add it to the list const std::vector::iterator - it_index_on_cell = std::find( - cell_dofs.begin(), cell_dofs.end(), face_dofs[i]); + it_index_on_cell = std::find(cell_dofs.begin(), + cell_dofs.end(), + face_dofs[i]); Assert(it_index_on_cell != cell_dofs.end(), ExcInvalidIterator()); const unsigned int index_on_cell = diff --git a/source/dofs/dof_tools_sparsity.cc b/source/dofs/dof_tools_sparsity.cc index a0cc18295b..fbef24e408 100644 --- a/source/dofs/dof_tools_sparsity.cc +++ b/source/dofs/dof_tools_sparsity.cc @@ -75,15 +75,15 @@ namespace DoFTools // If we have a distributed::Triangulation only allow locally_owned // subdomain. Not setting a subdomain is also okay, because we skip // ghost cells in the loop below. - Assert( - (dof.get_triangulation().locally_owned_subdomain() == - numbers::invalid_subdomain_id) || - (subdomain_id == numbers::invalid_subdomain_id) || - (subdomain_id == dof.get_triangulation().locally_owned_subdomain()), - ExcMessage( - "For parallel::distributed::Triangulation objects and " - "associated DoF handler objects, asking for any subdomain other " - "than the locally owned one does not make sense.")); + Assert((dof.get_triangulation().locally_owned_subdomain() == + numbers::invalid_subdomain_id) || + (subdomain_id == numbers::invalid_subdomain_id) || + (subdomain_id == + dof.get_triangulation().locally_owned_subdomain()), + ExcMessage( + "For parallel::distributed::Triangulation objects and " + "associated DoF handler objects, asking for any subdomain other " + "than the locally owned one does not make sense.")); std::vector dofs_on_this_cell; dofs_on_this_cell.reserve(max_dofs_per_cell(dof)); @@ -105,8 +105,9 @@ namespace DoFTools // make sparsity pattern for this cell. if no constraints pattern // was given, then the following call acts as if simply no // constraints existed - constraints.add_entries_local_to_global( - dofs_on_this_cell, sparsity, keep_constrained_dofs); + constraints.add_entries_local_to_global(dofs_on_this_cell, + sparsity, + keep_constrained_dofs); } } @@ -130,25 +131,25 @@ namespace DoFTools ExcDimensionMismatch(sparsity.n_rows(), n_dofs)); Assert(sparsity.n_cols() == n_dofs, ExcDimensionMismatch(sparsity.n_cols(), n_dofs)); - Assert( - couplings.n_rows() == dof.get_fe(0).n_components(), - ExcDimensionMismatch(couplings.n_rows(), dof.get_fe(0).n_components())); - Assert( - couplings.n_cols() == dof.get_fe(0).n_components(), - ExcDimensionMismatch(couplings.n_cols(), dof.get_fe(0).n_components())); + Assert(couplings.n_rows() == dof.get_fe(0).n_components(), + ExcDimensionMismatch(couplings.n_rows(), + dof.get_fe(0).n_components())); + Assert(couplings.n_cols() == dof.get_fe(0).n_components(), + ExcDimensionMismatch(couplings.n_cols(), + dof.get_fe(0).n_components())); // If we have a distributed::Triangulation only allow locally_owned // subdomain. Not setting a subdomain is also okay, because we skip // ghost cells in the loop below. - Assert( - (dof.get_triangulation().locally_owned_subdomain() == - numbers::invalid_subdomain_id) || - (subdomain_id == numbers::invalid_subdomain_id) || - (subdomain_id == dof.get_triangulation().locally_owned_subdomain()), - ExcMessage( - "For parallel::distributed::Triangulation objects and " - "associated DoF handler objects, asking for any subdomain other " - "than the locally owned one does not make sense.")); + Assert((dof.get_triangulation().locally_owned_subdomain() == + numbers::invalid_subdomain_id) || + (subdomain_id == numbers::invalid_subdomain_id) || + (subdomain_id == + dof.get_triangulation().locally_owned_subdomain()), + ExcMessage( + "For parallel::distributed::Triangulation objects and " + "associated DoF handler objects, asking for any subdomain other " + "than the locally owned one does not make sense.")); const hp::FECollection &fe_collection = @@ -162,8 +163,9 @@ namespace DoFTools std::vector> bool_dof_mask(fe_collection.size()); for (unsigned int f = 0; f < fe_collection.size(); ++f) { - bool_dof_mask[f].reinit(TableIndices<2>( - fe_collection[f].dofs_per_cell, fe_collection[f].dofs_per_cell)); + bool_dof_mask[f].reinit( + TableIndices<2>(fe_collection[f].dofs_per_cell, + fe_collection[f].dofs_per_cell)); bool_dof_mask[f].fill(false); for (unsigned int i = 0; i < fe_collection[f].dofs_per_cell; ++i) for (unsigned int j = 0; j < fe_collection[f].dofs_per_cell; ++j) @@ -503,15 +505,15 @@ namespace DoFTools // If we have a distributed::Triangulation only allow locally_owned // subdomain. Not setting a subdomain is also okay, because we skip // ghost cells in the loop below. - Assert( - (dof.get_triangulation().locally_owned_subdomain() == - numbers::invalid_subdomain_id) || - (subdomain_id == numbers::invalid_subdomain_id) || - (subdomain_id == dof.get_triangulation().locally_owned_subdomain()), - ExcMessage( - "For parallel::distributed::Triangulation objects and " - "associated DoF handler objects, asking for any subdomain other " - "than the locally owned one does not make sense.")); + Assert((dof.get_triangulation().locally_owned_subdomain() == + numbers::invalid_subdomain_id) || + (subdomain_id == numbers::invalid_subdomain_id) || + (subdomain_id == + dof.get_triangulation().locally_owned_subdomain()), + ExcMessage( + "For parallel::distributed::Triangulation objects and " + "associated DoF handler objects, asking for any subdomain other " + "than the locally owned one does not make sense.")); std::vector dofs_on_this_cell; std::vector dofs_on_other_cell; @@ -540,8 +542,9 @@ namespace DoFTools // make sparsity pattern for this cell. if no constraints pattern // was given, then the following call acts as if simply no // constraints existed - constraints.add_entries_local_to_global( - dofs_on_this_cell, sparsity, keep_constrained_dofs); + constraints.add_entries_local_to_global(dofs_on_this_cell, + sparsity, + keep_constrained_dofs); for (unsigned int face = 0; face < GeometryInfo::faces_per_cell; @@ -667,12 +670,12 @@ namespace DoFTools const FiniteElement &fe, const Table<2, Coupling> & component_couplings) { - Assert( - component_couplings.n_rows() == fe.n_components(), - ExcDimensionMismatch(component_couplings.n_rows(), fe.n_components())); - Assert( - component_couplings.n_cols() == fe.n_components(), - ExcDimensionMismatch(component_couplings.n_cols(), fe.n_components())); + Assert(component_couplings.n_rows() == fe.n_components(), + ExcDimensionMismatch(component_couplings.n_rows(), + fe.n_components())); + Assert(component_couplings.n_cols() == fe.n_components(), + ExcDimensionMismatch(component_couplings.n_cols(), + fe.n_components())); const unsigned int n_dofs = fe.dofs_per_cell; @@ -744,12 +747,9 @@ namespace DoFTools std::vector dofs_on_other_cell( fe.dofs_per_cell); - const Table<2, Coupling> int_dof_mask = - dof_couplings_from_component_couplings( - fe, int_mask), - flux_dof_mask = - dof_couplings_from_component_couplings( - fe, flux_mask); + const Table<2, Coupling> + int_dof_mask = dof_couplings_from_component_couplings(fe, int_mask), + flux_dof_mask = dof_couplings_from_component_couplings(fe, flux_mask); Table<2, bool> support_on_face( fe.dofs_per_cell, @@ -1189,10 +1189,9 @@ namespace DoFTools .get_nonzero_components(j) .first_selected_component()); - Assert( - jj < - sub_neighbor->get_fe().n_components(), - ExcInternalError()); + Assert(jj < sub_neighbor->get_fe() + .n_components(), + ExcInternalError()); if ((flux_mask(ii, jj) == always) || (flux_mask(ii, jj) == nonzero)) @@ -1330,15 +1329,15 @@ namespace DoFTools // If we have a distributed::Triangulation only allow locally_owned // subdomain. Not setting a subdomain is also okay, because we skip // ghost cells in the loop below. - Assert( - (dof.get_triangulation().locally_owned_subdomain() == - numbers::invalid_subdomain_id) || - (subdomain_id == numbers::invalid_subdomain_id) || - (subdomain_id == dof.get_triangulation().locally_owned_subdomain()), - ExcMessage( - "For parallel::distributed::Triangulation objects and " - "associated DoF handler objects, asking for any subdomain other " - "than the locally owned one does not make sense.")); + Assert((dof.get_triangulation().locally_owned_subdomain() == + numbers::invalid_subdomain_id) || + (subdomain_id == numbers::invalid_subdomain_id) || + (subdomain_id == + dof.get_triangulation().locally_owned_subdomain()), + ExcMessage( + "For parallel::distributed::Triangulation objects and " + "associated DoF handler objects, asking for any subdomain other " + "than the locally owned one does not make sense.")); internal::make_flux_sparsity_pattern(dof, sparsity, diff --git a/source/dofs/dof_tools_sparsity.inst.in b/source/dofs/dof_tools_sparsity.inst.in index bfc03f0d14..479ae6e1f3 100644 --- a/source/dofs/dof_tools_sparsity.inst.in +++ b/source/dofs/dof_tools_sparsity.inst.in @@ -319,12 +319,11 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS) const std::vector &, SP &); - template void - DoFTools::make_boundary_sparsity_pattern, - SP>( - const hp::DoFHandler &dof, - const std::vector &, - SP &); + template void DoFTools::make_boundary_sparsity_pattern< + hp::DoFHandler, + SP>(const hp::DoFHandler &dof, + const std::vector &, + SP &); template void DoFTools::make_flux_sparsity_pattern, SP>( diff --git a/source/dofs/number_cache.cc b/source/dofs/number_cache.cc index 27d334a1eb..6deff5e034 100644 --- a/source/dofs/number_cache.cc +++ b/source/dofs/number_cache.cc @@ -26,25 +26,27 @@ namespace internal { namespace DoFHandlerImplementation { - NumberCache::NumberCache() : n_global_dofs(0), n_locally_owned_dofs(0) + NumberCache::NumberCache() + : n_global_dofs(0) + , n_locally_owned_dofs(0) {} - NumberCache::NumberCache(const types::global_dof_index n_global_dofs) : - n_global_dofs(n_global_dofs), - n_locally_owned_dofs(n_global_dofs), - locally_owned_dofs(complete_index_set(n_global_dofs)), - n_locally_owned_dofs_per_processor(1, n_global_dofs), - locally_owned_dofs_per_processor(1, complete_index_set(n_global_dofs)) + NumberCache::NumberCache(const types::global_dof_index n_global_dofs) + : n_global_dofs(n_global_dofs) + , n_locally_owned_dofs(n_global_dofs) + , locally_owned_dofs(complete_index_set(n_global_dofs)) + , n_locally_owned_dofs_per_processor(1, n_global_dofs) + , locally_owned_dofs_per_processor(1, complete_index_set(n_global_dofs)) {} NumberCache::NumberCache( const std::vector &locally_owned_dofs_per_processor, - const unsigned int my_rank) : - locally_owned_dofs_per_processor(locally_owned_dofs_per_processor) + const unsigned int my_rank) + : locally_owned_dofs_per_processor(locally_owned_dofs_per_processor) { const unsigned int n_procs = locally_owned_dofs_per_processor.size(); diff --git a/source/fe/fe.cc b/source/fe/fe.cc index 220256c34e..b35ab09ab7 100644 --- a/source/fe/fe.cc +++ b/source/fe/fe.cc @@ -38,8 +38,8 @@ DEAL_II_NAMESPACE_OPEN template -FiniteElement::InternalDataBase::InternalDataBase() : - update_each(update_default) +FiniteElement::InternalDataBase::InternalDataBase() + : update_each(update_default) {} @@ -57,34 +57,36 @@ template FiniteElement::FiniteElement( const FiniteElementData & fe_data, const std::vector & r_i_a_f, - const std::vector &nonzero_c) : - FiniteElementData(fe_data), - adjust_quad_dof_index_for_face_orientation_table( - dim == 3 ? this->dofs_per_quad : 0, - dim == 3 ? 8 : 0), - adjust_line_dof_index_for_line_orientation_table( - dim == 3 ? this->dofs_per_line : 0), - system_to_base_table(this->dofs_per_cell), - face_system_to_base_table(this->dofs_per_face), - component_to_base_table(this->components, - std::make_pair(std::make_pair(0U, 0U), 0U)), + const std::vector &nonzero_c) + : FiniteElementData(fe_data) + , adjust_quad_dof_index_for_face_orientation_table(dim == 3 ? + this->dofs_per_quad : + 0, + dim == 3 ? 8 : 0) + , adjust_line_dof_index_for_line_orientation_table( + dim == 3 ? this->dofs_per_line : 0) + , system_to_base_table(this->dofs_per_cell) + , face_system_to_base_table(this->dofs_per_face) + , component_to_base_table(this->components, + std::make_pair(std::make_pair(0U, 0U), 0U)) + , // Special handling of vectors of length one: in this case, we // assume that all entries were supposed to be equal restriction_is_additive_flags( r_i_a_f.size() == 1 ? std::vector(fe_data.dofs_per_cell, r_i_a_f[0]) : - r_i_a_f), - nonzero_components( - nonzero_c.size() == 1 ? - std::vector(fe_data.dofs_per_cell, nonzero_c[0]) : - nonzero_c), - n_nonzero_components_table(compute_n_nonzero_components(nonzero_components)), - cached_primitivity(std::find_if(n_nonzero_components_table.begin(), - n_nonzero_components_table.end(), - std::bind(std::not_equal_to(), - std::placeholders::_1, - 1U)) == - n_nonzero_components_table.end()) + r_i_a_f) + , nonzero_components( + nonzero_c.size() == 1 ? + std::vector(fe_data.dofs_per_cell, nonzero_c[0]) : + nonzero_c) + , n_nonzero_components_table(compute_n_nonzero_components(nonzero_components)) + , cached_primitivity(std::find_if(n_nonzero_components_table.begin(), + n_nonzero_components_table.end(), + std::bind(std::not_equal_to(), + std::placeholders::_1, + 1U)) == + n_nonzero_components_table.end()) { Assert(restriction_is_additive_flags.size() == this->dofs_per_cell, ExcDimensionMismatch(restriction_is_additive_flags.size(), @@ -130,12 +132,12 @@ FiniteElement::FiniteElement( ref < RefinementCase::isotropic_refinement + 1; ++ref) { - prolongation[ref - 1].resize( - GeometryInfo::n_children(RefinementCase(ref)), - FullMatrix()); - restriction[ref - 1].resize( - GeometryInfo::n_children(RefinementCase(ref)), - FullMatrix()); + prolongation[ref - 1].resize(GeometryInfo::n_children( + RefinementCase(ref)), + FullMatrix()); + restriction[ref - 1].resize(GeometryInfo::n_children( + RefinementCase(ref)), + FullMatrix()); } adjust_quad_dof_index_for_face_orientation_table.fill(0); @@ -306,17 +308,18 @@ FiniteElement::get_restriction_matrix( const RefinementCase &refinement_case) const { Assert(refinement_case < RefinementCase::isotropic_refinement + 1, - ExcIndexRange( - refinement_case, 0, RefinementCase::isotropic_refinement + 1)); - Assert( - refinement_case != RefinementCase::no_refinement, - ExcMessage("Restriction matrices are only available for refined cells!")); - Assert( - child < GeometryInfo::n_children(RefinementCase(refinement_case)), - ExcIndexRange( - child, - 0, - GeometryInfo::n_children(RefinementCase(refinement_case)))); + ExcIndexRange(refinement_case, + 0, + RefinementCase::isotropic_refinement + 1)); + Assert(refinement_case != RefinementCase::no_refinement, + ExcMessage( + "Restriction matrices are only available for refined cells!")); + Assert(child < + GeometryInfo::n_children(RefinementCase(refinement_case)), + ExcIndexRange(child, + 0, + GeometryInfo::n_children( + RefinementCase(refinement_case)))); // we use refinement_case-1 here. the -1 takes care of the origin of the // vector, as for RefinementCase::no_refinement (=0) there is no data // available and so the vector indices are shifted @@ -334,17 +337,18 @@ FiniteElement::get_prolongation_matrix( const RefinementCase &refinement_case) const { Assert(refinement_case < RefinementCase::isotropic_refinement + 1, - ExcIndexRange( - refinement_case, 0, RefinementCase::isotropic_refinement + 1)); - Assert( - refinement_case != RefinementCase::no_refinement, - ExcMessage("Prolongation matrices are only available for refined cells!")); - Assert( - child < GeometryInfo::n_children(RefinementCase(refinement_case)), - ExcIndexRange( - child, - 0, - GeometryInfo::n_children(RefinementCase(refinement_case)))); + ExcIndexRange(refinement_case, + 0, + RefinementCase::isotropic_refinement + 1)); + Assert(refinement_case != RefinementCase::no_refinement, + ExcMessage( + "Prolongation matrices are only available for refined cells!")); + Assert(child < + GeometryInfo::n_children(RefinementCase(refinement_case)), + ExcIndexRange(child, + 0, + GeometryInfo::n_children( + RefinementCase(refinement_case)))); // we use refinement_case-1 here. the -1 takes care // of the origin of the vector, as for // RefinementCase::no_refinement (=0) there is no @@ -570,12 +574,12 @@ FiniteElement::face_to_cell_index(const unsigned int face_index, // other than standard orientation if ((face_orientation != true) || (face_flip != false) || (face_rotation != false)) - Assert( - (this->dofs_per_line <= 1) && (this->dofs_per_quad <= 1), - ExcMessage("The function in this base class can not handle this case. " - "Rather, the derived class you are using must provide " - "an overloaded version but apparently hasn't done so. See " - "the documentation of this function for more information.")); + Assert((this->dofs_per_line <= 1) && (this->dofs_per_quad <= 1), + ExcMessage( + "The function in this base class can not handle this case. " + "Rather, the derived class you are using must provide " + "an overloaded version but apparently hasn't done so. See " + "the documentation of this function for more information.")); // we need to distinguish between DoFs on vertices, lines and in 3d quads. // do so in a sequence of if-else statements @@ -1145,11 +1149,11 @@ FiniteElement::get_sub_fe(const ComponentMask &mask) const #ifdef DEBUG // check that it is contiguous: for (unsigned int c = 0; c < n_total_components; ++c) - Assert( - (c < first_selected && (!mask[c])) || - (c >= first_selected && c < first_selected + n_selected && mask[c]) || - (c >= first_selected + n_selected && !mask[c]), - ExcMessage("Error: the given ComponentMask is not contiguous!")); + Assert((c < first_selected && (!mask[c])) || + (c >= first_selected && c < first_selected + n_selected && + mask[c]) || + (c >= first_selected + n_selected && !mask[c]), + ExcMessage("Error: the given ComponentMask is not contiguous!")); #endif return get_sub_fe(first_selected, n_selected); diff --git a/source/fe/fe_abf.cc b/source/fe/fe_abf.cc index f4efe8681f..4339c745e9 100644 --- a/source/fe/fe_abf.cc +++ b/source/fe/fe_abf.cc @@ -45,17 +45,17 @@ DEAL_II_NAMESPACE_OPEN template -FE_ABF::FE_ABF(const unsigned int deg) : - FE_PolyTensor, dim>( - deg, - FiniteElementData(get_dpo_vector(deg), - dim, - deg + 2, - FiniteElementData::Hdiv), - std::vector(PolynomialsABF::compute_n_pols(deg), true), - std::vector(PolynomialsABF::compute_n_pols(deg), - std::vector(dim, true))), - rt_order(deg) +FE_ABF::FE_ABF(const unsigned int deg) + : FE_PolyTensor, dim>( + deg, + FiniteElementData(get_dpo_vector(deg), + dim, + deg + 2, + FiniteElementData::Hdiv), + std::vector(PolynomialsABF::compute_n_pols(deg), true), + std::vector(PolynomialsABF::compute_n_pols(deg), + std::vector(dim, true))) + , rt_order(deg) { Assert(dim >= 2, ExcImpossibleInDim(dim)); const unsigned int n_dofs = this->dofs_per_cell; @@ -277,17 +277,19 @@ FE_ABF::initialize_support_points(const unsigned int deg) // TODO: Here the canonical extension of the principle // behind the ABF elements is implemented. It is unclear, // if this really leads to the ABF spaces in 3D! - interior_weights_abf.reinit(TableIndices<3>( - cell_quadrature.size(), polynomials_abf[0]->n() * dim, dim)); + interior_weights_abf.reinit(TableIndices<3>(cell_quadrature.size(), + polynomials_abf[0]->n() * dim, + dim)); Tensor<1, dim> poly_grad; for (unsigned int k = 0; k < cell_quadrature.size(); ++k) { for (unsigned int i = 0; i < polynomials_abf[0]->n() * dim; ++i) { - poly_grad = polynomials_abf[i % dim]->compute_grad( - i / dim, cell_quadrature.point(k)) * - cell_quadrature.weight(k); + poly_grad = + polynomials_abf[i % dim]->compute_grad(i / dim, + cell_quadrature.point(k)) * + cell_quadrature.weight(k); // The minus sign comes from the use of the Gauss theorem to replace // the divergence. for (unsigned int d = 0; d < dim; ++d) @@ -382,8 +384,9 @@ FE_ABF::initialize_restriction() // subcell are NOT // transformed, so we // have to do it here. - this->restriction[iso][child]( - face * this->dofs_per_face + i_face, i_child) += + this->restriction[iso][child](face * this->dofs_per_face + + i_face, + i_child) += Utilities::fixed_power(.5) * q_sub.weight(k) * cached_values_face(i_child, k) * this->shape_value_component( @@ -436,8 +439,9 @@ FE_ABF::initialize_restriction() for (unsigned int i_weight = 0; i_weight < polynomials[d]->n(); ++i_weight) { - this->restriction[iso][child]( - start_cell_dofs + i_weight * dim + d, i_child) += + this->restriction[iso][child](start_cell_dofs + i_weight * dim + + d, + i_child) += q_sub.weight(k) * cached_values_cell(i_child, k, d) * polynomials[d]->compute_value(i_weight, q_sub.point(k)); } @@ -535,9 +539,9 @@ FE_ABF::convert_generalized_support_point_values_to_dof_values( Assert(support_point_values.size() == this->generalized_support_points.size(), ExcDimensionMismatch(support_point_values.size(), this->generalized_support_points.size())); - Assert( - support_point_values[0].size() == this->n_components(), - ExcDimensionMismatch(support_point_values[0].size(), this->n_components())); + Assert(support_point_values[0].size() == this->n_components(), + ExcDimensionMismatch(support_point_values[0].size(), + this->n_components())); Assert(nodal_values.size() == this->dofs_per_cell, ExcDimensionMismatch(nodal_values.size(), this->dofs_per_cell)); diff --git a/source/fe/fe_bdm.cc b/source/fe/fe_bdm.cc index 30ab52d7ac..061b1f74ca 100644 --- a/source/fe/fe_bdm.cc +++ b/source/fe/fe_bdm.cc @@ -38,16 +38,16 @@ DEAL_II_NAMESPACE_OPEN template -FE_BDM::FE_BDM(const unsigned int deg) : - FE_PolyTensor, dim>( - deg, - FiniteElementData(get_dpo_vector(deg), - dim, - deg + 1, - FiniteElementData::Hdiv), - get_ria_vector(deg), - std::vector(PolynomialsBDM::compute_n_pols(deg), - std::vector(dim, true))) +FE_BDM::FE_BDM(const unsigned int deg) + : FE_PolyTensor, dim>( + deg, + FiniteElementData(get_dpo_vector(deg), + dim, + deg + 1, + FiniteElementData::Hdiv), + get_ria_vector(deg), + std::vector(PolynomialsBDM::compute_n_pols(deg), + std::vector(dim, true))) { Assert(dim >= 2, ExcImpossibleInDim(dim)); Assert( @@ -181,8 +181,9 @@ FE_BDM::convert_generalized_support_point_values_to_dof_values( AssertDimension(dbase, this->dofs_per_face * GeometryInfo::faces_per_cell); - AssertDimension( - pbase, this->generalized_support_points.size() - test_values_cell.size()); + AssertDimension(pbase, + this->generalized_support_points.size() - + test_values_cell.size()); // Done for BDM1 if (dbase == this->dofs_per_cell) @@ -361,8 +362,9 @@ FE_BDM::initialize_support_points(const unsigned int deg) // point values on faces in 2D. In 3D, this is impossible, since the // moments are only taken with respect to PolynomialsP. if (dim > 2) - internal::FE_BDM::initialize_test_values( - test_values_face, face_points, deg); + internal::FE_BDM::initialize_test_values(test_values_face, + face_points, + deg); if (deg <= 1) return; @@ -378,8 +380,9 @@ FE_BDM::initialize_support_points(const unsigned int deg) // the test functions in the // interior quadrature points - internal::FE_BDM::initialize_test_values( - test_values_cell, cell_points, deg - 2); + internal::FE_BDM::initialize_test_values(test_values_cell, + cell_points, + deg - 2); } diff --git a/source/fe/fe_bernstein.cc b/source/fe/fe_bernstein.cc index 549811ae46..394ba22f6c 100644 --- a/source/fe/fe_bernstein.cc +++ b/source/fe/fe_bernstein.cc @@ -34,14 +34,14 @@ DEAL_II_NAMESPACE_OPEN template -FE_Bernstein::FE_Bernstein(const unsigned int degree) : - FE_Q_Base, dim, spacedim>( - this->renumber_bases(degree), - FiniteElementData(this->get_dpo_vector(degree), - 1, - degree, - FiniteElementData::H1), - std::vector(1, false)) +FE_Bernstein::FE_Bernstein(const unsigned int degree) + : FE_Q_Base, dim, spacedim>( + this->renumber_bases(degree), + FiniteElementData(this->get_dpo_vector(degree), + 1, + degree, + FiniteElementData::H1), + std::vector(1, false)) {} @@ -97,8 +97,9 @@ FE_Bernstein::get_face_interpolation_matrix( FullMatrix & interpolation_matrix) const { Assert(dim > 1, ExcImpossibleInDim(1)); - get_subface_interpolation_matrix( - source_fe, numbers::invalid_unsigned_int, interpolation_matrix); + get_subface_interpolation_matrix(source_fe, + numbers::invalid_unsigned_int, + interpolation_matrix); } @@ -109,9 +110,9 @@ FE_Bernstein::get_subface_interpolation_matrix( const unsigned int subface, FullMatrix & interpolation_matrix) const { - Assert( - interpolation_matrix.m() == x_source_fe.dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.m(), x_source_fe.dofs_per_face)); + Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.dofs_per_face)); // see if source is a Bernstein element if (const FE_Bernstein *source_fe = @@ -119,9 +120,9 @@ FE_Bernstein::get_subface_interpolation_matrix( { // have this test in here since a table of size 2x0 reports its size as // 0x0 - Assert( - interpolation_matrix.n() == this->dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); + Assert(interpolation_matrix.n() == this->dofs_per_face, + ExcDimensionMismatch(interpolation_matrix.n(), + this->dofs_per_face)); // Make sure that the element for which the DoFs should be constrained // is the one with the higher polynomial degree. Actually the procedure diff --git a/source/fe/fe_data.cc b/source/fe/fe_data.cc index fe5032b343..d3b633b763 100644 --- a/source/fe/fe_data.cc +++ b/source/fe/fe_data.cc @@ -25,34 +25,35 @@ FiniteElementData::FiniteElementData( const unsigned int n_components, const unsigned int degree, const Conformity conformity, - const BlockIndices & block_indices) : - dofs_per_vertex(dofs_per_object[0]), - dofs_per_line(dofs_per_object[1]), - dofs_per_quad(dim > 1 ? dofs_per_object[2] : 0), - dofs_per_hex(dim > 2 ? dofs_per_object[3] : 0), - first_line_index(GeometryInfo::vertices_per_cell * dofs_per_vertex), - first_quad_index(first_line_index + - GeometryInfo::lines_per_cell * dofs_per_line), - first_hex_index(first_quad_index + - GeometryInfo::quads_per_cell * dofs_per_quad), - first_face_line_index(GeometryInfo::vertices_per_cell * - dofs_per_vertex), - first_face_quad_index( - (dim == 3 ? GeometryInfo::vertices_per_cell * dofs_per_vertex : - GeometryInfo::vertices_per_cell * dofs_per_vertex) + - GeometryInfo::lines_per_cell * dofs_per_line), - dofs_per_face(GeometryInfo::vertices_per_face * dofs_per_vertex + - GeometryInfo::lines_per_face * dofs_per_line + - GeometryInfo::quads_per_face * dofs_per_quad), - dofs_per_cell(GeometryInfo::vertices_per_cell * dofs_per_vertex + - GeometryInfo::lines_per_cell * dofs_per_line + - GeometryInfo::quads_per_cell * dofs_per_quad + - GeometryInfo::hexes_per_cell * dofs_per_hex), - components(n_components), - degree(degree), - conforming_space(conformity), - block_indices_data( - block_indices.size() == 0 ? BlockIndices(1, dofs_per_cell) : block_indices) + const BlockIndices & block_indices) + : dofs_per_vertex(dofs_per_object[0]) + , dofs_per_line(dofs_per_object[1]) + , dofs_per_quad(dim > 1 ? dofs_per_object[2] : 0) + , dofs_per_hex(dim > 2 ? dofs_per_object[3] : 0) + , first_line_index(GeometryInfo::vertices_per_cell * dofs_per_vertex) + , first_quad_index(first_line_index + + GeometryInfo::lines_per_cell * dofs_per_line) + , first_hex_index(first_quad_index + + GeometryInfo::quads_per_cell * dofs_per_quad) + , first_face_line_index(GeometryInfo::vertices_per_cell * + dofs_per_vertex) + , first_face_quad_index( + (dim == 3 ? GeometryInfo::vertices_per_cell * dofs_per_vertex : + GeometryInfo::vertices_per_cell * dofs_per_vertex) + + GeometryInfo::lines_per_cell * dofs_per_line) + , dofs_per_face(GeometryInfo::vertices_per_face * dofs_per_vertex + + GeometryInfo::lines_per_face * dofs_per_line + + GeometryInfo::quads_per_face * dofs_per_quad) + , dofs_per_cell(GeometryInfo::vertices_per_cell * dofs_per_vertex + + GeometryInfo::lines_per_cell * dofs_per_line + + GeometryInfo::quads_per_cell * dofs_per_quad + + GeometryInfo::hexes_per_cell * dofs_per_hex) + , components(n_components) + , degree(degree) + , conforming_space(conformity) + , block_indices_data(block_indices.size() == 0 ? + BlockIndices(1, dofs_per_cell) : + block_indices) { Assert(dofs_per_object.size() == dim + 1, ExcDimensionMismatch(dofs_per_object.size() - 1, dim)); diff --git a/source/fe/fe_dg_vector.cc b/source/fe/fe_dg_vector.cc index 39e8b7deea..6b75c80588 100644 --- a/source/fe/fe_dg_vector.cc +++ b/source/fe/fe_dg_vector.cc @@ -26,8 +26,8 @@ DEAL_II_NAMESPACE_OPEN template -FE_DGNedelec::FE_DGNedelec(const unsigned int p) : - FE_DGVector, dim, spacedim>(p, mapping_nedelec) +FE_DGNedelec::FE_DGNedelec(const unsigned int p) + : FE_DGVector, dim, spacedim>(p, mapping_nedelec) {} @@ -49,10 +49,10 @@ FE_DGNedelec::get_name() const template -FE_DGRaviartThomas::FE_DGRaviartThomas(const unsigned int p) : - FE_DGVector, dim, spacedim>( - p, - mapping_raviart_thomas) +FE_DGRaviartThomas::FE_DGRaviartThomas(const unsigned int p) + : FE_DGVector, dim, spacedim>( + p, + mapping_raviart_thomas) {} @@ -76,8 +76,8 @@ FE_DGRaviartThomas::get_name() const template -FE_DGBDM::FE_DGBDM(const unsigned int p) : - FE_DGVector, dim, spacedim>(p, mapping_bdm) +FE_DGBDM::FE_DGBDM(const unsigned int p) + : FE_DGVector, dim, spacedim>(p, mapping_bdm) {} diff --git a/source/fe/fe_dgp.cc b/source/fe/fe_dgp.cc index 71f07f5e46..c4e7593bcb 100644 --- a/source/fe/fe_dgp.cc +++ b/source/fe/fe_dgp.cc @@ -25,20 +25,20 @@ DEAL_II_NAMESPACE_OPEN template -FE_DGP::FE_DGP(const unsigned int degree) : - FE_Poly, dim, spacedim>( - PolynomialSpace( - Polynomials::Legendre::generate_complete_basis(degree)), - FiniteElementData(get_dpo_vector(degree), - 1, - degree, - FiniteElementData::L2), - std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, - true), - std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, - std::vector(1, true))) +FE_DGP::FE_DGP(const unsigned int degree) + : FE_Poly, dim, spacedim>( + PolynomialSpace( + Polynomials::Legendre::generate_complete_basis(degree)), + FiniteElementData(get_dpo_vector(degree), + 1, + degree, + FiniteElementData::L2), + std::vector( + FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, + true), + std::vector( + FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, + std::vector(1, true))) { // Reinit the vectors of restriction and prolongation matrices to the right // sizes diff --git a/source/fe/fe_dgp_monomial.cc b/source/fe/fe_dgp_monomial.cc index dd6ec78dc6..759c2d9f83 100644 --- a/source/fe/fe_dgp_monomial.cc +++ b/source/fe/fe_dgp_monomial.cc @@ -128,19 +128,19 @@ namespace internal template -FE_DGPMonomial::FE_DGPMonomial(const unsigned int degree) : - FE_Poly, dim>( - PolynomialsP(degree), - FiniteElementData(get_dpo_vector(degree), - 1, - degree, - FiniteElementData::L2), - std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, - true), - std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, - std::vector(1, true))) +FE_DGPMonomial::FE_DGPMonomial(const unsigned int degree) + : FE_Poly, dim>( + PolynomialsP(degree), + FiniteElementData(get_dpo_vector(degree), + 1, + degree, + FiniteElementData::L2), + std::vector( + FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, + true), + std::vector( + FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, + std::vector(1, true))) { Assert(this->poly_space.n() == this->dofs_per_cell, ExcInternalError()); Assert(this->poly_space.degree() == this->degree, ExcInternalError()); @@ -285,10 +285,10 @@ FE_DGPMonomial::get_face_interpolation_matrix( // is necessarily empty -- i.e. there isn't // much we need to do here. (void)interpolation_matrix; - AssertThrow( - (x_source_fe.get_name().find("FE_DGPMonomial<") == 0) || - (dynamic_cast *>(&x_source_fe) != nullptr), - typename FiniteElement::ExcInterpolationNotImplemented()); + AssertThrow((x_source_fe.get_name().find("FE_DGPMonomial<") == 0) || + (dynamic_cast *>(&x_source_fe) != + nullptr), + typename FiniteElement::ExcInterpolationNotImplemented()); Assert(interpolation_matrix.m() == 0, ExcDimensionMismatch(interpolation_matrix.m(), 0)); @@ -312,10 +312,10 @@ FE_DGPMonomial::get_subface_interpolation_matrix( // is necessarily empty -- i.e. there isn't // much we need to do here. (void)interpolation_matrix; - AssertThrow( - (x_source_fe.get_name().find("FE_DGPMonomial<") == 0) || - (dynamic_cast *>(&x_source_fe) != nullptr), - typename FiniteElement::ExcInterpolationNotImplemented()); + AssertThrow((x_source_fe.get_name().find("FE_DGPMonomial<") == 0) || + (dynamic_cast *>(&x_source_fe) != + nullptr), + typename FiniteElement::ExcInterpolationNotImplemented()); Assert(interpolation_matrix.m() == 0, ExcDimensionMismatch(interpolation_matrix.m(), 0)); diff --git a/source/fe/fe_dgp_nonparametric.cc b/source/fe/fe_dgp_nonparametric.cc index c3efdc14c6..99c94c4aba 100644 --- a/source/fe/fe_dgp_nonparametric.cc +++ b/source/fe/fe_dgp_nonparametric.cc @@ -34,19 +34,19 @@ DEAL_II_NAMESPACE_OPEN template FE_DGPNonparametric::FE_DGPNonparametric( - const unsigned int degree) : - FiniteElement( - FiniteElementData(get_dpo_vector(degree), - 1, - degree, - FiniteElementData::L2), - std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, - true), - std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, - std::vector(1, true))), - polynomial_space(Polynomials::Legendre::generate_complete_basis(degree)) + const unsigned int degree) + : FiniteElement( + FiniteElementData(get_dpo_vector(degree), + 1, + degree, + FiniteElementData::L2), + std::vector( + FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, + true), + std::vector( + FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, + std::vector(1, true))) + , polynomial_space(Polynomials::Legendre::generate_complete_basis(degree)) { const unsigned int n_dofs = this->dofs_per_cell; for (unsigned int ref_case = RefinementCase::cut_x; diff --git a/source/fe/fe_dgq.cc b/source/fe/fe_dgq.cc index 9707efbf5d..3f7d5c1e24 100644 --- a/source/fe/fe_dgq.cc +++ b/source/fe/fe_dgq.cc @@ -52,20 +52,21 @@ namespace internal template -FE_DGQ::FE_DGQ(const unsigned int degree) : - FE_Poly, dim, spacedim>( - TensorProductPolynomials(Polynomials::generate_complete_Lagrange_basis( - internal::FE_DGQ::get_QGaussLobatto_points(degree))), - FiniteElementData(get_dpo_vector(degree), - 1, - degree, - FiniteElementData::L2), - std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, - true), - std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, - std::vector(1, true))) +FE_DGQ::FE_DGQ(const unsigned int degree) + : FE_Poly, dim, spacedim>( + TensorProductPolynomials( + Polynomials::generate_complete_Lagrange_basis( + internal::FE_DGQ::get_QGaussLobatto_points(degree))), + FiniteElementData(get_dpo_vector(degree), + 1, + degree, + FiniteElementData::L2), + std::vector( + FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, + true), + std::vector( + FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, + std::vector(1, true))) { // Compute support points, which are the tensor product of the Lagrange // interpolation points in the constructor. @@ -84,25 +85,25 @@ FE_DGQ::FE_DGQ(const unsigned int degree) : template FE_DGQ::FE_DGQ( - const std::vector> &polynomials) : - FE_Poly, dim, spacedim>( - TensorProductPolynomials(polynomials), - FiniteElementData(get_dpo_vector(polynomials.size() - 1), - 1, - polynomials.size() - 1, - FiniteElementData::L2), - std::vector( - FiniteElementData(get_dpo_vector(polynomials.size() - 1), - 1, - polynomials.size() - 1) - .dofs_per_cell, - true), - std::vector( + const std::vector> &polynomials) + : FE_Poly, dim, spacedim>( + TensorProductPolynomials(polynomials), FiniteElementData(get_dpo_vector(polynomials.size() - 1), 1, - polynomials.size() - 1) - .dofs_per_cell, - std::vector(1, true))) + polynomials.size() - 1, + FiniteElementData::L2), + std::vector(FiniteElementData(get_dpo_vector( + polynomials.size() - 1), + 1, + polynomials.size() - 1) + .dofs_per_cell, + true), + std::vector( + FiniteElementData(get_dpo_vector(polynomials.size() - 1), + 1, + polynomials.size() - 1) + .dofs_per_cell, + std::vector(1, true))) { // No support points can be defined in general. Derived classes might define // support points like the class FE_DGQArbitraryNodes @@ -264,9 +265,9 @@ FE_DGQ::get_interpolation_matrix( // source FE is also a // DGQ element typedef FiniteElement FE; - AssertThrow( - (dynamic_cast *>(&x_source_fe) != nullptr), - typename FE::ExcInterpolationNotImplemented()); + AssertThrow((dynamic_cast *>(&x_source_fe) != + nullptr), + typename FE::ExcInterpolationNotImplemented()); // ok, source is a Q element, so // we will be able to do the work @@ -275,9 +276,9 @@ FE_DGQ::get_interpolation_matrix( Assert(interpolation_matrix.m() == this->dofs_per_cell, ExcDimensionMismatch(interpolation_matrix.m(), this->dofs_per_cell)); - Assert( - interpolation_matrix.n() == source_fe.dofs_per_cell, - ExcDimensionMismatch(interpolation_matrix.n(), source_fe.dofs_per_cell)); + Assert(interpolation_matrix.n() == source_fe.dofs_per_cell, + ExcDimensionMismatch(interpolation_matrix.n(), + source_fe.dofs_per_cell)); // compute the interpolation @@ -347,9 +348,9 @@ FE_DGQ::get_face_interpolation_matrix( // much we need to do here. (void)interpolation_matrix; typedef FiniteElement FE; - AssertThrow( - (dynamic_cast *>(&x_source_fe) != nullptr), - typename FE::ExcInterpolationNotImplemented()); + AssertThrow((dynamic_cast *>(&x_source_fe) != + nullptr), + typename FE::ExcInterpolationNotImplemented()); Assert(interpolation_matrix.m() == 0, ExcDimensionMismatch(interpolation_matrix.m(), 0)); @@ -374,9 +375,9 @@ FE_DGQ::get_subface_interpolation_matrix( // much we need to do here. (void)interpolation_matrix; typedef FiniteElement FE; - AssertThrow( - (dynamic_cast *>(&x_source_fe) != nullptr), - typename FE::ExcInterpolationNotImplemented()); + AssertThrow((dynamic_cast *>(&x_source_fe) != + nullptr), + typename FE::ExcInterpolationNotImplemented()); Assert(interpolation_matrix.m() == 0, ExcDimensionMismatch(interpolation_matrix.m(), 0)); @@ -393,14 +394,16 @@ FE_DGQ::get_prolongation_matrix( const RefinementCase &refinement_case) const { Assert(refinement_case < RefinementCase::isotropic_refinement + 1, - ExcIndexRange( - refinement_case, 0, RefinementCase::isotropic_refinement + 1)); - Assert( - refinement_case != RefinementCase::no_refinement, - ExcMessage("Prolongation matrices are only available for refined cells!")); - Assert( - child < GeometryInfo::n_children(refinement_case), - ExcIndexRange(child, 0, GeometryInfo::n_children(refinement_case))); + ExcIndexRange(refinement_case, + 0, + RefinementCase::isotropic_refinement + 1)); + Assert(refinement_case != RefinementCase::no_refinement, + ExcMessage( + "Prolongation matrices are only available for refined cells!")); + Assert(child < GeometryInfo::n_children(refinement_case), + ExcIndexRange(child, + 0, + GeometryInfo::n_children(refinement_case))); // initialization upon first request if (this->prolongation[refinement_case - 1][child].n() == 0) @@ -424,11 +427,13 @@ FE_DGQ::get_prolongation_matrix( GeometryInfo::n_children(RefinementCase(refinement_case)), FullMatrix(this->dofs_per_cell, this->dofs_per_cell)); if (dim == spacedim) - FETools::compute_embedding_matrices( - *this, isotropic_matrices, true); + FETools::compute_embedding_matrices(*this, + isotropic_matrices, + true); else - FETools::compute_embedding_matrices( - FE_DGQ(this->degree), isotropic_matrices, true); + FETools::compute_embedding_matrices(FE_DGQ(this->degree), + isotropic_matrices, + true); this_nonconst.prolongation[refinement_case - 1].swap( isotropic_matrices.back()); } @@ -469,14 +474,16 @@ FE_DGQ::get_restriction_matrix( const RefinementCase &refinement_case) const { Assert(refinement_case < RefinementCase::isotropic_refinement + 1, - ExcIndexRange( - refinement_case, 0, RefinementCase::isotropic_refinement + 1)); - Assert( - refinement_case != RefinementCase::no_refinement, - ExcMessage("Restriction matrices are only available for refined cells!")); - Assert( - child < GeometryInfo::n_children(refinement_case), - ExcIndexRange(child, 0, GeometryInfo::n_children(refinement_case))); + ExcIndexRange(refinement_case, + 0, + RefinementCase::isotropic_refinement + 1)); + Assert(refinement_case != RefinementCase::no_refinement, + ExcMessage( + "Restriction matrices are only available for refined cells!")); + Assert(child < GeometryInfo::n_children(refinement_case), + ExcIndexRange(child, + 0, + GeometryInfo::n_children(refinement_case))); // initialization upon first request if (this->restriction[refinement_case - 1][child].n() == 0) @@ -500,11 +507,13 @@ FE_DGQ::get_restriction_matrix( GeometryInfo::n_children(RefinementCase(refinement_case)), FullMatrix(this->dofs_per_cell, this->dofs_per_cell)); if (dim == spacedim) - FETools::compute_projection_matrices( - *this, isotropic_matrices, true); + FETools::compute_projection_matrices(*this, + isotropic_matrices, + true); else - FETools::compute_projection_matrices( - FE_DGQ(this->degree), isotropic_matrices, true); + FETools::compute_projection_matrices(FE_DGQ(this->degree), + isotropic_matrices, + true); this_nonconst.restriction[refinement_case - 1].swap( isotropic_matrices.back()); } @@ -721,9 +730,9 @@ FE_DGQ::memory_consumption() const template FE_DGQArbitraryNodes::FE_DGQArbitraryNodes( - const Quadrature<1> &points) : - FE_DGQ( - Polynomials::generate_complete_Lagrange_basis(points.get_points())) + const Quadrature<1> &points) + : FE_DGQ( + Polynomials::generate_complete_Lagrange_basis(points.get_points())) { Assert(points.size() > 0, (typename FiniteElement::ExcFEHasNoSupportPoints())); @@ -871,8 +880,9 @@ FE_DGQArbitraryNodes::clone() const // ---------------------------------- FE_DGQLegendre ------------------------- template -FE_DGQLegendre::FE_DGQLegendre(const unsigned int degree) : - FE_DGQ(Polynomials::Legendre::generate_complete_basis(degree)) +FE_DGQLegendre::FE_DGQLegendre(const unsigned int degree) + : FE_DGQ( + Polynomials::Legendre::generate_complete_basis(degree)) {} @@ -913,9 +923,9 @@ FE_DGQLegendre::clone() const // ---------------------------------- FE_DGQHermite -------------------------- template -FE_DGQHermite::FE_DGQHermite(const unsigned int degree) : - FE_DGQ( - Polynomials::HermiteLikeInterpolation::generate_complete_basis(degree)) +FE_DGQHermite::FE_DGQHermite(const unsigned int degree) + : FE_DGQ( + Polynomials::HermiteLikeInterpolation::generate_complete_basis(degree)) {} diff --git a/source/fe/fe_enriched.cc b/source/fe/fe_enriched.cc index 0a9ca583dd..c08b19a20d 100644 --- a/source/fe/fe_enriched.cc +++ b/source/fe/fe_enriched.cc @@ -77,9 +77,9 @@ namespace internal &)>>> & functions) { AssertThrow(fes.size() > 0, ExcMessage("FEs size should be >=1")); - AssertThrow( - fes.size() == multiplicities.size(), - ExcMessage("FEs and multiplicities should have the same size")); + AssertThrow(fes.size() == multiplicities.size(), + ExcMessage( + "FEs and multiplicities should have the same size")); AssertThrow(functions.size() == fes.size() - 1, ExcDimensionMismatch(functions.size(), fes.size() - 1)); @@ -133,11 +133,11 @@ namespace internal template FE_Enriched::FE_Enriched( - const FiniteElement &fe_base) : - FE_Enriched( - fe_base, - FE_Nothing(fe_base.n_components(), true), - nullptr) + const FiniteElement &fe_base) + : FE_Enriched(fe_base, + FE_Nothing(fe_base.n_components(), + true), + nullptr) {} @@ -145,18 +145,18 @@ template FE_Enriched::FE_Enriched( const FiniteElement &fe_base, const FiniteElement &fe_enriched, - const Function * enrichment_function) : - FE_Enriched( - &fe_base, - std::vector *>(1, &fe_enriched), - std::vector *( - const typename Triangulation::cell_iterator &)>>>( - 1, - std::vector *( - const typename Triangulation::cell_iterator &)>>( + const Function * enrichment_function) + : FE_Enriched( + &fe_base, + std::vector *>(1, &fe_enriched), + std::vector *( + const typename Triangulation::cell_iterator &)>>>( 1, - [=](const typename Triangulation::cell_iterator &) - -> const Function * { return enrichment_function; }))) + std::vector *( + const typename Triangulation::cell_iterator &)>>( + 1, + [=](const typename Triangulation::cell_iterator &) + -> const Function * { return enrichment_function; }))) {} @@ -165,12 +165,11 @@ FE_Enriched::FE_Enriched( const FiniteElement * fe_base, const std::vector *> &fe_enriched, const std::vector *( - const typename Triangulation::cell_iterator &)>>> - &functions) : - FE_Enriched( - internal::FE_Enriched::build_fes(fe_base, fe_enriched), - internal::FE_Enriched::build_multiplicities(functions), - functions) + const typename Triangulation::cell_iterator &)>>> &functions) + : FE_Enriched( + internal::FE_Enriched::build_fes(fe_base, fe_enriched), + internal::FE_Enriched::build_multiplicities(functions), + functions) {} @@ -179,24 +178,25 @@ FE_Enriched::FE_Enriched( const std::vector *> &fes, const std::vector & multiplicities, const std::vector *( - const typename Triangulation::cell_iterator &)>>> - &functions) : - FiniteElement( - FETools::Compositing::multiply_dof_numbers(fes, multiplicities, false), - FETools::Compositing::compute_restriction_is_additive_flags(fes, - multiplicities), - FETools::Compositing::compute_nonzero_components(fes, - multiplicities, - false)), - enrichments(functions), - is_enriched(internal::FE_Enriched::check_if_enriched(fes)), - fe_system( - std_cxx14::make_unique>(fes, multiplicities)) + const typename Triangulation::cell_iterator &)>>> &functions) + : FiniteElement( + FETools::Compositing::multiply_dof_numbers(fes, multiplicities, false), + FETools::Compositing::compute_restriction_is_additive_flags( + fes, + multiplicities), + FETools::Compositing::compute_nonzero_components(fes, + multiplicities, + false)) + , enrichments(functions) + , is_enriched(internal::FE_Enriched::check_if_enriched(fes)) + , fe_system( + std_cxx14::make_unique>(fes, multiplicities)) { // descriptive error are thrown within the function. - Assert( - internal::FE_Enriched::consistency_check(fes, multiplicities, functions), - ExcInternalError()); + Assert(internal::FE_Enriched::consistency_check(fes, + multiplicities, + functions), + ExcInternalError()); initialize(fes, multiplicities); @@ -371,11 +371,11 @@ FE_Enriched::get_face_data( { auto data = fe_system->get_face_data(update_flags, mapping, quadrature, output_data); - return setup_data( - Utilities::dynamic_unique_cast< - typename FESystem::InternalData>(std::move(data)), - update_flags, - quadrature); + return setup_data(Utilities::dynamic_unique_cast< + typename FESystem::InternalData>( + std::move(data)), + update_flags, + quadrature); } @@ -391,11 +391,11 @@ FE_Enriched::get_subface_data( { auto data = fe_system->get_subface_data(update_flags, mapping, quadrature, output_data); - return setup_data( - Utilities::dynamic_unique_cast< - typename FESystem::InternalData>(std::move(data)), - update_flags, - quadrature); + return setup_data(Utilities::dynamic_unique_cast< + typename FESystem::InternalData>( + std::move(data)), + update_flags, + quadrature); } @@ -409,11 +409,11 @@ FE_Enriched::get_data( &output_data) const { auto data = fe_system->get_data(flags, mapping, quadrature, output_data); - return setup_data( - Utilities::dynamic_unique_cast< - typename FESystem::InternalData>(std::move(data)), - flags, - quadrature); + return setup_data(Utilities::dynamic_unique_cast< + typename FESystem::InternalData>( + std::move(data)), + flags, + quadrature); } @@ -728,16 +728,17 @@ FE_Enriched::multiply_by_enrichment( Assert(enrichments[base_no - 1][m](cell) != nullptr, ExcMessage("The pointer to the enrichment function is NULL")); - Assert( - enrichments[base_no - 1][m](cell)->n_components == 1, - ExcMessage("Only scalar-valued enrichment functions are allowed")); + Assert(enrichments[base_no - 1][m](cell)->n_components == 1, + ExcMessage( + "Only scalar-valued enrichment functions are allowed")); if (flags & update_hessians) { - Assert( - fe_data.enrichment[base_no][m].hessians.size() == n_q_points, - ExcDimensionMismatch( - fe_data.enrichment[base_no][m].hessians.size(), n_q_points)); + Assert(fe_data.enrichment[base_no][m].hessians.size() == + n_q_points, + ExcDimensionMismatch( + fe_data.enrichment[base_no][m].hessians.size(), + n_q_points)); for (unsigned int q = 0; q < n_q_points; q++) fe_data.enrichment[base_no][m].hessians[q] = enrichments[base_no - 1][m](cell)->hessian( @@ -746,10 +747,11 @@ FE_Enriched::multiply_by_enrichment( if (flags & update_gradients) { - Assert( - fe_data.enrichment[base_no][m].gradients.size() == n_q_points, - ExcDimensionMismatch( - fe_data.enrichment[base_no][m].gradients.size(), n_q_points)); + Assert(fe_data.enrichment[base_no][m].gradients.size() == + n_q_points, + ExcDimensionMismatch( + fe_data.enrichment[base_no][m].gradients.size(), + n_q_points)); for (unsigned int q = 0; q < n_q_points; q++) fe_data.enrichment[base_no][m].gradients[q] = enrichments[base_no - 1][m](cell)->gradient( @@ -758,10 +760,10 @@ FE_Enriched::multiply_by_enrichment( if (flags & update_values) { - Assert( - fe_data.enrichment[base_no][m].values.size() == n_q_points, - ExcDimensionMismatch( - fe_data.enrichment[base_no][m].values.size(), n_q_points)); + Assert(fe_data.enrichment[base_no][m].values.size() == n_q_points, + ExcDimensionMismatch( + fe_data.enrichment[base_no][m].values.size(), + n_q_points)); for (unsigned int q = 0; q < n_q_points; q++) fe_data.enrichment[base_no][m].values[q] = enrichments[base_no - 1][m](cell)->value( @@ -902,8 +904,9 @@ FE_Enriched::get_subface_interpolation_matrix( if (const FE_Enriched *fe_enr_other = dynamic_cast *>(&source)) { - fe_system->get_subface_interpolation_matrix( - fe_enr_other->get_fe_system(), subface, matrix); + fe_system->get_subface_interpolation_matrix(fe_enr_other->get_fe_system(), + subface, + matrix); } else { @@ -1022,9 +1025,8 @@ FE_Enriched::get_restriction_matrix( template FE_Enriched::InternalData::InternalData( - std::unique_ptr::InternalData> - fesystem_data) : - fesystem_data(std::move(fesystem_data)) + std::unique_ptr::InternalData> fesystem_data) + : fesystem_data(std::move(fesystem_data)) {} diff --git a/source/fe/fe_face.cc b/source/fe/fe_face.cc index 0827a4b4eb..62505a05ae 100644 --- a/source/fe/fe_face.cc +++ b/source/fe/fe_face.cc @@ -48,16 +48,16 @@ namespace internal } // namespace internal template -FE_FaceQ::FE_FaceQ(const unsigned int degree) : - FE_PolyFace, dim, spacedim>( - TensorProductPolynomials( - Polynomials::generate_complete_Lagrange_basis( - internal::FE_FaceQImplementation::get_QGaussLobatto_points(degree))), - FiniteElementData(get_dpo_vector(degree), - 1, - degree, - FiniteElementData::L2), - std::vector(1, true)) +FE_FaceQ::FE_FaceQ(const unsigned int degree) + : FE_PolyFace, dim, spacedim>( + TensorProductPolynomials( + Polynomials::generate_complete_Lagrange_basis( + internal::FE_FaceQImplementation::get_QGaussLobatto_points(degree))), + FiniteElementData(get_dpo_vector(degree), + 1, + degree, + FiniteElementData::L2), + std::vector(1, true)) { // initialize unit face support points const unsigned int codim = dim - 1; @@ -148,8 +148,9 @@ FE_FaceQ::get_face_interpolation_matrix( const FiniteElement &source_fe, FullMatrix & interpolation_matrix) const { - get_subface_interpolation_matrix( - source_fe, numbers::invalid_unsigned_int, interpolation_matrix); + get_subface_interpolation_matrix(source_fe, + numbers::invalid_unsigned_int, + interpolation_matrix); } @@ -165,9 +166,9 @@ FE_FaceQ::get_subface_interpolation_matrix( Assert(interpolation_matrix.n() == this->dofs_per_face, ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert( - interpolation_matrix.m() == x_source_fe.dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.m(), x_source_fe.dofs_per_face)); + Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.dofs_per_face)); // see if source is a FaceQ element if (const FE_FaceQ *source_fe = @@ -399,9 +400,10 @@ FE_FaceQ::hp_quad_dof_identities( for (unsigned int n1 = 0; n1 < identities_1d.size(); ++n1) for (unsigned int n2 = 0; n2 < identities_1d.size(); ++n2) - identities.emplace_back( - identities_1d[n1].first * (p + 1) + identities_1d[n2].first, - identities_1d[n1].second * (q + 1) + identities_1d[n2].second); + identities.emplace_back(identities_1d[n1].first * (p + 1) + + identities_1d[n2].first, + identities_1d[n1].second * (q + 1) + + identities_1d[n2].second); return identities; } @@ -502,14 +504,14 @@ FE_FaceQ::convert_generalized_support_point_values_to_dof_values( // ----------------------------- FE_FaceQ<1,spacedim> ------------------------ template -FE_FaceQ<1, spacedim>::FE_FaceQ(const unsigned int degree) : - FiniteElement<1, spacedim>( - FiniteElementData<1>(get_dpo_vector(degree), - 1, - degree, - FiniteElementData<1>::L2), - std::vector(1, true), - std::vector(1, ComponentMask(1, true))) +FE_FaceQ<1, spacedim>::FE_FaceQ(const unsigned int degree) + : FiniteElement<1, spacedim>( + FiniteElementData<1>(get_dpo_vector(degree), + 1, + degree, + FiniteElementData<1>::L2), + std::vector(1, true), + std::vector(1, ComponentMask(1, true))) { this->unit_face_support_points.resize(1); @@ -552,8 +554,9 @@ FE_FaceQ<1, spacedim>::get_face_interpolation_matrix( const FiniteElement<1, spacedim> &source_fe, FullMatrix & interpolation_matrix) const { - get_subface_interpolation_matrix( - source_fe, numbers::invalid_unsigned_int, interpolation_matrix); + get_subface_interpolation_matrix(source_fe, + numbers::invalid_unsigned_int, + interpolation_matrix); } @@ -568,9 +571,9 @@ FE_FaceQ<1, spacedim>::get_subface_interpolation_matrix( (void)x_source_fe; Assert(interpolation_matrix.n() == this->dofs_per_face, ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert( - interpolation_matrix.m() == x_source_fe.dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.m(), x_source_fe.dofs_per_face)); + Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.dofs_per_face)); interpolation_matrix(0, 0) = 1.; } @@ -611,8 +614,9 @@ FE_FaceQ<1, spacedim>::hp_vertex_dof_identities( const FiniteElement<1, spacedim> & /*fe_other*/) const { // this element is always discontinuous at vertices - return std::vector>( - 1, std::make_pair(0U, 0U)); + return std::vector>(1, + std::make_pair(0U, + 0U)); } @@ -750,15 +754,15 @@ FE_FaceQ<1, spacedim>::fill_fe_subface_values( // --------------------------------------- FE_FaceP -------------------------- template -FE_FaceP::FE_FaceP(const unsigned int degree) : - FE_PolyFace, dim, spacedim>( - PolynomialSpace( - Polynomials::Legendre::generate_complete_basis(degree)), - FiniteElementData(get_dpo_vector(degree), - 1, - degree, - FiniteElementData::L2), - std::vector(1, true)) +FE_FaceP::FE_FaceP(const unsigned int degree) + : FE_PolyFace, dim, spacedim>( + PolynomialSpace( + Polynomials::Legendre::generate_complete_basis(degree)), + FiniteElementData(get_dpo_vector(degree), + 1, + degree, + FiniteElementData::L2), + std::vector(1, true)) {} @@ -867,8 +871,9 @@ FE_FaceP::get_face_interpolation_matrix( const FiniteElement &source_fe, FullMatrix & interpolation_matrix) const { - get_subface_interpolation_matrix( - source_fe, numbers::invalid_unsigned_int, interpolation_matrix); + get_subface_interpolation_matrix(source_fe, + numbers::invalid_unsigned_int, + interpolation_matrix); } @@ -884,9 +889,9 @@ FE_FaceP::get_subface_interpolation_matrix( Assert(interpolation_matrix.n() == this->dofs_per_face, ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert( - interpolation_matrix.m() == x_source_fe.dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.m(), x_source_fe.dofs_per_face)); + Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.dofs_per_face)); // see if source is a FaceP element if (const FE_FaceP *source_fe = @@ -991,8 +996,8 @@ FE_FaceP::get_constant_modes() const template -FE_FaceP<1, spacedim>::FE_FaceP(const unsigned int degree) : - FE_FaceQ<1, spacedim>(degree) +FE_FaceP<1, spacedim>::FE_FaceP(const unsigned int degree) + : FE_FaceQ<1, spacedim>(degree) {} diff --git a/source/fe/fe_nedelec.cc b/source/fe/fe_nedelec.cc index cf180e9508..68904854aa 100644 --- a/source/fe/fe_nedelec.cc +++ b/source/fe/fe_nedelec.cc @@ -68,16 +68,16 @@ namespace internal template -FE_Nedelec::FE_Nedelec(const unsigned int order) : - FE_PolyTensor, dim>( - order, - FiniteElementData(get_dpo_vector(order), - dim, - order + 1, - FiniteElementData::Hcurl), - std::vector(PolynomialsNedelec::compute_n_pols(order), true), - std::vector(PolynomialsNedelec::compute_n_pols(order), - std::vector(dim, true))) +FE_Nedelec::FE_Nedelec(const unsigned int order) + : FE_PolyTensor, dim>( + order, + FiniteElementData(get_dpo_vector(order), + dim, + order + 1, + FiniteElementData::Hcurl), + std::vector(PolynomialsNedelec::compute_n_pols(order), true), + std::vector(PolynomialsNedelec::compute_n_pols(order), + std::vector(dim, true))) { #ifdef DEBUG_NEDELEC deallog << get_name() << std::endl; @@ -143,8 +143,9 @@ FE_Nedelec::FE_Nedelec(const unsigned int order) : case 3: { - this->interface_constraints.reinit( - 4 * (this->dofs_per_face - this->degree), this->dofs_per_face); + this->interface_constraints.reinit(4 * (this->dofs_per_face - + this->degree), + this->dofs_per_face); unsigned int target_row = 0; @@ -652,24 +653,29 @@ FE_Nedelec::initialize_restriction() dof, quadrature_point_2, 1) - this->restriction[index][i](i * this->degree, dof) * - this->shape_value_component( - i * this->degree, quadrature_point_0, 1)); - tmp(1) = -1.0 * weight * - this->restriction[index][i + 2]( - i * this->degree, dof) * - this->shape_value_component( - i * this->degree, quadrature_point_0, 1); + this->shape_value_component(i * this->degree, + quadrature_point_0, + 1)); + tmp(1) = + -1.0 * weight * + this->restriction[index][i + 2](i * this->degree, + dof) * + this->shape_value_component(i * this->degree, + quadrature_point_0, + 1); quadrature_point_2 = Point( 2.0 * edge_quadrature_points[q_point](0), i); tmp(2) = - weight * (2.0 * this->shape_value_component( - dof, quadrature_point_2, 0) - - this->restriction[index][2 * i]( - (i + 2) * this->degree, dof) * - this->shape_value_component( - (i + 2) * this->degree, - quadrature_point_1, - 0)); + weight * + (2.0 * this->shape_value_component( + dof, quadrature_point_2, 0) - + this->restriction[index][2 * i]((i + 2) * + this->degree, + dof) * + this->shape_value_component((i + 2) * + this->degree, + quadrature_point_1, + 0)); tmp(3) = -1.0 * weight * this->restriction[index][2 * i + 1]( @@ -680,11 +686,13 @@ FE_Nedelec::initialize_restriction() else { - tmp(0) = -1.0 * weight * - this->restriction[index][i]( - i * this->degree, dof) * - this->shape_value_component( - i * this->degree, quadrature_point_0, 1); + tmp(0) = + -1.0 * weight * + this->restriction[index][i](i * this->degree, + dof) * + this->shape_value_component(i * this->degree, + quadrature_point_0, + 1); Point quadrature_point_2( i, @@ -696,26 +704,29 @@ FE_Nedelec::initialize_restriction() dof, quadrature_point_2, 1) - this->restriction[index][i + 2](i * this->degree, dof) * - this->shape_value_component( - i * this->degree, quadrature_point_0, 1)); + this->shape_value_component(i * this->degree, + quadrature_point_0, + 1)); tmp(2) = -1.0 * weight * - this->restriction[index][2 * i]( - (i + 2) * this->degree, dof) * + this->restriction[index][2 * i]((i + 2) * + this->degree, + dof) * this->shape_value_component( (i + 2) * this->degree, quadrature_point_1, 0); quadrature_point_2 = Point( 2.0 * edge_quadrature_points[q_point](0) - 1.0, i); tmp(3) = - weight * (2.0 * this->shape_value_component( - dof, quadrature_point_2, 0) - - this->restriction[index][2 * i + 1]( - (i + 2) * this->degree, dof) * - this->shape_value_component( - (i + 2) * this->degree, - quadrature_point_1, - 0)); + weight * + (2.0 * this->shape_value_component( + dof, quadrature_point_2, 0) - + this->restriction[index][2 * i + 1]( + (i + 2) * this->degree, dof) * + this->shape_value_component((i + 2) * + this->degree, + quadrature_point_1, + 0)); } for (unsigned int j = 0; j < this->degree - 1; ++j) @@ -756,8 +767,9 @@ FE_Nedelec::initialize_restriction() const unsigned int &n_quadrature_points = quadrature.size(); { - FullMatrix assembling_matrix( - (this->degree - 1) * this->degree, n_quadrature_points); + FullMatrix assembling_matrix((this->degree - 1) * + this->degree, + n_quadrature_points); for (unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point) @@ -832,10 +844,14 @@ FE_Nedelec::initialize_restriction() 2.0 * quadrature_points[q_point](0) - 1.0, 2.0 * quadrature_points[q_point](1)); - tmp(2) += 2.0 * this->shape_value_component( - dof, quadrature_point, 0); - tmp(3) += 2.0 * this->shape_value_component( - dof, quadrature_point, 1); + tmp(2) += + 2.0 * this->shape_value_component(dof, + quadrature_point, + 0); + tmp(3) += + 2.0 * this->shape_value_component(dof, + quadrature_point, + 1); } else @@ -844,27 +860,33 @@ FE_Nedelec::initialize_restriction() 2.0 * quadrature_points[q_point](0) - 1.0, 2.0 * quadrature_points[q_point](1) - 1.0); - tmp(6) += 2.0 * this->shape_value_component( - dof, quadrature_point, 0); - tmp(7) += 2.0 * this->shape_value_component( - dof, quadrature_point, 1); + tmp(6) += + 2.0 * this->shape_value_component(dof, + quadrature_point, + 0); + tmp(7) += + 2.0 * this->shape_value_component(dof, + quadrature_point, + 1); } for (unsigned int i = 0; i < 2; ++i) for (unsigned int j = 0; j < this->degree; ++j) { - tmp(2 * i) -= this->restriction[index][i]( - j + 2 * this->degree, dof) * - this->shape_value_component( - j + 2 * this->degree, - quadrature_points[q_point], - 0); - tmp(2 * i + 1) -= this->restriction[index][i]( - i * this->degree + j, dof) * - this->shape_value_component( - i * this->degree + j, - quadrature_points[q_point], - 1); + tmp(2 * i) -= + this->restriction[index][i](j + 2 * this->degree, + dof) * + this->shape_value_component( + j + 2 * this->degree, + quadrature_points[q_point], + 0); + tmp(2 * i + 1) -= + this->restriction[index][i](i * this->degree + j, + dof) * + this->shape_value_component( + i * this->degree + j, + quadrature_points[q_point], + 1); tmp(2 * (i + 2)) -= this->restriction[index][i + 2]( j + 3 * this->degree, dof) * this->shape_value_component( @@ -955,20 +977,26 @@ FE_Nedelec::initialize_restriction() Point quadrature_point( i, 2.0 * edge_quadrature_points[q_point](0), j); - this->restriction[index][i + 4 * j]( - (i + 4 * j) * this->degree, dof) += + this->restriction[index][i + 4 * j]((i + 4 * j) * + this->degree, + dof) += weight * this->shape_value_component(dof, quadrature_point, 1); - quadrature_point = Point( - 2.0 * edge_quadrature_points[q_point](0), i, j); + quadrature_point = + Point(2.0 * edge_quadrature_points[q_point](0), + i, + j); this->restriction[index][2 * (i + 2 * j)]( (i + 4 * j + 2) * this->degree, dof) += weight * this->shape_value_component(dof, quadrature_point, 0); - quadrature_point = Point( - i, j, 2.0 * edge_quadrature_points[q_point](0)); - this->restriction[index][i + 2 * j]( - (i + 2 * (j + 4)) * this->degree, dof) += + quadrature_point = + Point(i, + j, + 2.0 * edge_quadrature_points[q_point](0)); + this->restriction[index][i + 2 * j]((i + 2 * (j + 4)) * + this->degree, + dof) += weight * this->shape_value_component(dof, quadrature_point, 2); } @@ -980,8 +1008,9 @@ FE_Nedelec::initialize_restriction() Point quadrature_point( i, 2.0 * edge_quadrature_points[q_point](0) - 1.0, j); - this->restriction[index][i + 4 * j + 2]( - (i + 4 * j) * this->degree, dof) += + this->restriction[index][i + 4 * j + 2]((i + 4 * j) * + this->degree, + dof) += weight * this->shape_value_component(dof, quadrature_point, 1); quadrature_point = Point( @@ -1070,13 +1099,14 @@ FE_Nedelec::initialize_restriction() (i + 4 * j) * this->degree, quadrature_point_0, 1)); - tmp(1) = -1.0 * weight * - this->restriction[index][i + 4 * j + 2]( - (i + 4 * j) * this->degree, dof) * - this->shape_value_component( - (i + 4 * j) * this->degree, - quadrature_point_0, - 1); + tmp(1) = + -1.0 * weight * + this->restriction[index][i + 4 * j + 2]( + (i + 4 * j) * this->degree, dof) * + this->shape_value_component((i + 4 * j) * + this->degree, + quadrature_point_0, + 1); quadrature_point_3 = Point( 2.0 * edge_quadrature_points[q_point](0), i, j); tmp(2) = @@ -1121,13 +1151,14 @@ FE_Nedelec::initialize_restriction() else { - tmp(0) = -1.0 * weight * - this->restriction[index][i + 4 * j]( - (i + 4 * j) * this->degree, dof) * - this->shape_value_component( - (i + 4 * j) * this->degree, - quadrature_point_0, - 1); + tmp(0) = + -1.0 * weight * + this->restriction[index][i + 4 * j]( + (i + 4 * j) * this->degree, dof) * + this->shape_value_component((i + 4 * j) * + this->degree, + quadrature_point_0, + 1); Point quadrature_point_3( i, @@ -1514,8 +1545,9 @@ FE_Nedelec::initialize_restriction() n_edge_dofs, dof) = solution(l * deg + m, 2 * (j + 2 * k)); - if (std::abs(solution( - l * deg + m, 2 * (j + 2 * k) + 1)) > 1e-14) + if (std::abs(solution(l * deg + m, + 2 * (j + 2 * k) + 1)) > + 1e-14) this->restriction[index][i + 2 * (2 * j + k)]( ((2 * i + 1) * deg + m) * this->degree + l + n_edge_dofs, @@ -1531,8 +1563,9 @@ FE_Nedelec::initialize_restriction() dof) = solution(l * deg + m, 2 * (j + 2 * (k + 2))); - if (std::abs(solution( - l * deg + m, 2 * (j + 2 * k) + 9)) > 1e-14) + if (std::abs(solution(l * deg + m, + 2 * (j + 2 * k) + 9)) > + 1e-14) this->restriction[index][2 * (i + 2 * j) + k]( ((2 * i + 5) * deg + m) * this->degree + l + n_edge_dofs, @@ -1548,8 +1581,9 @@ FE_Nedelec::initialize_restriction() dof) = solution(l * deg + m, 2 * (j + 2 * (k + 4))); - if (std::abs(solution( - l * deg + m, 2 * (j + 2 * k) + 17)) > 1e-14) + if (std::abs(solution(l * deg + m, + 2 * (j + 2 * k) + 17)) > + 1e-14) this->restriction[index][2 * (2 * i + j) + k]( ((2 * i + 9) * deg + m) * this->degree + l + n_edge_dofs, @@ -1723,12 +1757,18 @@ FE_Nedelec::initialize_restriction() 2.0 * quadrature_points[q_point](1) - 1.0, 2.0 * quadrature_points[q_point](2)); - tmp(18) += 2.0 * this->shape_value_component( - dof, quadrature_point, 0); - tmp(19) += 2.0 * this->shape_value_component( - dof, quadrature_point, 1); - tmp(20) += 2.0 * this->shape_value_component( - dof, quadrature_point, 2); + tmp(18) += + 2.0 * this->shape_value_component(dof, + quadrature_point, + 0); + tmp(19) += + 2.0 * this->shape_value_component(dof, + quadrature_point, + 1); + tmp(20) += + 2.0 * this->shape_value_component(dof, + quadrature_point, + 2); } else @@ -1738,12 +1778,18 @@ FE_Nedelec::initialize_restriction() 2.0 * quadrature_points[q_point](1) - 1.0, 2.0 * quadrature_points[q_point](2) - 1.0); - tmp(21) += 2.0 * this->shape_value_component( - dof, quadrature_point, 0); - tmp(22) += 2.0 * this->shape_value_component( - dof, quadrature_point, 1); - tmp(23) += 2.0 * this->shape_value_component( - dof, quadrature_point, 2); + tmp(21) += + 2.0 * this->shape_value_component(dof, + quadrature_point, + 0); + tmp(22) += + 2.0 * this->shape_value_component(dof, + quadrature_point, + 1); + tmp(23) += + 2.0 * this->shape_value_component(dof, + quadrature_point, + 2); } for (unsigned int i = 0; i < 2; ++i) @@ -1904,17 +1950,19 @@ FE_Nedelec::initialize_restriction() for (unsigned int m = 0; m < deg; ++m) for (unsigned int n = 0; n < deg; ++n) { - if (std::abs(solution( - (l * deg + m) * deg + n, - 3 * (i + 2 * (j + 2 * k)))) > 1e-14) + if (std::abs( + solution((l * deg + m) * deg + n, + 3 * (i + 2 * (j + 2 * k)))) > + 1e-14) this->restriction[index][2 * (2 * i + j) + k]( (l * deg + m) * deg + n + n_boundary_dofs, dof) = solution((l * deg + m) * deg + n, 3 * (i + 2 * (j + 2 * k))); - if (std::abs(solution( - (l * deg + m) * deg + n, - 3 * (i + 2 * (j + 2 * k)) + 1)) > 1e-14) + if (std::abs( + solution((l * deg + m) * deg + n, + 3 * (i + 2 * (j + 2 * k)) + 1)) > + 1e-14) this->restriction[index][2 * (2 * i + j) + k]( (l + (m + deg) * this->degree) * deg + n + n_boundary_dofs, @@ -1922,9 +1970,10 @@ FE_Nedelec::initialize_restriction() solution((l * deg + m) * deg + n, 3 * (i + 2 * (j + 2 * k)) + 1); - if (std::abs(solution( - (l * deg + m) * deg + n, - 3 * (i + 2 * (j + 2 * k)) + 2)) > 1e-14) + if (std::abs( + solution((l * deg + m) * deg + n, + 3 * (i + 2 * (j + 2 * k)) + 2)) > + 1e-14) this->restriction[index][2 * (2 * i + j) + k]( l + ((m + 2 * deg) * deg + n) * this->degree + @@ -2442,13 +2491,14 @@ FE_Nedelec::get_face_interpolation_matrix( for (unsigned int j = 0; j < q - 1; ++j) { - interpolation_matrix( - GeometryInfo::lines_per_face * p + i * (p - 1) + j, - GeometryInfo::lines_per_face * q + i * (q - 1) + j) = 1.0; - interpolation_matrix( - GeometryInfo::lines_per_face * p + i + (j + p - 1) * p, - GeometryInfo::lines_per_face * q + i + (j + q - 1) * q) = - 1.0; + interpolation_matrix(GeometryInfo::lines_per_face * p + + i * (p - 1) + j, + GeometryInfo::lines_per_face * q + + i * (q - 1) + j) = 1.0; + interpolation_matrix(GeometryInfo::lines_per_face * p + i + + (j + p - 1) * p, + GeometryInfo::lines_per_face * q + i + + (j + q - 1) * q) = 1.0; } } } @@ -2592,12 +2642,15 @@ FE_Nedelec::get_subface_interpolation_matrix( 0.5 * (edge_quadrature_points[q_point](0) + subface)); const Point quadrature_point_1( 0.0, edge_quadrature_points[q_point](0)); - const double tmp = edge_quadrature.weight(q_point) * - (0.5 * this->shape_value_component( - dof, quadrature_point_0, 1) - - interpolation_matrix(0, dof) * - source_fe.shape_value_component( - 0, quadrature_point_1, 1)); + const double tmp = + edge_quadrature.weight(q_point) * + (0.5 * this->shape_value_component(dof, + quadrature_point_0, + 1) - + interpolation_matrix(0, dof) * + source_fe.shape_value_component(0, + quadrature_point_1, + 1)); for (unsigned int i = 0; i < source_fe.degree - 1; ++i) system_rhs(i) += @@ -2618,8 +2671,10 @@ FE_Nedelec::get_subface_interpolation_matrix( case 3: { - const double shifts[4][2] = { - {0.0, 0.0}, {1.0, 0.0}, {0.0, 1.0}, {1.0, 1.0}}; + const double shifts[4][2] = {{0.0, 0.0}, + {1.0, 0.0}, + {0.0, 1.0}, + {1.0, 1.0}}; for (unsigned int dof = 0; dof < this->dofs_per_face; ++dof) for (unsigned int q_point = 0; q_point < n_edge_quadrature_points; @@ -2719,24 +2774,28 @@ FE_Nedelec::get_subface_interpolation_matrix( interpolation_matrix(i * source_fe.degree, dof) * source_fe.shape_value_component( i * source_fe.degree, quadrature_point_1, 1)); - quadrature_point_0 = Point( - 0.5 * (edge_quadrature_points[q_point](0) + - shifts[subface][0]), - 0.5 * (i + shifts[subface][1]), - 0.0); - quadrature_point_1 = Point( - edge_quadrature_points[q_point](0), i, 0.0); + quadrature_point_0 = + Point(0.5 * + (edge_quadrature_points[q_point](0) + + shifts[subface][0]), + 0.5 * (i + shifts[subface][1]), + 0.0); + quadrature_point_1 = + Point(edge_quadrature_points[q_point](0), + i, + 0.0); tmp(i + 2) = - weight * (0.5 * this->shape_value_component( - this->face_to_cell_index(dof, 4), - quadrature_point_0, - 0) - - interpolation_matrix( - (i + 2) * source_fe.degree, dof) * - source_fe.shape_value_component( - (i + 2) * source_fe.degree, - quadrature_point_1, - 0)); + weight * + (0.5 * this->shape_value_component( + this->face_to_cell_index(dof, 4), + quadrature_point_0, + 0) - + interpolation_matrix((i + 2) * source_fe.degree, + dof) * + source_fe.shape_value_component( + (i + 2) * source_fe.degree, + quadrature_point_1, + 0)); } for (unsigned int i = 0; i < source_fe.degree - 1; ++i) @@ -2882,9 +2941,10 @@ FE_Nedelec::get_subface_interpolation_matrix( { if (std::abs(solution(i * (source_fe.degree - 1) + j, 0)) > 1e-14) - interpolation_matrix( - i * (source_fe.degree - 1) + j + n_boundary_dofs, - dof) = solution(i * (source_fe.degree - 1) + j, 0); + interpolation_matrix(i * (source_fe.degree - 1) + j + + n_boundary_dofs, + dof) = + solution(i * (source_fe.degree - 1) + j, 0); if (std::abs(solution(i * (source_fe.degree - 1) + j, 1)) > 1e-14) @@ -2911,14 +2971,16 @@ FE_Nedelec::get_prolongation_matrix( const RefinementCase &refinement_case) const { Assert(refinement_case < RefinementCase::isotropic_refinement + 1, - ExcIndexRange( - refinement_case, 0, RefinementCase::isotropic_refinement + 1)); - Assert( - refinement_case != RefinementCase::no_refinement, - ExcMessage("Prolongation matrices are only available for refined cells!")); - Assert( - child < GeometryInfo::n_children(refinement_case), - ExcIndexRange(child, 0, GeometryInfo::n_children(refinement_case))); + ExcIndexRange(refinement_case, + 0, + RefinementCase::isotropic_refinement + 1)); + Assert(refinement_case != RefinementCase::no_refinement, + ExcMessage( + "Prolongation matrices are only available for refined cells!")); + Assert(child < GeometryInfo::n_children(refinement_case), + ExcIndexRange(child, + 0, + GeometryInfo::n_children(refinement_case))); // initialization upon first request if (this->prolongation[refinement_case - 1][child].n() == 0) @@ -2969,17 +3031,18 @@ FE_Nedelec::get_restriction_matrix( const RefinementCase &refinement_case) const { Assert(refinement_case < RefinementCase::isotropic_refinement + 1, - ExcIndexRange( - refinement_case, 0, RefinementCase::isotropic_refinement + 1)); - Assert( - refinement_case != RefinementCase::no_refinement, - ExcMessage("Restriction matrices are only available for refined cells!")); - Assert( - child < GeometryInfo::n_children(RefinementCase(refinement_case)), - ExcIndexRange( - child, - 0, - GeometryInfo::n_children(RefinementCase(refinement_case)))); + ExcIndexRange(refinement_case, + 0, + RefinementCase::isotropic_refinement + 1)); + Assert(refinement_case != RefinementCase::no_refinement, + ExcMessage( + "Restriction matrices are only available for refined cells!")); + Assert(child < + GeometryInfo::n_children(RefinementCase(refinement_case)), + ExcIndexRange(child, + 0, + GeometryInfo::n_children( + RefinementCase(refinement_case)))); // initialization upon first request if (this->restriction[refinement_case - 1][child].n() == 0) @@ -3040,9 +3103,9 @@ FE_Nedelec::convert_generalized_support_point_values_to_dof_values( Assert(support_point_values.size() == this->generalized_support_points.size(), ExcDimensionMismatch(support_point_values.size(), this->generalized_support_points.size())); - Assert( - support_point_values[0].size() == this->n_components(), - ExcDimensionMismatch(support_point_values[0].size(), this->n_components())); + Assert(support_point_values[0].size() == this->n_components(), + ExcDimensionMismatch(support_point_values[0].size(), + this->n_components())); Assert(nodal_values.size() == this->dofs_per_cell, ExcDimensionMismatch(nodal_values.size(), this->dofs_per_cell)); std::fill(nodal_values.begin(), nodal_values.end(), 0.0); diff --git a/source/fe/fe_nedelec_sz.cc b/source/fe/fe_nedelec_sz.cc index f0307c4f01..a43cc3aeca 100644 --- a/source/fe/fe_nedelec_sz.cc +++ b/source/fe/fe_nedelec_sz.cc @@ -21,15 +21,15 @@ DEAL_II_NAMESPACE_OPEN // Constructor: template -FE_NedelecSZ::FE_NedelecSZ(const unsigned int degree) : - FiniteElement( - FiniteElementData(get_dpo_vector(degree), - dim, - degree + 1, - FiniteElementData::Hcurl), - std::vector(compute_num_dofs(degree), true), - std::vector(compute_num_dofs(degree), - std::vector(dim, true))) +FE_NedelecSZ::FE_NedelecSZ(const unsigned int degree) + : FiniteElement( + FiniteElementData(get_dpo_vector(degree), + dim, + degree + 1, + FiniteElementData::Hcurl), + std::vector(compute_num_dofs(degree), true), + std::vector(compute_num_dofs(degree), + std::vector(dim, true))) { Assert(dim >= 2, ExcImpossibleInDim(dim)); @@ -165,9 +165,9 @@ FE_NedelecSZ::get_data( if (flags & update_gradients) { - data->shape_grads.resize( - this->dofs_per_cell, - std::vector>(n_q_points)); + data->shape_grads.resize(this->dofs_per_cell, + std::vector>( + n_q_points)); } // Not implementing second derivatives yet: if (flags & update_hessians) @@ -275,8 +275,10 @@ FE_NedelecSZ::get_data( // Fill the values for edge lambda and edge sigma: const unsigned int - edge_sigma_direction[GeometryInfo<2>::lines_per_cell] = { - 1, 1, 0, 0}; + edge_sigma_direction[GeometryInfo<2>::lines_per_cell] = {1, + 1, + 0, + 0}; data->edge_lambda_values.resize(lines_per_cell, std::vector(n_q_points)); @@ -1116,10 +1118,10 @@ FE_NedelecSZ::fill_edge_values( const UpdateFlags flags(fe_data.update_each); const unsigned int n_q_points = quadrature.size(); - Assert( - !(flags & update_values) || - fe_data.shape_values.size() == this->dofs_per_cell, - ExcDimensionMismatch(fe_data.shape_values.size(), this->dofs_per_cell)); + Assert(!(flags & update_values) || + fe_data.shape_values.size() == this->dofs_per_cell, + ExcDimensionMismatch(fe_data.shape_values.size(), + this->dofs_per_cell)); Assert(!(flags & update_values) || fe_data.shape_values[0].size() == n_q_points, ExcDimensionMismatch(fe_data.shape_values[0].size(), n_q_points)); @@ -1555,10 +1557,10 @@ FE_NedelecSZ::fill_face_values( fe_data.shape_values.size() == this->dofs_per_cell, ExcDimensionMismatch(fe_data.shape_values.size(), this->dofs_per_cell)); - Assert( - !(flags & update_values) || - fe_data.shape_values[0].size() == n_q_points, - ExcDimensionMismatch(fe_data.shape_values[0].size(), n_q_points)); + Assert(!(flags & update_values) || + fe_data.shape_values[0].size() == n_q_points, + ExcDimensionMismatch(fe_data.shape_values[0].size(), + n_q_points)); // Useful geometry info: const unsigned int vertices_per_face( @@ -1574,8 +1576,10 @@ FE_NedelecSZ::fill_face_values( faces_per_cell, std::vector(vertices_per_face)); const unsigned int - vertex_opposite_on_face[GeometryInfo<3>::vertices_per_face] = { - 3, 2, 1, 0}; + vertex_opposite_on_face[GeometryInfo<3>::vertices_per_face] = {3, + 2, + 1, + 0}; const unsigned int vertices_adjacent_on_face[GeometryInfo<3>::vertices_per_face][2] = { @@ -1921,10 +1925,10 @@ FE_NedelecSZ::fill_fe_values( const UpdateFlags flags(fe_data.update_each); const unsigned int n_q_points = quadrature.size(); - Assert( - !(flags & update_values) || - fe_data.shape_values.size() == this->dofs_per_cell, - ExcDimensionMismatch(fe_data.shape_values.size(), this->dofs_per_cell)); + Assert(!(flags & update_values) || + fe_data.shape_values.size() == this->dofs_per_cell, + ExcDimensionMismatch(fe_data.shape_values.size(), + this->dofs_per_cell)); Assert(!(flags & update_values) || fe_data.shape_values[0].size() == n_q_points, ExcDimensionMismatch(fe_data.shape_values[0].size(), n_q_points)); @@ -2036,12 +2040,14 @@ FE_NedelecSZ::fill_fe_face_values( // Now update the edge-based DoFs, which depend on the cell. // This will fill in the missing items in the InternalData // (fe_internal/fe_data) which was not filled in by get_data. - fill_edge_values( - cell, QProjector::project_to_all_faces(quadrature), fe_data); + fill_edge_values(cell, + QProjector::project_to_all_faces(quadrature), + fe_data); if (dim == 3 && this->degree > 1) { - fill_face_values( - cell, QProjector::project_to_all_faces(quadrature), fe_data); + fill_face_values(cell, + QProjector::project_to_all_faces(quadrature), + fe_data); } const UpdateFlags flags(fe_data.update_each); @@ -2060,11 +2066,12 @@ FE_NedelecSZ::fill_fe_face_values( std::vector> transformed_shape_values(n_q_points); for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof) { - mapping.transform( - make_array_view(fe_data.shape_values[dof], offset, n_q_points), - mapping_covariant, - mapping_internal, - make_array_view(transformed_shape_values)); + mapping.transform(make_array_view(fe_data.shape_values[dof], + offset, + n_q_points), + mapping_covariant, + mapping_internal, + make_array_view(transformed_shape_values)); const unsigned int first = data.shape_function_to_row_table[dof * this->n_components() + @@ -2088,11 +2095,12 @@ FE_NedelecSZ::fill_fe_face_values( std::vector> transformed_shape_grads(n_q_points); for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof) { - mapping.transform( - make_array_view(fe_data.shape_grads[dof], offset, n_q_points), - mapping_covariant_gradient, - mapping_internal, - make_array_view(transformed_shape_grads)); + mapping.transform(make_array_view(fe_data.shape_grads[dof], + offset, + n_q_points), + mapping_covariant_gradient, + mapping_internal, + make_array_view(transformed_shape_grads)); const unsigned int first = data.shape_function_to_row_table[dof * this->n_components() + diff --git a/source/fe/fe_nothing.cc b/source/fe/fe_nothing.cc index c147d986cb..ceaa079788 100644 --- a/source/fe/fe_nothing.cc +++ b/source/fe/fe_nothing.cc @@ -35,15 +35,15 @@ namespace internal template FE_Nothing::FE_Nothing(const unsigned int n_components, - const bool dominate) : - FiniteElement( - FiniteElementData(std::vector(dim + 1, 0), - n_components, - 0, - FiniteElementData::unknown), - std::vector(), - std::vector()), - dominate(dominate) + const bool dominate) + : FiniteElement( + FiniteElementData(std::vector(dim + 1, 0), + n_components, + 0, + FiniteElementData::unknown), + std::vector(), + std::vector()) + , dominate(dominate) { // in most other elements we have to set up all sorts of stuff // here. there isn't much that we have to do here; in particular, diff --git a/source/fe/fe_p1nc.cc b/source/fe/fe_p1nc.cc index 1fa4add09f..f681aece31 100644 --- a/source/fe/fe_p1nc.cc +++ b/source/fe/fe_p1nc.cc @@ -21,11 +21,11 @@ DEAL_II_NAMESPACE_OPEN -FE_P1NC::FE_P1NC() : - FiniteElement<2, 2>( - FiniteElementData<2>(get_dpo_vector(), 1, 1, FiniteElementData<2>::L2), - std::vector(1, false), - std::vector(4, ComponentMask(1, true))) +FE_P1NC::FE_P1NC() + : FiniteElement<2, 2>( + FiniteElementData<2>(get_dpo_vector(), 1, 1, FiniteElementData<2>::L2), + std::vector(1, false), + std::vector(4, ComponentMask(1, true))) { // face support points: 2 end vertices unit_face_support_points.resize(2); @@ -268,8 +268,9 @@ FE_P1NC::fill_fe_face_values( for (unsigned int i = 0; i < quadrature_on_face.size(); ++i) for (unsigned int k = 0; k < this->dofs_per_cell; ++k) { - const Point<2> quadrature_point = mapping.transform_unit_to_real_cell( - cell, quadrature_on_face.point(i)); + const Point<2> quadrature_point = + mapping.transform_unit_to_real_cell(cell, + quadrature_on_face.point(i)); output_data.shape_values[k][i] = (coeffs[k][0] * quadrature_point(0) + diff --git a/source/fe/fe_poly.cc b/source/fe/fe_poly.cc index 1478252eda..745b183eba 100644 --- a/source/fe/fe_poly.cc +++ b/source/fe/fe_poly.cc @@ -83,15 +83,17 @@ FE_Poly, 1, 2>::fill_fe_values( cell_similarity != CellSimilarity::translation) { for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - mapping.transform( - make_array_view(fe_data.shape_3rd_derivatives, k), - mapping_covariant_hessian, - mapping_internal, - make_array_view(output_data.shape_3rd_derivatives, k)); + mapping.transform(make_array_view(fe_data.shape_3rd_derivatives, k), + mapping_covariant_hessian, + mapping_internal, + make_array_view(output_data.shape_3rd_derivatives, + k)); for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - correct_third_derivatives( - output_data, mapping_data, quadrature.size(), k); + correct_third_derivatives(output_data, + mapping_data, + quadrature.size(), + k); } } @@ -149,15 +151,17 @@ FE_Poly, 2, 3>::fill_fe_values( cell_similarity != CellSimilarity::translation) { for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - mapping.transform( - make_array_view(fe_data.shape_3rd_derivatives, k), - mapping_covariant_hessian, - mapping_internal, - make_array_view(output_data.shape_3rd_derivatives, k)); + mapping.transform(make_array_view(fe_data.shape_3rd_derivatives, k), + mapping_covariant_hessian, + mapping_internal, + make_array_view(output_data.shape_3rd_derivatives, + k)); for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - correct_third_derivatives( - output_data, mapping_data, quadrature.size(), k); + correct_third_derivatives(output_data, + mapping_data, + quadrature.size(), + k); } } @@ -217,15 +221,17 @@ FE_Poly, 1, 2>::fill_fe_values( cell_similarity != CellSimilarity::translation) { for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - mapping.transform( - make_array_view(fe_data.shape_3rd_derivatives, k), - mapping_covariant_hessian, - mapping_internal, - make_array_view(output_data.shape_3rd_derivatives, k)); + mapping.transform(make_array_view(fe_data.shape_3rd_derivatives, k), + mapping_covariant_hessian, + mapping_internal, + make_array_view(output_data.shape_3rd_derivatives, + k)); for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - correct_third_derivatives( - output_data, mapping_data, quadrature.size(), k); + correct_third_derivatives(output_data, + mapping_data, + quadrature.size(), + k); } } @@ -280,15 +286,17 @@ FE_Poly, 2, 3>::fill_fe_values( cell_similarity != CellSimilarity::translation) { for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - mapping.transform( - make_array_view(fe_data.shape_3rd_derivatives, k), - mapping_covariant_hessian, - mapping_internal, - make_array_view(output_data.shape_3rd_derivatives, k)); + mapping.transform(make_array_view(fe_data.shape_3rd_derivatives, k), + mapping_covariant_hessian, + mapping_internal, + make_array_view(output_data.shape_3rd_derivatives, + k)); for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - correct_third_derivatives( - output_data, mapping_data, quadrature.size(), k); + correct_third_derivatives(output_data, + mapping_data, + quadrature.size(), + k); } } diff --git a/source/fe/fe_poly_tensor.cc b/source/fe/fe_poly_tensor.cc index 0f7e813171..98da782066 100644 --- a/source/fe/fe_poly_tensor.cc +++ b/source/fe/fe_poly_tensor.cc @@ -156,12 +156,12 @@ FE_PolyTensor::FE_PolyTensor( const unsigned int degree, const FiniteElementData & fe_data, const std::vector & restriction_is_additive_flags, - const std::vector &nonzero_components) : - FiniteElement(fe_data, - restriction_is_additive_flags, - nonzero_components), - mapping_type(MappingType::mapping_none), - poly_space(PolynomialType(degree)) + const std::vector &nonzero_components) + : FiniteElement(fe_data, + restriction_is_additive_flags, + nonzero_components) + , mapping_type(MappingType::mapping_none) + , poly_space(PolynomialType(degree)) { cached_point(0) = -1; // Set up the table converting @@ -347,10 +347,10 @@ FE_PolyTensor::fill_fe_values( const unsigned int n_q_points = quadrature.size(); - Assert( - !(fe_data.update_each & update_values) || - fe_data.shape_values.size()[0] == this->dofs_per_cell, - ExcDimensionMismatch(fe_data.shape_values.size()[0], this->dofs_per_cell)); + Assert(!(fe_data.update_each & update_values) || + fe_data.shape_values.size()[0] == this->dofs_per_cell, + ExcDimensionMismatch(fe_data.shape_values.size()[0], + this->dofs_per_cell)); Assert(!(fe_data.update_each & update_values) || fe_data.shape_values.size()[1] == n_q_points, ExcDimensionMismatch(fe_data.shape_values.size()[1], n_q_points)); @@ -364,11 +364,13 @@ FE_PolyTensor::fill_fe_values( std::fill(fe_data.sign_change.begin(), fe_data.sign_change.end(), 1.0); if (mapping_type == mapping_raviart_thomas) - internal::FE_PolyTensor::get_face_sign_change_rt( - cell, this->dofs_per_face, fe_data.sign_change); + internal::FE_PolyTensor::get_face_sign_change_rt(cell, + this->dofs_per_face, + fe_data.sign_change); else if (mapping_type == mapping_nedelec) - internal::FE_PolyTensor::get_face_sign_change_nedelec( - cell, this->dofs_per_face, fe_data.sign_change); + internal::FE_PolyTensor::get_face_sign_change_nedelec(cell, + this->dofs_per_face, + fe_data.sign_change); for (unsigned int i = 0; i < this->dofs_per_cell; ++i) @@ -404,11 +406,11 @@ FE_PolyTensor::fill_fe_values( case mapping_covariant: case mapping_contravariant: { - mapping.transform( - make_array_view(fe_data.shape_values, i), - mapping_type, - mapping_internal, - make_array_view(fe_data.transformed_shape_values)); + mapping.transform(make_array_view(fe_data.shape_values, i), + mapping_type, + mapping_internal, + make_array_view( + fe_data.transformed_shape_values)); for (unsigned int k = 0; k < n_q_points; ++k) for (unsigned int d = 0; d < dim; ++d) @@ -421,11 +423,11 @@ FE_PolyTensor::fill_fe_values( case mapping_raviart_thomas: case mapping_piola: { - mapping.transform( - make_array_view(fe_data.shape_values, i), - mapping_piola, - mapping_internal, - make_array_view(fe_data.transformed_shape_values)); + mapping.transform(make_array_view(fe_data.shape_values, i), + mapping_piola, + mapping_internal, + make_array_view( + fe_data.transformed_shape_values)); for (unsigned int k = 0; k < n_q_points; ++k) for (unsigned int d = 0; d < dim; ++d) output_data.shape_values(first + d, k) = @@ -436,11 +438,11 @@ FE_PolyTensor::fill_fe_values( case mapping_nedelec: { - mapping.transform( - make_array_view(fe_data.shape_values, i), - mapping_covariant, - mapping_internal, - make_array_view(fe_data.transformed_shape_values)); + mapping.transform(make_array_view(fe_data.shape_values, i), + mapping_covariant, + mapping_internal, + make_array_view( + fe_data.transformed_shape_values)); for (unsigned int k = 0; k < n_q_points; ++k) for (unsigned int d = 0; d < dim; ++d) @@ -468,11 +470,11 @@ FE_PolyTensor::fill_fe_values( { case mapping_none: { - mapping.transform( - make_array_view(fe_data.shape_grads, i), - mapping_covariant, - mapping_internal, - make_array_view(fe_data.transformed_shape_grads)); + mapping.transform(make_array_view(fe_data.shape_grads, i), + mapping_covariant, + mapping_internal, + make_array_view( + fe_data.transformed_shape_grads)); for (unsigned int k = 0; k < n_q_points; ++k) for (unsigned int d = 0; d < dim; ++d) output_data.shape_gradients[first + d][k] = @@ -481,11 +483,11 @@ FE_PolyTensor::fill_fe_values( } case mapping_covariant: { - mapping.transform( - make_array_view(fe_data.shape_grads, i), - mapping_covariant_gradient, - mapping_internal, - make_array_view(fe_data.transformed_shape_grads)); + mapping.transform(make_array_view(fe_data.shape_grads, i), + mapping_covariant_gradient, + mapping_internal, + make_array_view( + fe_data.transformed_shape_grads)); for (unsigned int k = 0; k < n_q_points; ++k) for (unsigned int d = 0; d < spacedim; ++d) @@ -938,12 +940,14 @@ FE_PolyTensor::fill_fe_face_values( std::fill(fe_data.sign_change.begin(), fe_data.sign_change.end(), 1.0); if (mapping_type == mapping_raviart_thomas) - internal::FE_PolyTensor::get_face_sign_change_rt( - cell, this->dofs_per_face, fe_data.sign_change); + internal::FE_PolyTensor::get_face_sign_change_rt(cell, + this->dofs_per_face, + fe_data.sign_change); else if (mapping_type == mapping_nedelec) - internal::FE_PolyTensor::get_face_sign_change_nedelec( - cell, this->dofs_per_face, fe_data.sign_change); + internal::FE_PolyTensor::get_face_sign_change_nedelec(cell, + this->dofs_per_face, + fe_data.sign_change); for (unsigned int i = 0; i < this->dofs_per_cell; ++i) { @@ -969,14 +973,17 @@ FE_PolyTensor::fill_fe_face_values( case mapping_contravariant: { const ArrayView> - transformed_shape_values = make_array_view( - fe_data.transformed_shape_values, offset, n_q_points); - mapping.transform( - make_array_view( - fe_data.shape_values, i, offset, n_q_points), - mapping_type, - mapping_internal, - transformed_shape_values); + transformed_shape_values = + make_array_view(fe_data.transformed_shape_values, + offset, + n_q_points); + mapping.transform(make_array_view(fe_data.shape_values, + i, + offset, + n_q_points), + mapping_type, + mapping_internal, + transformed_shape_values); for (unsigned int k = 0; k < n_q_points; ++k) for (unsigned int d = 0; d < dim; ++d) @@ -989,14 +996,17 @@ FE_PolyTensor::fill_fe_face_values( case mapping_piola: { const ArrayView> - transformed_shape_values = make_array_view( - fe_data.transformed_shape_values, offset, n_q_points); - mapping.transform( - make_array_view( - fe_data.shape_values, i, offset, n_q_points), - mapping_piola, - mapping_internal, - transformed_shape_values); + transformed_shape_values = + make_array_view(fe_data.transformed_shape_values, + offset, + n_q_points); + mapping.transform(make_array_view(fe_data.shape_values, + i, + offset, + n_q_points), + mapping_piola, + mapping_internal, + transformed_shape_values); for (unsigned int k = 0; k < n_q_points; ++k) for (unsigned int d = 0; d < dim; ++d) output_data.shape_values(first + d, k) = @@ -1007,14 +1017,17 @@ FE_PolyTensor::fill_fe_face_values( case mapping_nedelec: { const ArrayView> - transformed_shape_values = make_array_view( - fe_data.transformed_shape_values, offset, n_q_points); - mapping.transform( - make_array_view( - fe_data.shape_values, i, offset, n_q_points), - mapping_covariant, - mapping_internal, - transformed_shape_values); + transformed_shape_values = + make_array_view(fe_data.transformed_shape_values, + offset, + n_q_points); + mapping.transform(make_array_view(fe_data.shape_values, + i, + offset, + n_q_points), + mapping_covariant, + mapping_internal, + transformed_shape_values); for (unsigned int k = 0; k < n_q_points; ++k) for (unsigned int d = 0; d < dim; ++d) @@ -1036,8 +1049,9 @@ FE_PolyTensor::fill_fe_face_values( case mapping_none: { const ArrayView> transformed_shape_grads = - make_array_view( - fe_data.transformed_shape_grads, offset, n_q_points); + make_array_view(fe_data.transformed_shape_grads, + offset, + n_q_points); mapping.transform( make_array_view(fe_data.shape_grads, i, offset, n_q_points), mapping_covariant, @@ -1053,8 +1067,9 @@ FE_PolyTensor::fill_fe_face_values( case mapping_covariant: { const ArrayView> transformed_shape_grads = - make_array_view( - fe_data.transformed_shape_grads, offset, n_q_points); + make_array_view(fe_data.transformed_shape_grads, + offset, + n_q_points); mapping.transform( make_array_view(fe_data.shape_grads, i, offset, n_q_points), mapping_covariant_gradient, @@ -1078,14 +1093,16 @@ FE_PolyTensor::fill_fe_face_values( case mapping_contravariant: { const ArrayView> transformed_shape_grads = - make_array_view( - fe_data.transformed_shape_grads, offset, n_q_points); + make_array_view(fe_data.transformed_shape_grads, + offset, + n_q_points); for (unsigned int k = 0; k < n_q_points; ++k) fe_data.untransformed_shape_grads[k + offset] = fe_data.shape_grads[i][k + offset]; mapping.transform( - make_array_view( - fe_data.untransformed_shape_grads, offset, n_q_points), + make_array_view(fe_data.untransformed_shape_grads, + offset, + n_q_points), mapping_contravariant_gradient, mapping_internal, transformed_shape_grads); @@ -1109,14 +1126,16 @@ FE_PolyTensor::fill_fe_face_values( case mapping_piola: { const ArrayView> transformed_shape_grads = - make_array_view( - fe_data.transformed_shape_grads, offset, n_q_points); + make_array_view(fe_data.transformed_shape_grads, + offset, + n_q_points); for (unsigned int k = 0; k < n_q_points; ++k) fe_data.untransformed_shape_grads[k + offset] = fe_data.shape_grads[i][k + offset]; mapping.transform( - make_array_view( - fe_data.untransformed_shape_grads, offset, n_q_points), + make_array_view(fe_data.untransformed_shape_grads, + offset, + n_q_points), mapping_piola_gradient, mapping_internal, transformed_shape_grads); @@ -1156,11 +1175,13 @@ FE_PolyTensor::fill_fe_face_values( fe_data.shape_grads[i][k + offset]; const ArrayView> transformed_shape_grads = - make_array_view( - fe_data.transformed_shape_grads, offset, n_q_points); + make_array_view(fe_data.transformed_shape_grads, + offset, + n_q_points); mapping.transform( - make_array_view( - fe_data.untransformed_shape_grads, offset, n_q_points), + make_array_view(fe_data.untransformed_shape_grads, + offset, + n_q_points), mapping_covariant_gradient, mapping_internal, transformed_shape_grads); @@ -1192,14 +1213,17 @@ FE_PolyTensor::fill_fe_face_values( case mapping_none: { const ArrayView> - transformed_shape_hessians = make_array_view( - fe_data.transformed_shape_hessians, offset, n_q_points); - mapping.transform( - make_array_view( - fe_data.shape_grad_grads, i, offset, n_q_points), - mapping_covariant_gradient, - mapping_internal, - transformed_shape_hessians); + transformed_shape_hessians = + make_array_view(fe_data.transformed_shape_hessians, + offset, + n_q_points); + mapping.transform(make_array_view(fe_data.shape_grad_grads, + i, + offset, + n_q_points), + mapping_covariant_gradient, + mapping_internal, + transformed_shape_hessians); for (unsigned int k = 0; k < n_q_points; ++k) for (unsigned int d = 0; d < spacedim; ++d) @@ -1222,8 +1246,10 @@ FE_PolyTensor::fill_fe_face_values( fe_data.shape_grad_grads[i][k + offset]; const ArrayView> - transformed_shape_hessians = make_array_view( - fe_data.transformed_shape_hessians, offset, n_q_points); + transformed_shape_hessians = + make_array_view(fe_data.transformed_shape_hessians, + offset, + n_q_points); mapping.transform( make_array_view(fe_data.untransformed_shape_hessian_tensors, offset, @@ -1269,8 +1295,10 @@ FE_PolyTensor::fill_fe_face_values( fe_data.shape_grad_grads[i][k + offset]; const ArrayView> - transformed_shape_hessians = make_array_view( - fe_data.transformed_shape_hessians, offset, n_q_points); + transformed_shape_hessians = + make_array_view(fe_data.transformed_shape_hessians, + offset, + n_q_points); mapping.transform( make_array_view(fe_data.untransformed_shape_hessian_tensors, offset, @@ -1333,8 +1361,10 @@ FE_PolyTensor::fill_fe_face_values( fe_data.shape_grad_grads[i][k + offset]; const ArrayView> - transformed_shape_hessians = make_array_view( - fe_data.transformed_shape_hessians, offset, n_q_points); + transformed_shape_hessians = + make_array_view(fe_data.transformed_shape_hessians, + offset, + n_q_points); mapping.transform( make_array_view(fe_data.untransformed_shape_hessian_tensors, offset, @@ -1428,8 +1458,10 @@ FE_PolyTensor::fill_fe_face_values( fe_data.shape_grad_grads[i][k + offset]; const ArrayView> - transformed_shape_hessians = make_array_view( - fe_data.transformed_shape_hessians, offset, n_q_points); + transformed_shape_hessians = + make_array_view(fe_data.transformed_shape_hessians, + offset, + n_q_points); mapping.transform( make_array_view(fe_data.untransformed_shape_hessian_tensors, offset, @@ -1536,12 +1568,14 @@ FE_PolyTensor::fill_fe_subface_values( std::fill(fe_data.sign_change.begin(), fe_data.sign_change.end(), 1.0); if (mapping_type == mapping_raviart_thomas) - internal::FE_PolyTensor::get_face_sign_change_rt( - cell, this->dofs_per_face, fe_data.sign_change); + internal::FE_PolyTensor::get_face_sign_change_rt(cell, + this->dofs_per_face, + fe_data.sign_change); else if (mapping_type == mapping_nedelec) - internal::FE_PolyTensor::get_face_sign_change_nedelec( - cell, this->dofs_per_face, fe_data.sign_change); + internal::FE_PolyTensor::get_face_sign_change_nedelec(cell, + this->dofs_per_face, + fe_data.sign_change); for (unsigned int i = 0; i < this->dofs_per_cell; ++i) { @@ -1567,14 +1601,17 @@ FE_PolyTensor::fill_fe_subface_values( case mapping_contravariant: { const ArrayView> - transformed_shape_values = make_array_view( - fe_data.transformed_shape_values, offset, n_q_points); - mapping.transform( - make_array_view( - fe_data.shape_values, i, offset, n_q_points), - mapping_type, - mapping_internal, - transformed_shape_values); + transformed_shape_values = + make_array_view(fe_data.transformed_shape_values, + offset, + n_q_points); + mapping.transform(make_array_view(fe_data.shape_values, + i, + offset, + n_q_points), + mapping_type, + mapping_internal, + transformed_shape_values); for (unsigned int k = 0; k < n_q_points; ++k) for (unsigned int d = 0; d < dim; ++d) @@ -1588,15 +1625,18 @@ FE_PolyTensor::fill_fe_subface_values( case mapping_piola: { const ArrayView> - transformed_shape_values = make_array_view( - fe_data.transformed_shape_values, offset, n_q_points); - - mapping.transform( - make_array_view( - fe_data.shape_values, i, offset, n_q_points), - mapping_piola, - mapping_internal, - transformed_shape_values); + transformed_shape_values = + make_array_view(fe_data.transformed_shape_values, + offset, + n_q_points); + + mapping.transform(make_array_view(fe_data.shape_values, + i, + offset, + n_q_points), + mapping_piola, + mapping_internal, + transformed_shape_values); for (unsigned int k = 0; k < n_q_points; ++k) for (unsigned int d = 0; d < dim; ++d) output_data.shape_values(first + d, k) = @@ -1607,15 +1647,18 @@ FE_PolyTensor::fill_fe_subface_values( case mapping_nedelec: { const ArrayView> - transformed_shape_values = make_array_view( - fe_data.transformed_shape_values, offset, n_q_points); + transformed_shape_values = + make_array_view(fe_data.transformed_shape_values, + offset, + n_q_points); - mapping.transform( - make_array_view( - fe_data.shape_values, i, offset, n_q_points), - mapping_covariant, - mapping_internal, - transformed_shape_values); + mapping.transform(make_array_view(fe_data.shape_values, + i, + offset, + n_q_points), + mapping_covariant, + mapping_internal, + transformed_shape_values); for (unsigned int k = 0; k < n_q_points; ++k) for (unsigned int d = 0; d < dim; ++d) @@ -1633,8 +1676,9 @@ FE_PolyTensor::fill_fe_subface_values( if (fe_data.update_each & update_gradients) { const ArrayView> transformed_shape_grads = - make_array_view( - fe_data.transformed_shape_grads, offset, n_q_points); + make_array_view(fe_data.transformed_shape_grads, + offset, + n_q_points); switch (mapping_type) { case mapping_none: @@ -1681,8 +1725,9 @@ FE_PolyTensor::fill_fe_subface_values( fe_data.shape_grads[i][k + offset]; mapping.transform( - make_array_view( - fe_data.untransformed_shape_grads, offset, n_q_points), + make_array_view(fe_data.untransformed_shape_grads, + offset, + n_q_points), mapping_contravariant_gradient, mapping_internal, transformed_shape_grads); @@ -1710,8 +1755,9 @@ FE_PolyTensor::fill_fe_subface_values( fe_data.shape_grads[i][k + offset]; mapping.transform( - make_array_view( - fe_data.untransformed_shape_grads, offset, n_q_points), + make_array_view(fe_data.untransformed_shape_grads, + offset, + n_q_points), mapping_piola_gradient, mapping_internal, transformed_shape_grads); @@ -1750,8 +1796,9 @@ FE_PolyTensor::fill_fe_subface_values( fe_data.shape_grads[i][k + offset]; mapping.transform( - make_array_view( - fe_data.untransformed_shape_grads, offset, n_q_points), + make_array_view(fe_data.untransformed_shape_grads, + offset, + n_q_points), mapping_covariant_gradient, mapping_internal, transformed_shape_grads); @@ -1783,14 +1830,17 @@ FE_PolyTensor::fill_fe_subface_values( case mapping_none: { const ArrayView> - transformed_shape_hessians = make_array_view( - fe_data.transformed_shape_hessians, offset, n_q_points); - mapping.transform( - make_array_view( - fe_data.shape_grad_grads, i, offset, n_q_points), - mapping_covariant_gradient, - mapping_internal, - transformed_shape_hessians); + transformed_shape_hessians = + make_array_view(fe_data.transformed_shape_hessians, + offset, + n_q_points); + mapping.transform(make_array_view(fe_data.shape_grad_grads, + i, + offset, + n_q_points), + mapping_covariant_gradient, + mapping_internal, + transformed_shape_hessians); for (unsigned int k = 0; k < n_q_points; ++k) for (unsigned int d = 0; d < spacedim; ++d) @@ -1813,8 +1863,10 @@ FE_PolyTensor::fill_fe_subface_values( fe_data.shape_grad_grads[i][k + offset]; const ArrayView> - transformed_shape_hessians = make_array_view( - fe_data.transformed_shape_hessians, offset, n_q_points); + transformed_shape_hessians = + make_array_view(fe_data.transformed_shape_hessians, + offset, + n_q_points); mapping.transform( make_array_view(fe_data.untransformed_shape_hessian_tensors, offset, @@ -1860,8 +1912,10 @@ FE_PolyTensor::fill_fe_subface_values( fe_data.shape_grad_grads[i][k + offset]; const ArrayView> - transformed_shape_hessians = make_array_view( - fe_data.transformed_shape_hessians, offset, n_q_points); + transformed_shape_hessians = + make_array_view(fe_data.transformed_shape_hessians, + offset, + n_q_points); mapping.transform( make_array_view(fe_data.untransformed_shape_hessian_tensors, offset, @@ -1924,8 +1978,10 @@ FE_PolyTensor::fill_fe_subface_values( fe_data.shape_grad_grads[i][k + offset]; const ArrayView> - transformed_shape_hessians = make_array_view( - fe_data.transformed_shape_hessians, offset, n_q_points); + transformed_shape_hessians = + make_array_view(fe_data.transformed_shape_hessians, + offset, + n_q_points); mapping.transform( make_array_view(fe_data.untransformed_shape_hessian_tensors, offset, @@ -2018,8 +2074,10 @@ FE_PolyTensor::fill_fe_subface_values( fe_data.shape_grad_grads[i][k + offset]; const ArrayView> - transformed_shape_hessians = make_array_view( - fe_data.transformed_shape_hessians, offset, n_q_points); + transformed_shape_hessians = + make_array_view(fe_data.transformed_shape_hessians, + offset, + n_q_points); mapping.transform( make_array_view(fe_data.untransformed_shape_hessian_tensors, offset, diff --git a/source/fe/fe_q.cc b/source/fe/fe_q.cc index 84633066b8..aee10ccede 100644 --- a/source/fe/fe_q.cc +++ b/source/fe/fe_q.cc @@ -52,15 +52,16 @@ namespace internal template -FE_Q::FE_Q(const unsigned int degree) : - FE_Q_Base, dim, spacedim>( - TensorProductPolynomials(Polynomials::generate_complete_Lagrange_basis( - internal::FE_Q::get_QGaussLobatto_points(degree))), - FiniteElementData(this->get_dpo_vector(degree), - 1, - degree, - FiniteElementData::H1), - std::vector(1, false)) +FE_Q::FE_Q(const unsigned int degree) + : FE_Q_Base, dim, spacedim>( + TensorProductPolynomials( + Polynomials::generate_complete_Lagrange_basis( + internal::FE_Q::get_QGaussLobatto_points(degree))), + FiniteElementData(this->get_dpo_vector(degree), + 1, + degree, + FiniteElementData::H1), + std::vector(1, false)) { this->initialize(internal::FE_Q::get_QGaussLobatto_points(degree)); } @@ -68,15 +69,15 @@ FE_Q::FE_Q(const unsigned int degree) : template -FE_Q::FE_Q(const Quadrature<1> &points) : - FE_Q_Base, dim, spacedim>( - TensorProductPolynomials( - Polynomials::generate_complete_Lagrange_basis(points.get_points())), - FiniteElementData(this->get_dpo_vector(points.size() - 1), - 1, - points.size() - 1, - FiniteElementData::H1), - std::vector(1, false)) +FE_Q::FE_Q(const Quadrature<1> &points) + : FE_Q_Base, dim, spacedim>( + TensorProductPolynomials( + Polynomials::generate_complete_Lagrange_basis(points.get_points())), + FiniteElementData(this->get_dpo_vector(points.size() - 1), + 1, + points.size() - 1, + FiniteElementData::H1), + std::vector(1, false)) { this->initialize(points.get_points()); } diff --git a/source/fe/fe_q_base.cc b/source/fe/fe_q_base.cc index 6b51e8fe45..1df3a4e9fc 100644 --- a/source/fe/fe_q_base.cc +++ b/source/fe/fe_q_base.cc @@ -210,10 +210,10 @@ struct FE_Q_Base::Implementation const std::vector face_index_map = internal::FE_Q_Base::face_lexicographic_to_hierarchic_numbering( q_deg); - Assert( - std::abs(fe.poly_space.compute_value(index_map_inverse[0], Point()) - - 1.) < 1e-14, - ExcInternalError()); + Assert(std::abs( + fe.poly_space.compute_value(index_map_inverse[0], Point()) - + 1.) < 1e-14, + ExcInternalError()); for (unsigned int i = 0; i < constraint_points.size(); ++i) for (unsigned int j = 0; j < q_deg + 1; ++j) @@ -310,10 +310,13 @@ struct FE_Q_Base::Implementation subface < GeometryInfo::max_children_per_face; ++subface) { - QProjector::project_to_subface( - qline, face, subface, p_line); - constraint_points.insert( - constraint_points.end(), p_line.begin(), p_line.end()); + QProjector::project_to_subface(qline, + face, + subface, + p_line); + constraint_points.insert(constraint_points.end(), + p_line.begin(), + p_line.end()); } // Create constraints for interior nodes @@ -343,10 +346,10 @@ struct FE_Q_Base::Implementation const std::vector face_index_map = internal::FE_Q_Base::face_lexicographic_to_hierarchic_numbering( q_deg); - Assert( - std::abs(fe.poly_space.compute_value(index_map_inverse[0], Point()) - - 1.) < 1e-14, - ExcInternalError()); + Assert(std::abs( + fe.poly_space.compute_value(index_map_inverse[0], Point()) - + 1.) < 1e-14, + ExcInternalError()); fe.interface_constraints.TableBase<2, double>::reinit( fe.interface_constraints_size()); @@ -430,16 +433,16 @@ template FE_Q_Base::FE_Q_Base( const PolynomialType & poly_space, const FiniteElementData &fe_data, - const std::vector & restriction_is_additive_flags) : - FE_Poly( - poly_space, - fe_data, - restriction_is_additive_flags, - std::vector(1, std::vector(1, true))), - q_degree( - std::is_same>::value ? - this->degree - 1 : - this->degree) + const std::vector & restriction_is_additive_flags) + : FE_Poly( + poly_space, + fe_data, + restriction_is_additive_flags, + std::vector(1, std::vector(1, true))) + , q_degree(std::is_same>::value ? + this->degree - 1 : + this->degree) {} @@ -503,9 +506,9 @@ FE_Q_Base::get_interpolation_matrix( &x_source_fe)) { // ok, source is a Q element, so we will be able to do the work - Assert( - interpolation_matrix.m() == this->dofs_per_cell, - ExcDimensionMismatch(interpolation_matrix.m(), this->dofs_per_cell)); + Assert(interpolation_matrix.m() == this->dofs_per_cell, + ExcDimensionMismatch(interpolation_matrix.m(), + this->dofs_per_cell)); Assert(interpolation_matrix.n() == x_source_fe.dofs_per_cell, ExcDimensionMismatch(interpolation_matrix.m(), x_source_fe.dofs_per_cell)); @@ -596,8 +599,9 @@ FE_Q_Base::get_face_interpolation_matrix( FullMatrix & interpolation_matrix) const { Assert(dim > 1, ExcImpossibleInDim(1)); - get_subface_interpolation_matrix( - source_fe, numbers::invalid_unsigned_int, interpolation_matrix); + get_subface_interpolation_matrix(source_fe, + numbers::invalid_unsigned_int, + interpolation_matrix); } @@ -609,9 +613,9 @@ FE_Q_Base::get_subface_interpolation_matrix( const unsigned int subface, FullMatrix & interpolation_matrix) const { - Assert( - interpolation_matrix.m() == x_source_fe.dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.m(), x_source_fe.dofs_per_face)); + Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.dofs_per_face)); // see if source is a Q element if (const FE_Q_Base *source_fe = @@ -620,9 +624,9 @@ FE_Q_Base::get_subface_interpolation_matrix( { // have this test in here since a table of size 2x0 reports its size as // 0x0 - Assert( - interpolation_matrix.n() == this->dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); + Assert(interpolation_matrix.n() == this->dofs_per_face, + ExcDimensionMismatch(interpolation_matrix.n(), + this->dofs_per_face)); // Make sure that the element for which the DoFs should be constrained // is the one with the higher polynomial degree. Actually the procedure @@ -1214,14 +1218,16 @@ FE_Q_Base::get_prolongation_matrix( const RefinementCase &refinement_case) const { Assert(refinement_case < RefinementCase::isotropic_refinement + 1, - ExcIndexRange( - refinement_case, 0, RefinementCase::isotropic_refinement + 1)); - Assert( - refinement_case != RefinementCase::no_refinement, - ExcMessage("Prolongation matrices are only available for refined cells!")); - Assert( - child < GeometryInfo::n_children(refinement_case), - ExcIndexRange(child, 0, GeometryInfo::n_children(refinement_case))); + ExcIndexRange(refinement_case, + 0, + RefinementCase::isotropic_refinement + 1)); + Assert(refinement_case != RefinementCase::no_refinement, + ExcMessage( + "Prolongation matrices are only available for refined cells!")); + Assert(child < GeometryInfo::n_children(refinement_case), + ExcIndexRange(child, + 0, + GeometryInfo::n_children(refinement_case))); // initialization upon first request if (this->prolongation[refinement_case - 1][child].n() == 0) @@ -1260,15 +1266,15 @@ FE_Q_Base::get_prolongation_matrix( "prevents the sum to be one.")); for (unsigned int j = 0; j < q_dofs_per_cell; ++j) if (j != i) - Assert( - std::fabs(this->poly_space.compute_value( - i, this->unit_support_points[j])) < eps, - ExcInternalError("The Lagrange polynomial does not evaluate " - "to one or zero in a nodal point. " - "This typically indicates that the " - "polynomial interpolation is " - "ill-conditioned such that round-off " - "prevents the sum to be one.")); + Assert(std::fabs(this->poly_space.compute_value( + i, this->unit_support_points[j])) < eps, + ExcInternalError( + "The Lagrange polynomial does not evaluate " + "to one or zero in a nodal point. " + "This typically indicates that the " + "polynomial interpolation is " + "ill-conditioned such that round-off " + "prevents the sum to be one.")); } #endif @@ -1303,8 +1309,9 @@ FE_Q_Base::get_prolongation_matrix( const unsigned int diag_comp = index_map_inverse[j * step_size_diag]; const Point p_subcell = this->unit_support_points[diag_comp]; const Point p_cell = - GeometryInfo::child_to_cell_coordinates( - p_subcell, child, refinement_case); + GeometryInfo::child_to_cell_coordinates(p_subcell, + child, + refinement_case); for (unsigned int i = 0; i < dofs1d; ++i) for (unsigned int d = 0; d < dim; ++d) { @@ -1413,14 +1420,16 @@ FE_Q_Base::get_restriction_matrix( const RefinementCase &refinement_case) const { Assert(refinement_case < RefinementCase::isotropic_refinement + 1, - ExcIndexRange( - refinement_case, 0, RefinementCase::isotropic_refinement + 1)); - Assert( - refinement_case != RefinementCase::no_refinement, - ExcMessage("Restriction matrices are only available for refined cells!")); - Assert( - child < GeometryInfo::n_children(refinement_case), - ExcIndexRange(child, 0, GeometryInfo::n_children(refinement_case))); + ExcIndexRange(refinement_case, + 0, + RefinementCase::isotropic_refinement + 1)); + Assert(refinement_case != RefinementCase::no_refinement, + ExcMessage( + "Restriction matrices are only available for refined cells!")); + Assert(child < GeometryInfo::n_children(refinement_case), + ExcIndexRange(child, + 0, + GeometryInfo::n_children(refinement_case))); // initialization upon first request if (this->restriction[refinement_case - 1][child].n() == 0) @@ -1472,8 +1481,9 @@ FE_Q_Base::get_restriction_matrix( // check whether this interpolation point is inside this child cell const Point p_subcell = - GeometryInfo::cell_to_child_coordinates( - p_cell, child, refinement_case); + GeometryInfo::cell_to_child_coordinates(p_cell, + child, + refinement_case); if (GeometryInfo::is_inside_unit_cell(p_subcell)) { // same logic as in initialize_embedding to evaluate the @@ -1485,9 +1495,10 @@ FE_Q_Base::get_restriction_matrix( for (unsigned int d = 0; d < dim; ++d) { Point point; - point[0] = p_subcell[d]; - evaluations1d[j][d] = this->poly_space.compute_value( - index_map_inverse[j], point); + point[0] = p_subcell[d]; + evaluations1d[j][d] = + this->poly_space.compute_value(index_map_inverse[j], + point); } unsigned int j_indices[dim]; internal::FE_Q_Base::zero_indices(j_indices); diff --git a/source/fe/fe_q_bubbles.cc b/source/fe/fe_q_bubbles.cc index 4bd5d15737..40111e707d 100644 --- a/source/fe/fe_q_bubbles.cc +++ b/source/fe/fe_q_bubbles.cc @@ -100,12 +100,12 @@ namespace internal for (unsigned int i = 0; i < nc; ++i) { - Assert( - matrices[ref_case - 1][i].n() == dpc, - ExcDimensionMismatch(matrices[ref_case - 1][i].n(), dpc)); - Assert( - matrices[ref_case - 1][i].m() == dpc, - ExcDimensionMismatch(matrices[ref_case - 1][i].m(), dpc)); + Assert(matrices[ref_case - 1][i].n() == dpc, + ExcDimensionMismatch(matrices[ref_case - 1][i].n(), + dpc)); + Assert(matrices[ref_case - 1][i].m() == dpc, + ExcDimensionMismatch(matrices[ref_case - 1][i].m(), + dpc)); } // create a respective refinement on the triangulation @@ -181,17 +181,17 @@ namespace internal template -FE_Q_Bubbles::FE_Q_Bubbles(const unsigned int q_degree) : - FE_Q_Base, dim, spacedim>( - TensorProductPolynomialsBubbles( - Polynomials::generate_complete_Lagrange_basis( - QGaussLobatto<1>(q_degree + 1).get_points())), - FiniteElementData(get_dpo_vector(q_degree), - 1, - q_degree + 1, - FiniteElementData::H1), - get_riaf_vector(q_degree)), - n_bubbles((q_degree <= 1) ? 1 : dim) +FE_Q_Bubbles::FE_Q_Bubbles(const unsigned int q_degree) + : FE_Q_Base, dim, spacedim>( + TensorProductPolynomialsBubbles( + Polynomials::generate_complete_Lagrange_basis( + QGaussLobatto<1>(q_degree + 1).get_points())), + FiniteElementData(get_dpo_vector(q_degree), + 1, + q_degree + 1, + FiniteElementData::H1), + get_riaf_vector(q_degree)) + , n_bubbles((q_degree <= 1) ? 1 : dim) { Assert(q_degree > 0, ExcMessage("This element can only be used for polynomial degrees " @@ -210,8 +210,9 @@ FE_Q_Bubbles::FE_Q_Bubbles(const unsigned int q_degree) : this->reinit_restriction_and_prolongation_matrices(); if (dim == spacedim) { - internal::FE_Q_Bubbles::compute_embedding_matrices( - *this, this->prolongation, false); + internal::FE_Q_Bubbles::compute_embedding_matrices(*this, + this->prolongation, + false); // Fill restriction matrices with L2-projection FETools::compute_projection_matrices(*this, this->restriction); } @@ -220,16 +221,16 @@ FE_Q_Bubbles::FE_Q_Bubbles(const unsigned int q_degree) : template -FE_Q_Bubbles::FE_Q_Bubbles(const Quadrature<1> &points) : - FE_Q_Base, dim, spacedim>( - TensorProductPolynomialsBubbles( - Polynomials::generate_complete_Lagrange_basis(points.get_points())), - FiniteElementData(get_dpo_vector(points.size() - 1), - 1, - points.size(), - FiniteElementData::H1), - get_riaf_vector(points.size() - 1)), - n_bubbles((points.size() - 1 <= 1) ? 1 : dim) +FE_Q_Bubbles::FE_Q_Bubbles(const Quadrature<1> &points) + : FE_Q_Base, dim, spacedim>( + TensorProductPolynomialsBubbles( + Polynomials::generate_complete_Lagrange_basis(points.get_points())), + FiniteElementData(get_dpo_vector(points.size() - 1), + 1, + points.size(), + FiniteElementData::H1), + get_riaf_vector(points.size() - 1)) + , n_bubbles((points.size() - 1 <= 1) ? 1 : dim) { Assert(points.size() > 1, ExcMessage("This element can only be used for polynomial degrees " @@ -248,8 +249,9 @@ FE_Q_Bubbles::FE_Q_Bubbles(const Quadrature<1> &points) : this->reinit_restriction_and_prolongation_matrices(); if (dim == spacedim) { - internal::FE_Q_Bubbles::compute_embedding_matrices( - *this, this->prolongation, false); + internal::FE_Q_Bubbles::compute_embedding_matrices(*this, + this->prolongation, + false); // Fill restriction matrices with L2-projection FETools::compute_projection_matrices(*this, this->restriction); } @@ -292,9 +294,9 @@ FE_Q_Bubbles::get_name() const } } // Do not consider the discontinuous node for dimension 1 - Assert( - index == n_points || (dim == 1 && index == n_points + n_bubbles), - ExcMessage("Could not decode support points in one coordinate direction.")); + Assert(index == n_points || (dim == 1 && index == n_points + n_bubbles), + ExcMessage( + "Could not decode support points in one coordinate direction.")); // Check whether the support points are equidistant. for (unsigned int j = 0; j < n_points; j++) @@ -356,9 +358,9 @@ FE_Q_Bubbles:: this->unit_support_points.size())); Assert(nodal_values.size() == this->dofs_per_cell, ExcDimensionMismatch(nodal_values.size(), this->dofs_per_cell)); - Assert( - support_point_values[0].size() == this->n_components(), - ExcDimensionMismatch(support_point_values[0].size(), this->n_components())); + Assert(support_point_values[0].size() == this->n_components(), + ExcDimensionMismatch(support_point_values[0].size(), + this->n_components())); for (unsigned int i = 0; i < this->dofs_per_cell - 1; ++i) { @@ -391,9 +393,9 @@ FE_Q_Bubbles::get_interpolation_matrix( (typename FiniteElement::ExcInterpolationNotImplemented())); Assert(interpolation_matrix.m() == this->dofs_per_cell, ExcDimensionMismatch(interpolation_matrix.m(), this->dofs_per_cell)); - Assert( - interpolation_matrix.n() == x_source_fe.dofs_per_cell, - ExcDimensionMismatch(interpolation_matrix.m(), x_source_fe.dofs_per_cell)); + Assert(interpolation_matrix.n() == x_source_fe.dofs_per_cell, + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.dofs_per_cell)); // Provide a short cut in case we are just inquiring the identity auto casted_fe = dynamic_cast(&x_source_fe); @@ -459,14 +461,16 @@ FE_Q_Bubbles::get_prolongation_matrix( const RefinementCase &refinement_case) const { Assert(refinement_case < RefinementCase::isotropic_refinement + 1, - ExcIndexRange( - refinement_case, 0, RefinementCase::isotropic_refinement + 1)); - Assert( - refinement_case != RefinementCase::no_refinement, - ExcMessage("Prolongation matrices are only available for refined cells!")); - Assert( - child < GeometryInfo::n_children(refinement_case), - ExcIndexRange(child, 0, GeometryInfo::n_children(refinement_case))); + ExcIndexRange(refinement_case, + 0, + RefinementCase::isotropic_refinement + 1)); + Assert(refinement_case != RefinementCase::no_refinement, + ExcMessage( + "Prolongation matrices are only available for refined cells!")); + Assert(child < GeometryInfo::n_children(refinement_case), + ExcIndexRange(child, + 0, + GeometryInfo::n_children(refinement_case))); Assert(this->prolongation[refinement_case - 1][child].n() != 0, ExcMessage("This prolongation matrix has not been computed yet!")); @@ -483,14 +487,16 @@ FE_Q_Bubbles::get_restriction_matrix( const RefinementCase &refinement_case) const { Assert(refinement_case < RefinementCase::isotropic_refinement + 1, - ExcIndexRange( - refinement_case, 0, RefinementCase::isotropic_refinement + 1)); - Assert( - refinement_case != RefinementCase::no_refinement, - ExcMessage("Restriction matrices are only available for refined cells!")); - Assert( - child < GeometryInfo::n_children(refinement_case), - ExcIndexRange(child, 0, GeometryInfo::n_children(refinement_case))); + ExcIndexRange(refinement_case, + 0, + RefinementCase::isotropic_refinement + 1)); + Assert(refinement_case != RefinementCase::no_refinement, + ExcMessage( + "Restriction matrices are only available for refined cells!")); + Assert(child < GeometryInfo::n_children(refinement_case), + ExcIndexRange(child, + 0, + GeometryInfo::n_children(refinement_case))); Assert(this->restriction[refinement_case - 1][child].n() != 0, ExcMessage("This restriction matrix has not been computed yet!")); diff --git a/source/fe/fe_q_dg0.cc b/source/fe/fe_q_dg0.cc index b84f54ac3f..6b7569db4e 100644 --- a/source/fe/fe_q_dg0.cc +++ b/source/fe/fe_q_dg0.cc @@ -32,16 +32,16 @@ DEAL_II_NAMESPACE_OPEN template -FE_Q_DG0::FE_Q_DG0(const unsigned int degree) : - FE_Q_Base, dim, spacedim>( - TensorProductPolynomialsConst( - Polynomials::generate_complete_Lagrange_basis( - QGaussLobatto<1>(degree + 1).get_points())), - FiniteElementData(get_dpo_vector(degree), - 1, - degree, - FiniteElementData::L2), - get_riaf_vector(degree)) +FE_Q_DG0::FE_Q_DG0(const unsigned int degree) + : FE_Q_Base, dim, spacedim>( + TensorProductPolynomialsConst( + Polynomials::generate_complete_Lagrange_basis( + QGaussLobatto<1>(degree + 1).get_points())), + FiniteElementData(get_dpo_vector(degree), + 1, + degree, + FiniteElementData::L2), + get_riaf_vector(degree)) { Assert(degree > 0, ExcMessage("This element can only be used for polynomial degrees " @@ -60,15 +60,15 @@ FE_Q_DG0::FE_Q_DG0(const unsigned int degree) : template -FE_Q_DG0::FE_Q_DG0(const Quadrature<1> &points) : - FE_Q_Base, dim, spacedim>( - TensorProductPolynomialsConst( - Polynomials::generate_complete_Lagrange_basis(points.get_points())), - FiniteElementData(get_dpo_vector(points.size() - 1), - 1, - points.size() - 1, - FiniteElementData::L2), - get_riaf_vector(points.size() - 1)) +FE_Q_DG0::FE_Q_DG0(const Quadrature<1> &points) + : FE_Q_Base, dim, spacedim>( + TensorProductPolynomialsConst( + Polynomials::generate_complete_Lagrange_basis(points.get_points())), + FiniteElementData(get_dpo_vector(points.size() - 1), + 1, + points.size() - 1, + FiniteElementData::L2), + get_riaf_vector(points.size() - 1)) { const int degree = points.size() - 1; (void)degree; @@ -124,9 +124,9 @@ FE_Q_DG0::get_name() const } } // Do not consider the discontinuous node for dimension 1 - Assert( - index == n_points || (dim == 1 && index == n_points + 1), - ExcMessage("Could not decode support points in one coordinate direction.")); + Assert(index == n_points || (dim == 1 && index == n_points + 1), + ExcMessage( + "Could not decode support points in one coordinate direction.")); // Check whether the support points are equidistant. for (unsigned int j = 0; j < n_points; j++) @@ -188,9 +188,9 @@ FE_Q_DG0::convert_generalized_support_point_values_to_dof_values( this->unit_support_points.size())); Assert(nodal_dofs.size() == this->dofs_per_cell, ExcDimensionMismatch(nodal_dofs.size(), this->dofs_per_cell)); - Assert( - support_point_values[0].size() == this->n_components(), - ExcDimensionMismatch(support_point_values[0].size(), this->n_components())); + Assert(support_point_values[0].size() == this->n_components(), + ExcDimensionMismatch(support_point_values[0].size(), + this->n_components())); for (unsigned int i = 0; i < this->dofs_per_cell - 1; ++i) { @@ -221,9 +221,9 @@ FE_Q_DG0::get_interpolation_matrix( Assert(interpolation_matrix.m() == this->dofs_per_cell, ExcDimensionMismatch(interpolation_matrix.m(), this->dofs_per_cell)); - Assert( - interpolation_matrix.n() == x_source_fe.dofs_per_cell, - ExcDimensionMismatch(interpolation_matrix.m(), x_source_fe.dofs_per_cell)); + Assert(interpolation_matrix.n() == x_source_fe.dofs_per_cell, + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.dofs_per_cell)); this->FE_Q_Base, dim, spacedim>:: get_interpolation_matrix(x_source_fe, interpolation_matrix); diff --git a/source/fe/fe_q_hierarchical.cc b/source/fe/fe_q_hierarchical.cc index 0cc213ec6d..38940892e3 100644 --- a/source/fe/fe_q_hierarchical.cc +++ b/source/fe/fe_q_hierarchical.cc @@ -57,20 +57,20 @@ namespace internal template -FE_Q_Hierarchical::FE_Q_Hierarchical(const unsigned int degree) : - FE_Poly, dim>( - Polynomials::Hierarchical::generate_complete_basis(degree), - FiniteElementData(get_dpo_vector(degree), - 1, - degree, - FiniteElementData::H1), - std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, - false), - std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, - std::vector(1, true))), - face_renumber(face_fe_q_hierarchical_to_hierarchic_numbering(degree)) +FE_Q_Hierarchical::FE_Q_Hierarchical(const unsigned int degree) + : FE_Poly, dim>( + Polynomials::Hierarchical::generate_complete_basis(degree), + FiniteElementData(get_dpo_vector(degree), + 1, + degree, + FiniteElementData::H1), + std::vector( + FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, + false), + std::vector( + FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, + std::vector(1, true))) + , face_renumber(face_fe_q_hierarchical_to_hierarchic_numbering(degree)) { this->poly_space.set_numbering( hierarchic_to_fe_q_hierarchical_numbering(*this)); @@ -205,9 +205,10 @@ FE_Q_Hierarchical::get_prolongation_matrix( ExcMessage( "Prolongation matrices are only available for isotropic refinement!")); - Assert( - child < GeometryInfo::n_children(refinement_case), - ExcIndexRange(child, 0, GeometryInfo::n_children(refinement_case))); + Assert(child < GeometryInfo::n_children(refinement_case), + ExcIndexRange(child, + 0, + GeometryInfo::n_children(refinement_case))); return this->prolongation[refinement_case - 1][child]; } @@ -621,24 +622,27 @@ FE_Q_Hierarchical::initialize_constraints( dofs_subcell[0](2 + j, i % dofs_1d) * dofs_subcell[0](2 + k, (i - (i % dofs_1d)) / dofs_1d); // subcell 1 - this->interface_constraints( - 5 + 12 * (this->degree - 1) + j + k * (this->degree - 1) + - (this->degree - 1) * (this->degree - 1), - face_renumber[i]) = + this->interface_constraints(5 + 12 * (this->degree - 1) + + j + k * (this->degree - 1) + + (this->degree - 1) * + (this->degree - 1), + face_renumber[i]) = dofs_subcell[1](2 + j, i % dofs_1d) * dofs_subcell[0](2 + k, (i - (i % dofs_1d)) / dofs_1d); // subcell 2 - this->interface_constraints( - 5 + 12 * (this->degree - 1) + j + k * (this->degree - 1) + - 2 * (this->degree - 1) * (this->degree - 1), - face_renumber[i]) = + this->interface_constraints(5 + 12 * (this->degree - 1) + + j + k * (this->degree - 1) + + 2 * (this->degree - 1) * + (this->degree - 1), + face_renumber[i]) = dofs_subcell[0](2 + j, i % dofs_1d) * dofs_subcell[1](2 + k, (i - (i % dofs_1d)) / dofs_1d); // subcell 3 - this->interface_constraints( - 5 + 12 * (this->degree - 1) + j + k * (this->degree - 1) + - 3 * (this->degree - 1) * (this->degree - 1), - face_renumber[i]) = + this->interface_constraints(5 + 12 * (this->degree - 1) + + j + k * (this->degree - 1) + + 3 * (this->degree - 1) * + (this->degree - 1), + face_renumber[i]) = dofs_subcell[1](2 + j, i % dofs_1d) * dofs_subcell[1](2 + k, (i - (i % dofs_1d)) / dofs_1d); } @@ -713,16 +717,18 @@ FE_Q_Hierarchical::initialize_embedding_and_restriction( this->prolongation[iso][c](j, i) = dofs_subcell[c0](renumber[j] % dofs_1d, renumber[i] % dofs_1d) * - dofs_subcell[c1]( - (renumber[j] - (renumber[j] % dofs_1d)) / dofs_1d, - (renumber[i] - (renumber[i] % dofs_1d)) / dofs_1d); + dofs_subcell[c1]((renumber[j] - (renumber[j] % dofs_1d)) / + dofs_1d, + (renumber[i] - (renumber[i] % dofs_1d)) / + dofs_1d); this->restriction[iso][c](j, i) = dofs_cell[c0](renumber[j] % dofs_1d, renumber[i] % dofs_1d) * - dofs_cell[c1]( - (renumber[j] - (renumber[j] % dofs_1d)) / dofs_1d, - (renumber[i] - (renumber[i] % dofs_1d)) / dofs_1d); + dofs_cell[c1]((renumber[j] - (renumber[j] % dofs_1d)) / + dofs_1d, + (renumber[i] - (renumber[i] % dofs_1d)) / + dofs_1d); } break; } @@ -903,16 +909,16 @@ FE_Q_Hierarchical::get_face_interpolation_matrix( // source FE is also a // Q_Hierarchical element typedef FE_Q_Hierarchical FEQHierarchical; - AssertThrow( - (x_source_fe.get_name().find("FE_Q_Hierarchical<") == 0) || - (dynamic_cast(&x_source_fe) != nullptr), - (typename FiniteElement::ExcInterpolationNotImplemented())); + AssertThrow((x_source_fe.get_name().find("FE_Q_Hierarchical<") == 0) || + (dynamic_cast(&x_source_fe) != + nullptr), + (typename FiniteElement::ExcInterpolationNotImplemented())); Assert(interpolation_matrix.n() == this->dofs_per_face, ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert( - interpolation_matrix.m() == x_source_fe.dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.m(), x_source_fe.dofs_per_face)); + Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.dofs_per_face)); // ok, source is a Q_Hierarchical element, so // we will be able to do the work @@ -965,12 +971,13 @@ FE_Q_Hierarchical::get_face_interpolation_matrix( GeometryInfo<3>::vertices_per_face) = 1; for (unsigned int j = 0; j < this->degree - 1; ++j) - interpolation_matrix( - (i + GeometryInfo<3>::lines_per_face) * - (x_source_fe.degree - 1) + - j + GeometryInfo<3>::vertices_per_face, - (i + GeometryInfo<3>::lines_per_face) * (this->degree - 1) + - j + GeometryInfo<3>::vertices_per_face) = 1; + interpolation_matrix((i + GeometryInfo<3>::lines_per_face) * + (x_source_fe.degree - 1) + + j + GeometryInfo<3>::vertices_per_face, + (i + GeometryInfo<3>::lines_per_face) * + (this->degree - 1) + + j + GeometryInfo<3>::vertices_per_face) = + 1; } } } @@ -989,16 +996,16 @@ FE_Q_Hierarchical::get_subface_interpolation_matrix( // source FE is also a // Q_Hierarchical element typedef FE_Q_Hierarchical FEQHierarchical; - AssertThrow( - (x_source_fe.get_name().find("FE_Q_Hierarchical<") == 0) || - (dynamic_cast(&x_source_fe) != nullptr), - (typename FiniteElement::ExcInterpolationNotImplemented())); + AssertThrow((x_source_fe.get_name().find("FE_Q_Hierarchical<") == 0) || + (dynamic_cast(&x_source_fe) != + nullptr), + (typename FiniteElement::ExcInterpolationNotImplemented())); Assert(interpolation_matrix.n() == this->dofs_per_face, ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert( - interpolation_matrix.m() == x_source_fe.dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.m(), x_source_fe.dofs_per_face)); + Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.dofs_per_face)); // ok, source is a Q_Hierarchical element, so // we will be able to do the work @@ -1120,14 +1127,16 @@ FE_Q_Hierarchical::get_subface_interpolation_matrix( for (unsigned int line = 0; line < GeometryInfo<3>::lines_per_face; ++line) - interpolation_matrix( - 3, i + line * (this->degree - 1) + 4) = -0.5; + interpolation_matrix(3, + i + line * (this->degree - 1) + + 4) = -0.5; for (unsigned int j = 0; j < this->degree - 1;) { - interpolation_matrix( - 3, i + (j + 4) * this->degree - j) = 1.0; - j = j + 2; + interpolation_matrix(3, + i + (j + 4) * this->degree - j) = + 1.0; + j = j + 2; } interpolation_matrix(1, i + 2 * (this->degree + 1)) = @@ -1362,14 +1371,16 @@ FE_Q_Hierarchical::get_subface_interpolation_matrix( for (unsigned int line = 0; line < GeometryInfo<3>::lines_per_face; ++line) - interpolation_matrix( - 2, i + line * (this->degree - 1) + 4) = -0.5; + interpolation_matrix(2, + i + line * (this->degree - 1) + + 4) = -0.5; for (unsigned int j = 0; j < this->degree - 1;) { - interpolation_matrix( - 2, i + (j + 4) * this->degree - j) = 1.0; - j = j + 2; + interpolation_matrix(2, + i + (j + 4) * this->degree - j) = + 1.0; + j = j + 2; } interpolation_matrix(0, i + 2 * (this->degree + 1)) = @@ -1398,12 +1409,13 @@ FE_Q_Hierarchical::get_subface_interpolation_matrix( for (unsigned int j = 0; j < this->degree - 1;) { - interpolation_matrix( - i + 2, j + (i + 2) * this->degree + 2 - i) = tmp; + interpolation_matrix(i + 2, + j + (i + 2) * this->degree + 2 - + i) = tmp; interpolation_matrix(i + 3 * source_fe.degree - 1, i + (j + 4) * this->degree - j - - 2) = tmp; - j = j + 2; + 2) = tmp; + j = j + 2; } tmp *= -1.0; @@ -1486,10 +1498,10 @@ FE_Q_Hierarchical::get_subface_interpolation_matrix( for (unsigned int k = 0; k < this->degree - 1;) { - interpolation_matrix( - i + 2, k + (j + 2) * this->degree + 2 - j) = - tmp; - k = k + 2; + interpolation_matrix(i + 2, + k + (j + 2) * this->degree + + 2 - j) = tmp; + k = k + 2; } } @@ -1543,14 +1555,16 @@ FE_Q_Hierarchical::get_subface_interpolation_matrix( for (unsigned int line = 0; line < GeometryInfo<3>::lines_per_face; ++line) - interpolation_matrix( - 1, i + line * (this->degree - 1) + 4) = -0.5; + interpolation_matrix(1, + i + line * (this->degree - 1) + + 4) = -0.5; for (unsigned int j = 0; j < this->degree - 1;) { - interpolation_matrix( - 1, i + (j + 4) * this->degree - j) = 1.0; - j = j + 2; + interpolation_matrix(1, + i + (j + 4) * this->degree - j) = + 1.0; + j = j + 2; } interpolation_matrix(0, i + 4) = -1.0; @@ -1705,14 +1719,16 @@ FE_Q_Hierarchical::get_subface_interpolation_matrix( for (unsigned int line = 0; line < GeometryInfo<3>::lines_per_face; ++line) - interpolation_matrix( - 0, i + line * (this->degree - 1) + 4) = -0.5; + interpolation_matrix(0, + i + line * (this->degree - 1) + + 4) = -0.5; for (unsigned int j = 0; j < this->degree - 1;) { - interpolation_matrix( - 0, i + (j + 4) * this->degree - j) = 1.0; - j = j + 2; + interpolation_matrix(0, + i + (j + 4) * this->degree - j) = + 1.0; + j = j + 2; } interpolation_matrix(1, i + 4) = -1.0; @@ -1741,8 +1757,9 @@ FE_Q_Hierarchical::get_subface_interpolation_matrix( for (unsigned int j = 0; j < this->degree - 1;) { - interpolation_matrix( - i + 2, j + (i + 2) * this->degree + 2 - i) = tmp; + interpolation_matrix(i + 2, + j + (i + 2) * this->degree + 2 - + i) = tmp; interpolation_matrix(i + 2 * source_fe.degree, i + (j + 4) * this->degree - 2) = tmp; @@ -1828,13 +1845,13 @@ FE_Q_Hierarchical::get_subface_interpolation_matrix( for (unsigned int k = 0; k < this->degree - 1;) { - interpolation_matrix( - i + 2, k + (j + 2) * this->degree + 2 - j) = - tmp; + interpolation_matrix(i + 2, + k + (j + 2) * this->degree + + 2 - j) = tmp; interpolation_matrix(i + 2 * source_fe.degree, j + (k + 4) * this->degree - - 2) = tmp; - k = k + 2; + 2) = tmp; + k = k + 2; } } } diff --git a/source/fe/fe_q_iso_q1.cc b/source/fe/fe_q_iso_q1.cc index 31f63f19c0..0e1214febe 100644 --- a/source/fe/fe_q_iso_q1.cc +++ b/source/fe/fe_q_iso_q1.cc @@ -30,20 +30,20 @@ DEAL_II_NAMESPACE_OPEN template -FE_Q_iso_Q1::FE_Q_iso_Q1(const unsigned int subdivisions) : - FE_Q_Base< - TensorProductPolynomials>, - dim, - spacedim>( - TensorProductPolynomials>( - Polynomials::generate_complete_Lagrange_basis_on_subdivisions( - subdivisions, - 1)), - FiniteElementData(this->get_dpo_vector(subdivisions), - 1, - subdivisions, - FiniteElementData::H1), - std::vector(1, false)) +FE_Q_iso_Q1::FE_Q_iso_Q1(const unsigned int subdivisions) + : FE_Q_Base< + TensorProductPolynomials>, + dim, + spacedim>( + TensorProductPolynomials>( + Polynomials::generate_complete_Lagrange_basis_on_subdivisions( + subdivisions, + 1)), + FiniteElementData(this->get_dpo_vector(subdivisions), + 1, + subdivisions, + FiniteElementData::H1), + std::vector(1, false)) { Assert(subdivisions > 0, ExcMessage("This element can only be used with a positive number of " diff --git a/source/fe/fe_rannacher_turek.cc b/source/fe/fe_rannacher_turek.cc index 37d0612d2f..06021f1171 100644 --- a/source/fe/fe_rannacher_turek.cc +++ b/source/fe/fe_rannacher_turek.cc @@ -31,17 +31,17 @@ DEAL_II_NAMESPACE_OPEN template FE_RannacherTurek::FE_RannacherTurek( const unsigned int order, - const unsigned int n_face_support_points) : - FE_Poly, dim>( - PolynomialsRannacherTurek(), - FiniteElementData(this->get_dpo_vector(), - 1, - 2, - FiniteElementData::L2), - std::vector(4, false), // restriction not implemented - std::vector(4, std::vector(1, true))), - order(order), - n_face_support_points(n_face_support_points) + const unsigned int n_face_support_points) + : FE_Poly, dim>( + PolynomialsRannacherTurek(), + FiniteElementData(this->get_dpo_vector(), + 1, + 2, + FiniteElementData::L2), + std::vector(4, false), // restriction not implemented + std::vector(4, std::vector(1, true))) + , order(order) + , n_face_support_points(n_face_support_points) { Assert(dim == 2, ExcNotImplemented()); Assert(order == 0, ExcNotImplemented()); diff --git a/source/fe/fe_raviart_thomas.cc b/source/fe/fe_raviart_thomas.cc index 8f02599588..d2a7e3b38d 100644 --- a/source/fe/fe_raviart_thomas.cc +++ b/source/fe/fe_raviart_thomas.cc @@ -44,17 +44,18 @@ DEAL_II_NAMESPACE_OPEN template -FE_RaviartThomas::FE_RaviartThomas(const unsigned int deg) : - FE_PolyTensor, dim>( - deg, - FiniteElementData(get_dpo_vector(deg), - dim, - deg + 1, - FiniteElementData::Hdiv), - std::vector(PolynomialsRaviartThomas::compute_n_pols(deg), true), - std::vector( - PolynomialsRaviartThomas::compute_n_pols(deg), - std::vector(dim, true))) +FE_RaviartThomas::FE_RaviartThomas(const unsigned int deg) + : FE_PolyTensor, dim>( + deg, + FiniteElementData(get_dpo_vector(deg), + dim, + deg + 1, + FiniteElementData::Hdiv), + std::vector(PolynomialsRaviartThomas::compute_n_pols(deg), + true), + std::vector(PolynomialsRaviartThomas::compute_n_pols( + deg), + std::vector(dim, true))) { Assert(dim >= 2, ExcImpossibleInDim(dim)); const unsigned int n_dofs = this->dofs_per_cell; @@ -91,8 +92,10 @@ FE_RaviartThomas::FE_RaviartThomas(const unsigned int deg) : FullMatrix face_embeddings[GeometryInfo::max_children_per_face]; for (unsigned int i = 0; i < GeometryInfo::max_children_per_face; ++i) face_embeddings[i].reinit(this->dofs_per_face, this->dofs_per_face); - FETools::compute_face_embedding_matrices( - *this, face_embeddings, 0, 0); + FETools::compute_face_embedding_matrices(*this, + face_embeddings, + 0, + 0); this->interface_constraints.reinit((1 << (dim - 1)) * this->dofs_per_face, this->dofs_per_face); unsigned int target_row = 0; @@ -320,8 +323,9 @@ FE_RaviartThomas::initialize_restriction() // subcell are NOT // transformed, so we // have to do it here. - this->restriction[iso][child]( - face * this->dofs_per_face + i_face, i_child) += + this->restriction[iso][child](face * this->dofs_per_face + + i_face, + i_child) += Utilities::fixed_power(.5) * q_sub.weight(k) * cached_values_on_face(i_child, k) * this->shape_value_component( @@ -358,8 +362,9 @@ FE_RaviartThomas::initialize_restriction() // Store shape values, since the // evaluation suffers if not // ordered by point - Table<3, double> cached_values_on_cell( - this->dofs_per_cell, q_cell.size(), dim); + Table<3, double> cached_values_on_cell(this->dofs_per_cell, + q_cell.size(), + dim); for (unsigned int k = 0; k < q_cell.size(); ++k) for (unsigned int i = 0; i < this->dofs_per_cell; ++i) for (unsigned int d = 0; d < dim; ++d) @@ -377,8 +382,9 @@ FE_RaviartThomas::initialize_restriction() for (unsigned int i_weight = 0; i_weight < polynomials[d]->n(); ++i_weight) { - this->restriction[iso][child]( - start_cell_dofs + i_weight * dim + d, i_child) += + this->restriction[iso][child](start_cell_dofs + i_weight * dim + + d, + i_child) += q_sub.weight(k) * cached_values_on_cell(i_child, k, d) * polynomials[d]->compute_value(i_weight, q_sub.point(k)); } @@ -486,9 +492,9 @@ FE_RaviartThomas::convert_generalized_support_point_values_to_dof_values( this->generalized_support_points.size())); Assert(nodal_values.size() == this->dofs_per_cell, ExcDimensionMismatch(nodal_values.size(), this->dofs_per_cell)); - Assert( - support_point_values[0].size() == this->n_components(), - ExcDimensionMismatch(support_point_values[0].size(), this->n_components())); + Assert(support_point_values[0].size() == this->n_components(), + ExcDimensionMismatch(support_point_values[0].size(), + this->n_components())); std::fill(nodal_values.begin(), nodal_values.end(), 0.); diff --git a/source/fe/fe_raviart_thomas_nodal.cc b/source/fe/fe_raviart_thomas_nodal.cc index 33c37dbd85..ffcad9089c 100644 --- a/source/fe/fe_raviart_thomas_nodal.cc +++ b/source/fe/fe_raviart_thomas_nodal.cc @@ -38,17 +38,17 @@ DEAL_II_NAMESPACE_OPEN template -FE_RaviartThomasNodal::FE_RaviartThomasNodal(const unsigned int deg) : - FE_PolyTensor, dim>( - deg, - FiniteElementData(get_dpo_vector(deg), - dim, - deg + 1, - FiniteElementData::Hdiv), - get_ria_vector(deg), - std::vector( - PolynomialsRaviartThomas::compute_n_pols(deg), - std::vector(dim, true))) +FE_RaviartThomasNodal::FE_RaviartThomasNodal(const unsigned int deg) + : FE_PolyTensor, dim>( + deg, + FiniteElementData(get_dpo_vector(deg), + dim, + deg + 1, + FiniteElementData::Hdiv), + get_ria_vector(deg), + std::vector(PolynomialsRaviartThomas::compute_n_pols( + deg), + std::vector(dim, true))) { Assert(dim >= 2, ExcImpossibleInDim(dim)); const unsigned int n_dofs = this->dofs_per_cell; @@ -91,8 +91,10 @@ FE_RaviartThomasNodal::FE_RaviartThomasNodal(const unsigned int deg) : FullMatrix face_embeddings[GeometryInfo::max_children_per_face]; for (unsigned int i = 0; i < GeometryInfo::max_children_per_face; ++i) face_embeddings[i].reinit(this->dofs_per_face, this->dofs_per_face); - FETools::compute_face_embedding_matrices( - *this, face_embeddings, 0, 0); + FETools::compute_face_embedding_matrices(*this, + face_embeddings, + 0, + 0); this->interface_constraints.reinit((1 << (dim - 1)) * this->dofs_per_face, this->dofs_per_face); unsigned int target_row = 0; @@ -198,10 +200,11 @@ FE_RaviartThomasNodal::initialize_support_points(const unsigned int deg) ((d == 0) ? low : high), ((d == 1) ? low : high)); break; case 3: - quadrature = std_cxx14::make_unique>( - ((d == 0) ? low : high), - ((d == 1) ? low : high), - ((d == 2) ? low : high)); + quadrature = + std_cxx14::make_unique>(((d == 0) ? low : high), + ((d == 1) ? low : high), + ((d == 2) ? low : + high)); break; default: Assert(false, ExcNotImplemented()); @@ -313,9 +316,9 @@ FE_RaviartThomasNodal:: this->generalized_support_points.size())); Assert(nodal_values.size() == this->dofs_per_cell, ExcDimensionMismatch(nodal_values.size(), this->dofs_per_cell)); - Assert( - support_point_values[0].size() == this->n_components(), - ExcDimensionMismatch(support_point_values[0].size(), this->n_components())); + Assert(support_point_values[0].size() == this->n_components(), + ExcDimensionMismatch(support_point_values[0].size(), + this->n_components())); // First do interpolation on // faces. There, the component @@ -576,9 +579,9 @@ FE_RaviartThomasNodal::get_face_interpolation_matrix( Assert(interpolation_matrix.n() == this->dofs_per_face, ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert( - interpolation_matrix.m() == x_source_fe.dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.m(), x_source_fe.dofs_per_face)); + Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.dofs_per_face)); // ok, source is a RaviartThomasNodal element, so // we will be able to do the work @@ -680,9 +683,9 @@ FE_RaviartThomasNodal::get_subface_interpolation_matrix( Assert(interpolation_matrix.n() == this->dofs_per_face, ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert( - interpolation_matrix.m() == x_source_fe.dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.m(), x_source_fe.dofs_per_face)); + Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.dofs_per_face)); // ok, source is a RaviartThomasNodal element, so // we will be able to do the work diff --git a/source/fe/fe_rt_bubbles.cc b/source/fe/fe_rt_bubbles.cc index d244f1a8ff..c1d3f61836 100644 --- a/source/fe/fe_rt_bubbles.cc +++ b/source/fe/fe_rt_bubbles.cc @@ -37,16 +37,17 @@ DEAL_II_NAMESPACE_OPEN template -FE_RT_Bubbles::FE_RT_Bubbles(const unsigned int deg) : - FE_PolyTensor, dim>( - deg, - FiniteElementData(get_dpo_vector(deg), - dim, - deg + 1, - FiniteElementData::Hdiv), - get_ria_vector(deg), - std::vector(PolynomialsRT_Bubbles::compute_n_pols(deg), - std::vector(dim, true))) +FE_RT_Bubbles::FE_RT_Bubbles(const unsigned int deg) + : FE_PolyTensor, dim>( + deg, + FiniteElementData(get_dpo_vector(deg), + dim, + deg + 1, + FiniteElementData::Hdiv), + get_ria_vector(deg), + std::vector(PolynomialsRT_Bubbles::compute_n_pols( + deg), + std::vector(dim, true))) { Assert(dim >= 2, ExcImpossibleInDim(dim)); Assert( @@ -82,8 +83,10 @@ FE_RT_Bubbles::FE_RT_Bubbles(const unsigned int deg) : FullMatrix face_embeddings[GeometryInfo::max_children_per_face]; for (unsigned int i = 0; i < GeometryInfo::max_children_per_face; ++i) face_embeddings[i].reinit(this->dofs_per_face, this->dofs_per_face); - FETools::compute_face_embedding_matrices( - *this, face_embeddings, 0, 0); + FETools::compute_face_embedding_matrices(*this, + face_embeddings, + 0, + 0); this->interface_constraints.reinit((1 << (dim - 1)) * this->dofs_per_face, this->dofs_per_face); unsigned int target_row = 0; @@ -183,10 +186,11 @@ FE_RT_Bubbles::initialize_support_points(const unsigned int deg) ((d == 0) ? low : high), ((d == 1) ? low : high)); break; case 3: - quadrature = std_cxx14::make_unique>( - ((d == 0) ? low : high), - ((d == 1) ? low : high), - ((d == 2) ? low : high)); + quadrature = + std_cxx14::make_unique>(((d == 0) ? low : high), + ((d == 1) ? low : high), + ((d == 2) ? low : + high)); break; default: Assert(false, ExcNotImplemented()); @@ -265,9 +269,9 @@ FE_RT_Bubbles::convert_generalized_support_point_values_to_dof_values( this->generalized_support_points.size())); Assert(nodal_values.size() == this->dofs_per_cell, ExcDimensionMismatch(nodal_values.size(), this->dofs_per_cell)); - Assert( - support_point_values[0].size() == this->n_components(), - ExcDimensionMismatch(support_point_values[0].size(), this->n_components())); + Assert(support_point_values[0].size() == this->n_components(), + ExcDimensionMismatch(support_point_values[0].size(), + this->n_components())); // First do interpolation on faces. There, the component // evaluated depends on the face direction and orientation. diff --git a/source/fe/fe_series.cc b/source/fe/fe_series.cc index fac5272aa5..1a3a417036 100644 --- a/source/fe/fe_series.cc +++ b/source/fe/fe_series.cc @@ -69,10 +69,10 @@ namespace FESeries template Fourier::Fourier(const unsigned int N, const hp::FECollection &fe_collection, - const hp::QCollection & q_collection) : - fe_collection(&fe_collection), - q_collection(&q_collection), - fourier_transform_matrices(fe_collection.size()) + const hp::QCollection & q_collection) + : fe_collection(&fe_collection) + , q_collection(&q_collection) + , fourier_transform_matrices(fe_collection.size()) { set_k_vectors(k_vectors, N); unrolled_coefficients.resize(k_vectors.n_elements()); @@ -184,8 +184,10 @@ namespace FESeries for (unsigned int k = 0; k < k_vectors.size(0); ++k) for (unsigned int j = 0; j < (*fe_collection)[fe].dofs_per_cell; ++j) - fourier_transform_matrices[fe](k, j) = integrate( - (*fe_collection)[fe], (*q_collection)[fe], k_vectors(k), j); + fourier_transform_matrices[fe](k, j) = integrate((*fe_collection)[fe], + (*q_collection)[fe], + k_vectors(k), + j); } } @@ -243,12 +245,12 @@ namespace FESeries template Legendre::Legendre(const unsigned int size_in_each_direction, const hp::FECollection &fe_collection, - const hp::QCollection & q_collection) : - N(size_in_each_direction), - fe_collection(&fe_collection), - q_collection(&q_collection), - legendre_transform_matrices(fe_collection.size()), - unrolled_coefficients(Utilities::fixed_power(N), 0.) + const hp::QCollection & q_collection) + : N(size_in_each_direction) + , fe_collection(&fe_collection) + , q_collection(&q_collection) + , legendre_transform_matrices(fe_collection.size()) + , unrolled_coefficients(Utilities::fixed_power(N), 0.) {} template diff --git a/source/fe/fe_system.cc b/source/fe/fe_system.cc index 34e5fbcd62..ea5cae7ede 100644 --- a/source/fe/fe_system.cc +++ b/source/fe/fe_system.cc @@ -42,8 +42,9 @@ namespace internal unsigned int count_nonzeros(const std::vector &vec) { - return std::count_if( - vec.begin(), vec.end(), [](const unsigned int i) { return i > 0; }); + return std::count_if(vec.begin(), vec.end(), [](const unsigned int i) { + return i > 0; + }); } } // namespace } // namespace FESystemImplementation @@ -53,9 +54,9 @@ namespace internal template FESystem::InternalData::InternalData( - const unsigned int n_base_elements) : - base_fe_datas(n_base_elements), - base_fe_output_objects(n_base_elements) + const unsigned int n_base_elements) + : base_fe_datas(n_base_elements) + , base_fe_output_objects(n_base_elements) {} @@ -115,13 +116,13 @@ const unsigned int FESystem::invalid_face_number; template FESystem::FESystem(const FiniteElement &fe, - const unsigned int n_elements) : - FiniteElement( - FETools::Compositing::multiply_dof_numbers(&fe, n_elements), - FETools::Compositing::compute_restriction_is_additive_flags(&fe, - n_elements), - FETools::Compositing::compute_nonzero_components(&fe, n_elements)), - base_elements((n_elements > 0)) + const unsigned int n_elements) + : FiniteElement( + FETools::Compositing::multiply_dof_numbers(&fe, n_elements), + FETools::Compositing::compute_restriction_is_additive_flags(&fe, + n_elements), + FETools::Compositing::compute_nonzero_components(&fe, n_elements)) + , base_elements((n_elements > 0)) { std::vector *> fes; fes.push_back(&fe); @@ -136,15 +137,15 @@ template FESystem::FESystem(const FiniteElement &fe1, const unsigned int n1, const FiniteElement &fe2, - const unsigned int n2) : - FiniteElement( - FETools::Compositing::multiply_dof_numbers(&fe1, n1, &fe2, n2), - FETools::Compositing::compute_restriction_is_additive_flags(&fe1, - n1, - &fe2, - n2), - FETools::Compositing::compute_nonzero_components(&fe1, n1, &fe2, n2)), - base_elements((n1 > 0) + (n2 > 0)) + const unsigned int n2) + : FiniteElement( + FETools::Compositing::multiply_dof_numbers(&fe1, n1, &fe2, n2), + FETools::Compositing::compute_restriction_is_additive_flags(&fe1, + n1, + &fe2, + n2), + FETools::Compositing::compute_nonzero_components(&fe1, n1, &fe2, n2)) + , base_elements((n1 > 0) + (n2 > 0)) { std::vector *> fes; fes.push_back(&fe1); @@ -163,22 +164,22 @@ FESystem::FESystem(const FiniteElement &fe1, const FiniteElement &fe2, const unsigned int n2, const FiniteElement &fe3, - const unsigned int n3) : - FiniteElement( - FETools::Compositing::multiply_dof_numbers(&fe1, n1, &fe2, n2, &fe3, n3), - FETools::Compositing::compute_restriction_is_additive_flags(&fe1, - n1, - &fe2, - n2, - &fe3, - n3), - FETools::Compositing::compute_nonzero_components(&fe1, - n1, - &fe2, - n2, - &fe3, - n3)), - base_elements((n1 > 0) + (n2 > 0) + (n3 > 0)) + const unsigned int n3) + : FiniteElement( + FETools::Compositing::multiply_dof_numbers(&fe1, n1, &fe2, n2, &fe3, n3), + FETools::Compositing::compute_restriction_is_additive_flags(&fe1, + n1, + &fe2, + n2, + &fe3, + n3), + FETools::Compositing::compute_nonzero_components(&fe1, + n1, + &fe2, + n2, + &fe3, + n3)) + , base_elements((n1 > 0) + (n2 > 0) + (n3 > 0)) { std::vector *> fes; fes.push_back(&fe1); @@ -201,33 +202,33 @@ FESystem::FESystem(const FiniteElement &fe1, const FiniteElement &fe3, const unsigned int n3, const FiniteElement &fe4, - const unsigned int n4) : - FiniteElement( - FETools::Compositing::multiply_dof_numbers(&fe1, - n1, - &fe2, - n2, - &fe3, - n3, - &fe4, - n4), - FETools::Compositing::compute_restriction_is_additive_flags(&fe1, - n1, - &fe2, - n2, - &fe3, - n3, - &fe4, - n4), - FETools::Compositing::compute_nonzero_components(&fe1, - n1, - &fe2, - n2, - &fe3, - n3, - &fe4, - n4)), - base_elements((n1 > 0) + (n2 > 0) + (n3 > 0) + (n4 > 0)) + const unsigned int n4) + : FiniteElement( + FETools::Compositing::multiply_dof_numbers(&fe1, + n1, + &fe2, + n2, + &fe3, + n3, + &fe4, + n4), + FETools::Compositing::compute_restriction_is_additive_flags(&fe1, + n1, + &fe2, + n2, + &fe3, + n3, + &fe4, + n4), + FETools::Compositing::compute_nonzero_components(&fe1, + n1, + &fe2, + n2, + &fe3, + n3, + &fe4, + n4)) + , base_elements((n1 > 0) + (n2 > 0) + (n3 > 0) + (n4 > 0)) { std::vector *> fes; fes.push_back(&fe1); @@ -254,31 +255,31 @@ FESystem::FESystem(const FiniteElement &fe1, const FiniteElement &fe4, const unsigned int n4, const FiniteElement &fe5, - const unsigned int n5) : - FiniteElement( - FETools::Compositing:: - multiply_dof_numbers(&fe1, n1, &fe2, n2, &fe3, n3, &fe4, n4, &fe5, n5), - FETools::Compositing::compute_restriction_is_additive_flags(&fe1, - n1, - &fe2, - n2, - &fe3, - n3, - &fe4, - n4, - &fe5, - n5), - FETools::Compositing::compute_nonzero_components(&fe1, - n1, - &fe2, - n2, - &fe3, - n3, - &fe4, - n4, - &fe5, - n5)), - base_elements((n1 > 0) + (n2 > 0) + (n3 > 0) + (n4 > 0) + (n5 > 0)) + const unsigned int n5) + : FiniteElement( + FETools::Compositing:: + multiply_dof_numbers(&fe1, n1, &fe2, n2, &fe3, n3, &fe4, n4, &fe5, n5), + FETools::Compositing::compute_restriction_is_additive_flags(&fe1, + n1, + &fe2, + n2, + &fe3, + n3, + &fe4, + n4, + &fe5, + n5), + FETools::Compositing::compute_nonzero_components(&fe1, + n1, + &fe2, + n2, + &fe3, + n3, + &fe4, + n4, + &fe5, + n5)) + , base_elements((n1 > 0) + (n2 > 0) + (n3 > 0) + (n4 > 0) + (n5 > 0)) { std::vector *> fes; fes.push_back(&fe1); @@ -300,14 +301,15 @@ FESystem::FESystem(const FiniteElement &fe1, template FESystem::FESystem( const std::vector *> &fes, - const std::vector & multiplicities) : - FiniteElement( - FETools::Compositing::multiply_dof_numbers(fes, multiplicities), - FETools::Compositing::compute_restriction_is_additive_flags(fes, - multiplicities), - FETools::Compositing::compute_nonzero_components(fes, multiplicities)), - base_elements( - internal::FESystemImplementation::count_nonzeros(multiplicities)) + const std::vector & multiplicities) + : FiniteElement( + FETools::Compositing::multiply_dof_numbers(fes, multiplicities), + FETools::Compositing::compute_restriction_is_additive_flags( + fes, + multiplicities), + FETools::Compositing::compute_nonzero_components(fes, multiplicities)) + , base_elements( + internal::FESystemImplementation::count_nonzeros(multiplicities)) { initialize(fes, multiplicities); } @@ -395,9 +397,9 @@ FESystem::shape_value(const unsigned int i, const Point & p) const { Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell)); - Assert( - this->is_primitive(i), - (typename FiniteElement::ExcShapeFunctionNotPrimitive(i))); + Assert(this->is_primitive(i), + (typename FiniteElement::ExcShapeFunctionNotPrimitive( + i))); return (base_element(this->system_to_base_table[i].first.first) .shape_value(this->system_to_base_table[i].second, p)); @@ -448,9 +450,9 @@ FESystem::shape_grad(const unsigned int i, const Point & p) const { Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell)); - Assert( - this->is_primitive(i), - (typename FiniteElement::ExcShapeFunctionNotPrimitive(i))); + Assert(this->is_primitive(i), + (typename FiniteElement::ExcShapeFunctionNotPrimitive( + i))); return (base_element(this->system_to_base_table[i].first.first) .shape_grad(this->system_to_base_table[i].second, p)); @@ -494,9 +496,9 @@ FESystem::shape_grad_grad(const unsigned int i, const Point & p) const { Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell)); - Assert( - this->is_primitive(i), - (typename FiniteElement::ExcShapeFunctionNotPrimitive(i))); + Assert(this->is_primitive(i), + (typename FiniteElement::ExcShapeFunctionNotPrimitive( + i))); return (base_element(this->system_to_base_table[i].first.first) .shape_grad_grad(this->system_to_base_table[i].second, p)); @@ -540,9 +542,9 @@ FESystem::shape_3rd_derivative(const unsigned int i, const Point & p) const { Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell)); - Assert( - this->is_primitive(i), - (typename FiniteElement::ExcShapeFunctionNotPrimitive(i))); + Assert(this->is_primitive(i), + (typename FiniteElement::ExcShapeFunctionNotPrimitive( + i))); return (base_element(this->system_to_base_table[i].first.first) .shape_3rd_derivative(this->system_to_base_table[i].second, p)); @@ -586,9 +588,9 @@ FESystem::shape_4th_derivative(const unsigned int i, const Point & p) const { Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell)); - Assert( - this->is_primitive(i), - (typename FiniteElement::ExcShapeFunctionNotPrimitive(i))); + Assert(this->is_primitive(i), + (typename FiniteElement::ExcShapeFunctionNotPrimitive( + i))); return (base_element(this->system_to_base_table[i].first.first) .shape_4th_derivative(this->system_to_base_table[i].second, p)); @@ -639,10 +641,10 @@ FESystem::get_interpolation_matrix( Assert((interpolation_matrix.m() == this->dofs_per_cell) || (x_source_fe.dofs_per_cell == 0), ExcDimensionMismatch(interpolation_matrix.m(), this->dofs_per_cell)); - Assert( - (interpolation_matrix.n() == x_source_fe.dofs_per_cell) || - (this->dofs_per_cell == 0), - ExcDimensionMismatch(interpolation_matrix.m(), x_source_fe.dofs_per_cell)); + Assert((interpolation_matrix.n() == x_source_fe.dofs_per_cell) || + (this->dofs_per_cell == 0), + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.dofs_per_cell)); // there are certain conditions that the two elements have to satisfy so // that this can work. @@ -709,14 +711,16 @@ FESystem::get_restriction_matrix( const RefinementCase &refinement_case) const { Assert(refinement_case < RefinementCase::isotropic_refinement + 1, - ExcIndexRange( - refinement_case, 0, RefinementCase::isotropic_refinement + 1)); - Assert( - refinement_case != RefinementCase::no_refinement, - ExcMessage("Restriction matrices are only available for refined cells!")); - Assert( - child < GeometryInfo::n_children(refinement_case), - ExcIndexRange(child, 0, GeometryInfo::n_children(refinement_case))); + ExcIndexRange(refinement_case, + 0, + RefinementCase::isotropic_refinement + 1)); + Assert(refinement_case != RefinementCase::no_refinement, + ExcMessage( + "Restriction matrices are only available for refined cells!")); + Assert(child < GeometryInfo::n_children(refinement_case), + ExcIndexRange(child, + 0, + GeometryInfo::n_children(refinement_case))); // initialization upon first request if (this->restriction[refinement_case - 1][child].n() == 0) @@ -803,14 +807,16 @@ FESystem::get_prolongation_matrix( const RefinementCase &refinement_case) const { Assert(refinement_case < RefinementCase::isotropic_refinement + 1, - ExcIndexRange( - refinement_case, 0, RefinementCase::isotropic_refinement + 1)); - Assert( - refinement_case != RefinementCase::no_refinement, - ExcMessage("Restriction matrices are only available for refined cells!")); - Assert( - child < GeometryInfo::n_children(refinement_case), - ExcIndexRange(child, 0, GeometryInfo::n_children(refinement_case))); + ExcIndexRange(refinement_case, + 0, + RefinementCase::isotropic_refinement + 1)); + Assert(refinement_case != RefinementCase::no_refinement, + ExcMessage( + "Restriction matrices are only available for refined cells!")); + Assert(child < GeometryInfo::n_children(refinement_case), + ExcIndexRange(child, + 0, + GeometryInfo::n_children(refinement_case))); // initialization upon first request, construction completely analogous to // restriction matrix @@ -971,8 +977,10 @@ FESystem::get_data( // out of the base output object into the system output object, // but we can't because we can't know what the elements already // copied and/or will want to update on every cell - auto base_fe_data = base_element(base_no).get_data( - flags, mapping, quadrature, base_fe_output_object); + auto base_fe_data = base_element(base_no).get_data(flags, + mapping, + quadrature, + base_fe_output_object); data->set_fe_data(base_no, std::move(base_fe_data)); } @@ -1811,10 +1819,9 @@ FESystem::initialize( init_tasks += Threads::new_task([&]() { // the array into which we want to write should have the correct size // already. - Assert( - this->adjust_quad_dof_index_for_face_orientation_table.n_elements() == - 8 * this->dofs_per_quad, - ExcInternalError()); + Assert(this->adjust_quad_dof_index_for_face_orientation_table + .n_elements() == 8 * this->dofs_per_quad, + ExcInternalError()); // to obtain the shifts for this composed element, copy the shift // information of the base elements @@ -1885,9 +1892,9 @@ FESystem::get_face_interpolation_matrix( { Assert(interpolation_matrix.n() == this->dofs_per_face, ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert( - interpolation_matrix.m() == x_source_fe.dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.m(), x_source_fe.dofs_per_face)); + Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.dofs_per_face)); // since dofs for each base are independent, we only have to stack things up // from base element to base element @@ -2000,9 +2007,9 @@ FESystem::get_subface_interpolation_matrix( Assert(interpolation_matrix.n() == this->dofs_per_face, ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert( - interpolation_matrix.m() == x_source_fe.dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.m(), x_source_fe.dofs_per_face)); + Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.dofs_per_face)); // since dofs for each base are independent, we only have to stack things up // from base element to base element @@ -2041,8 +2048,9 @@ FESystem::get_subface_interpolation_matrix( // get the interpolation from the bases base_to_base_interpolation.reinit(base_other.dofs_per_face, base.dofs_per_face); - base.get_subface_interpolation_matrix( - base_other, subface, base_to_base_interpolation); + base.get_subface_interpolation_matrix(base_other, + subface, + base_to_base_interpolation); // now translate entries. we'd like to have something like // face_base_to_system_index, but that doesn't exist. rather, all we @@ -2396,9 +2404,9 @@ FESystem::get_constant_modes() const this->system_to_base_index(k); if (ind.first.first == i) for (unsigned int c = 0; c < base_table.first.n_rows(); ++c) - constant_modes( - comp + ind.first.second * base_table.first.n_rows() + c, k) = - base_table.first(c, ind.second); + constant_modes(comp + + ind.first.second * base_table.first.n_rows() + c, + k) = base_table.first(c, ind.second); } for (unsigned int r = 0; r < element_multiplicity; ++r) for (unsigned int c = 0; c < base_table.second.size(); ++c) diff --git a/source/fe/fe_trace.cc b/source/fe/fe_trace.cc index b498665e56..083260b6b9 100644 --- a/source/fe/fe_trace.cc +++ b/source/fe/fe_trace.cc @@ -35,17 +35,17 @@ DEAL_II_NAMESPACE_OPEN template -FE_TraceQ::FE_TraceQ(const unsigned int degree) : - FE_PolyFace, dim, spacedim>( - TensorProductPolynomials( - Polynomials::generate_complete_Lagrange_basis( - QGaussLobatto<1>(degree + 1).get_points())), - FiniteElementData(get_dpo_vector(degree), - 1, - degree, - FiniteElementData::L2), - std::vector(1, true)), - fe_q(degree) +FE_TraceQ::FE_TraceQ(const unsigned int degree) + : FE_PolyFace, dim, spacedim>( + TensorProductPolynomials( + Polynomials::generate_complete_Lagrange_basis( + QGaussLobatto<1>(degree + 1).get_points())), + FiniteElementData(get_dpo_vector(degree), + 1, + degree, + FiniteElementData::L2), + std::vector(1, true)) + , fe_q(degree) { Assert(degree > 0, ExcMessage("FE_Trace can only be used for polynomial degrees " @@ -218,8 +218,9 @@ FE_TraceQ::get_face_interpolation_matrix( const FiniteElement &source_fe, FullMatrix & interpolation_matrix) const { - get_subface_interpolation_matrix( - source_fe, numbers::invalid_unsigned_int, interpolation_matrix); + get_subface_interpolation_matrix(source_fe, + numbers::invalid_unsigned_int, + interpolation_matrix); } @@ -234,16 +235,17 @@ FE_TraceQ::get_subface_interpolation_matrix( // this is the code from FE_FaceQ Assert(interpolation_matrix.n() == this->dofs_per_face, ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert( - interpolation_matrix.m() == x_source_fe.dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.m(), x_source_fe.dofs_per_face)); + Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.dofs_per_face)); // see if source is a FaceQ element if (const FE_TraceQ *source_fe = dynamic_cast *>(&x_source_fe)) { - fe_q.get_subface_interpolation_matrix( - source_fe->fe_q, subface, interpolation_matrix); + fe_q.get_subface_interpolation_matrix(source_fe->fe_q, + subface, + interpolation_matrix); } else if (dynamic_cast *>(&x_source_fe) != nullptr) { @@ -259,8 +261,8 @@ FE_TraceQ::get_subface_interpolation_matrix( template -FE_TraceQ<1, spacedim>::FE_TraceQ(const unsigned int degree) : - FE_FaceQ<1, spacedim>(degree) +FE_TraceQ<1, spacedim>::FE_TraceQ(const unsigned int degree) + : FE_FaceQ<1, spacedim>(degree) {} diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index 6404f1f55b..f771601b65 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -139,10 +139,10 @@ namespace FEValuesViews { template Scalar::Scalar(const FEValuesBase &fe_values, - const unsigned int component) : - fe_values(&fe_values), - component(component), - shape_function_data(this->fe_values->fe->dofs_per_cell) + const unsigned int component) + : fe_values(&fe_values) + , component(component) + , shape_function_data(this->fe_values->fe->dofs_per_cell) { const FiniteElement &fe = *this->fe_values->fe; Assert(component < fe.n_components(), @@ -176,9 +176,9 @@ namespace FEValuesViews template - Scalar::Scalar() : - fe_values(nullptr), - component(numbers::invalid_unsigned_int) + Scalar::Scalar() + : fe_values(nullptr) + , component(numbers::invalid_unsigned_int) {} @@ -196,15 +196,16 @@ namespace FEValuesViews template Vector::Vector(const FEValuesBase &fe_values, - const unsigned int first_vector_component) : - fe_values(&fe_values), - first_vector_component(first_vector_component), - shape_function_data(this->fe_values->fe->dofs_per_cell) + const unsigned int first_vector_component) + : fe_values(&fe_values) + , first_vector_component(first_vector_component) + , shape_function_data(this->fe_values->fe->dofs_per_cell) { const FiniteElement &fe = *this->fe_values->fe; Assert(first_vector_component + spacedim - 1 < fe.n_components(), - ExcIndexRange( - first_vector_component + spacedim - 1, 0, fe.n_components())); + ExcIndexRange(first_vector_component + spacedim - 1, + 0, + fe.n_components())); // TODO: we'd like to use the fields with the same name as these // variables from FEValuesBase, but they aren't initialized yet @@ -267,9 +268,9 @@ namespace FEValuesViews template - Vector::Vector() : - fe_values(nullptr), - first_vector_component(numbers::invalid_unsigned_int) + Vector::Vector() + : fe_values(nullptr) + , first_vector_component(numbers::invalid_unsigned_int) {} @@ -288,10 +289,10 @@ namespace FEValuesViews template SymmetricTensor<2, dim, spacedim>::SymmetricTensor( const FEValuesBase &fe_values, - const unsigned int first_tensor_component) : - fe_values(&fe_values), - first_tensor_component(first_tensor_component), - shape_function_data(this->fe_values->fe->dofs_per_cell) + const unsigned int first_tensor_component) + : fe_values(&fe_values) + , first_tensor_component(first_tensor_component) + , shape_function_data(this->fe_values->fe->dofs_per_cell) { const FiniteElement &fe = *this->fe_values->fe; Assert(first_tensor_component + (dim * dim + dim) / 2 - 1 < @@ -368,9 +369,9 @@ namespace FEValuesViews template - SymmetricTensor<2, dim, spacedim>::SymmetricTensor() : - fe_values(nullptr), - first_tensor_component(numbers::invalid_unsigned_int) + SymmetricTensor<2, dim, spacedim>::SymmetricTensor() + : fe_values(nullptr) + , first_tensor_component(numbers::invalid_unsigned_int) {} @@ -389,15 +390,16 @@ namespace FEValuesViews template Tensor<2, dim, spacedim>::Tensor(const FEValuesBase &fe_values, - const unsigned int first_tensor_component) : - fe_values(&fe_values), - first_tensor_component(first_tensor_component), - shape_function_data(this->fe_values->fe->dofs_per_cell) + const unsigned int first_tensor_component) + : fe_values(&fe_values) + , first_tensor_component(first_tensor_component) + , shape_function_data(this->fe_values->fe->dofs_per_cell) { const FiniteElement &fe = *this->fe_values->fe; Assert(first_tensor_component + dim * dim - 1 < fe.n_components(), - ExcIndexRange( - first_tensor_component + dim * dim - 1, 0, fe.n_components())); + ExcIndexRange(first_tensor_component + dim * dim - 1, + 0, + fe.n_components())); // TODO: we'd like to use the fields with the same name as these // variables from FEValuesBase, but they aren't initialized yet // at the time we get here, so re-create it all @@ -459,9 +461,9 @@ namespace FEValuesViews template - Tensor<2, dim, spacedim>::Tensor() : - fe_values(nullptr), - first_tensor_component(numbers::invalid_unsigned_int) + Tensor<2, dim, spacedim>::Tensor() + : fe_values(nullptr) + , first_tensor_component(numbers::invalid_unsigned_int) {} @@ -2239,9 +2241,9 @@ namespace FEValuesViews Assert(fe_values->update_flags & update_hessians, (typename FEValuesBase::ExcAccessToUninitializedField( "update_hessians"))); - Assert( - laplacians.size() == fe_values->n_quadrature_points, - ExcDimensionMismatch(laplacians.size(), fe_values->n_quadrature_points)); + Assert(laplacians.size() == fe_values->n_quadrature_points, + ExcDimensionMismatch(laplacians.size(), + fe_values->n_quadrature_points)); Assert(fe_values->present_cell.get() != nullptr, ExcMessage("FEValues object is not reinit'ed to any cell")); Assert( @@ -2275,9 +2277,9 @@ namespace FEValuesViews Assert(fe_values->update_flags & update_hessians, (typename FEValuesBase::ExcAccessToUninitializedField( "update_hessians"))); - Assert( - laplacians.size() == fe_values->n_quadrature_points, - ExcDimensionMismatch(laplacians.size(), fe_values->n_quadrature_points)); + Assert(laplacians.size() == fe_values->n_quadrature_points, + ExcDimensionMismatch(laplacians.size(), + fe_values->n_quadrature_points)); Assert(fe_values->present_cell.get() != nullptr, ExcMessage("FEValues object is not reinit'ed to any cell")); AssertDimension(dof_values.size(), fe_values->dofs_per_cell); @@ -2886,8 +2888,8 @@ private: template template -FEValuesBase::CellIterator::CellIterator(const CI &cell) : - cell(cell) +FEValuesBase::CellIterator::CellIterator(const CI &cell) + : cell(cell) {} @@ -2951,8 +2953,8 @@ const char *const FEValuesBase FEValuesBase::TriaCellIterator::TriaCellIterator( - const typename Triangulation::cell_iterator &cell) : - cell(cell) + const typename Triangulation::cell_iterator &cell) + : cell(cell) {} @@ -3161,13 +3163,13 @@ FEValuesBase::FEValuesBase( const unsigned int dofs_per_cell, const UpdateFlags flags, const Mapping & mapping, - const FiniteElement &fe) : - n_quadrature_points(n_q_points), - dofs_per_cell(dofs_per_cell), - mapping(&mapping, typeid(*this).name()), - fe(&fe, typeid(*this).name()), - cell_similarity(CellSimilarity::Similarity::none), - fe_values_views_cache(*this) + const FiniteElement &fe) + : n_quadrature_points(n_q_points) + , dofs_per_cell(dofs_per_cell) + , mapping(&mapping, typeid(*this).name()) + , fe(&fe, typeid(*this).name()) + , cell_similarity(CellSimilarity::Similarity::none) + , fe_values_views_cache(*this) { Assert(n_q_points > 0, ExcMessage("There is nothing useful you can do with an FEValues " @@ -3252,8 +3254,9 @@ namespace internal typedef typename VectorType::value_type Number; // initialize with zero for (unsigned int i = 0; i < values.size(); ++i) - std::fill_n( - values[i].begin(), values[i].size(), typename VectorType::value_type()); + std::fill_n(values[i].begin(), + values[i].size(), + typename VectorType::value_type()); // see if there the current cell has DoFs at all, and if not // then there is nothing else to do. @@ -3666,8 +3669,9 @@ FEValuesBase::get_function_values( // get function values of dofs on this cell Vector dof_values(dofs_per_cell); present_cell->get_interpolated_dof_values(fe_function, dof_values); - internal::do_function_values( - dof_values.begin(), this->finite_element_output.shape_values, values); + internal::do_function_values(dof_values.begin(), + this->finite_element_output.shape_values, + values); } @@ -3689,8 +3693,9 @@ FEValuesBase::get_function_values( boost::container::small_vector dof_values(dofs_per_cell); for (unsigned int i = 0; i < dofs_per_cell; ++i) dof_values[i] = internal::get_vector_element(fe_function, indices[i]); - internal::do_function_values( - dof_values.data(), this->finite_element_output.shape_values, values); + internal::do_function_values(dof_values.data(), + this->finite_element_output.shape_values, + values); } @@ -3807,8 +3812,9 @@ FEValuesBase::get_function_gradients( // get function values of dofs on this cell Vector dof_values(dofs_per_cell); present_cell->get_interpolated_dof_values(fe_function, dof_values); - internal::do_function_derivatives( - dof_values.begin(), this->finite_element_output.shape_gradients, gradients); + internal::do_function_derivatives(dof_values.begin(), + this->finite_element_output.shape_gradients, + gradients); } @@ -3831,8 +3837,9 @@ FEValuesBase::get_function_gradients( boost::container::small_vector dof_values(dofs_per_cell); for (unsigned int i = 0; i < dofs_per_cell; ++i) dof_values[i] = internal::get_vector_element(fe_function, indices[i]); - internal::do_function_derivatives( - dof_values.data(), this->finite_element_output.shape_gradients, gradients); + internal::do_function_derivatives(dof_values.data(), + this->finite_element_output.shape_gradients, + gradients); } @@ -3919,8 +3926,9 @@ FEValuesBase::get_function_hessians( // get function values of dofs on this cell Vector dof_values(dofs_per_cell); present_cell->get_interpolated_dof_values(fe_function, dof_values); - internal::do_function_derivatives( - dof_values.begin(), this->finite_element_output.shape_hessians, hessians); + internal::do_function_derivatives(dof_values.begin(), + this->finite_element_output.shape_hessians, + hessians); } @@ -3943,8 +3951,9 @@ FEValuesBase::get_function_hessians( boost::container::small_vector dof_values(dofs_per_cell); for (unsigned int i = 0; i < dofs_per_cell; ++i) dof_values[i] = internal::get_vector_element(fe_function, indices[i]); - internal::do_function_derivatives( - dof_values.data(), this->finite_element_output.shape_hessians, hessians); + internal::do_function_derivatives(dof_values.data(), + this->finite_element_output.shape_hessians, + hessians); } @@ -4030,8 +4039,9 @@ FEValuesBase::get_function_laplacians( // get function values of dofs on this cell Vector dof_values(dofs_per_cell); present_cell->get_interpolated_dof_values(fe_function, dof_values); - internal::do_function_laplacians( - dof_values.begin(), this->finite_element_output.shape_hessians, laplacians); + internal::do_function_laplacians(dof_values.begin(), + this->finite_element_output.shape_hessians, + laplacians); } @@ -4053,8 +4063,9 @@ FEValuesBase::get_function_laplacians( boost::container::small_vector dof_values(dofs_per_cell); for (unsigned int i = 0; i < dofs_per_cell; ++i) dof_values[i] = internal::get_vector_element(fe_function, indices[i]); - internal::do_function_laplacians( - dof_values.data(), this->finite_element_output.shape_hessians, laplacians); + internal::do_function_laplacians(dof_values.data(), + this->finite_element_output.shape_hessians, + laplacians); } @@ -4484,13 +4495,13 @@ template FEValues::FEValues(const Mapping & mapping, const FiniteElement &fe, const Quadrature & q, - const UpdateFlags update_flags) : - FEValuesBase(q.size(), - fe.dofs_per_cell, - update_default, - mapping, - fe), - quadrature(q) + const UpdateFlags update_flags) + : FEValuesBase(q.size(), + fe.dofs_per_cell, + update_default, + mapping, + fe) + , quadrature(q) { initialize(update_flags); } @@ -4500,13 +4511,13 @@ FEValues::FEValues(const Mapping & mapping, template FEValues::FEValues(const FiniteElement &fe, const Quadrature & q, - const UpdateFlags update_flags) : - FEValuesBase(q.size(), - fe.dofs_per_cell, - update_default, - StaticMappingQ1::mapping, - fe), - quadrature(q) + const UpdateFlags update_flags) + : FEValuesBase(q.size(), + fe.dofs_per_cell, + update_default, + StaticMappingQ1::mapping, + fe) + , quadrature(q) { initialize(update_flags); } @@ -4532,8 +4543,9 @@ FEValues::initialize(const UpdateFlags update_flags) // initialize the base classes if (flags & update_mapping) this->mapping_output.initialize(this->n_quadrature_points, flags); - this->finite_element_output.initialize( - this->n_quadrature_points, *this->fe, flags); + this->finite_element_output.initialize(this->n_quadrature_points, + *this->fe, + flags); // then get objects into which the FE and the Mapping can store // intermediate data used across calls to reinit. we can do this in parallel @@ -4549,8 +4561,10 @@ FEValues::initialize(const UpdateFlags update_flags) std::unique_ptr::InternalDataBase>> mapping_get_data; if (flags & update_mapping) - mapping_get_data = Threads::new_task( - &Mapping::get_data, *this->mapping, flags, quadrature); + mapping_get_data = Threads::new_task(&Mapping::get_data, + *this->mapping, + flags, + quadrature); this->update_flags = flags; @@ -4699,14 +4713,14 @@ FEFaceValuesBase::FEFaceValuesBase( const UpdateFlags, const Mapping & mapping, const FiniteElement &fe, - const Quadrature & quadrature) : - FEValuesBase(n_q_points, - dofs_per_cell, - update_default, - mapping, - fe), - present_face_index(numbers::invalid_unsigned_int), - quadrature(quadrature) + const Quadrature & quadrature) + : FEValuesBase(n_q_points, + dofs_per_cell, + update_default, + mapping, + fe) + , present_face_index(numbers::invalid_unsigned_int) + , quadrature(quadrature) {} @@ -4749,13 +4763,13 @@ FEFaceValues::FEFaceValues( const Mapping & mapping, const FiniteElement &fe, const Quadrature & quadrature, - const UpdateFlags update_flags) : - FEFaceValuesBase(quadrature.size(), - fe.dofs_per_cell, - update_flags, - mapping, - fe, - quadrature) + const UpdateFlags update_flags) + : FEFaceValuesBase(quadrature.size(), + fe.dofs_per_cell, + update_flags, + mapping, + fe, + quadrature) { initialize(update_flags); } @@ -4766,13 +4780,13 @@ template FEFaceValues::FEFaceValues( const FiniteElement &fe, const Quadrature & quadrature, - const UpdateFlags update_flags) : - FEFaceValuesBase(quadrature.size(), - fe.dofs_per_cell, - update_flags, - StaticMappingQ1::mapping, - fe, - quadrature) + const UpdateFlags update_flags) + : FEFaceValuesBase(quadrature.size(), + fe.dofs_per_cell, + update_flags, + StaticMappingQ1::mapping, + fe, + quadrature) { initialize(update_flags); } @@ -4788,8 +4802,9 @@ FEFaceValues::initialize(const UpdateFlags update_flags) // initialize the base classes if (flags & update_mapping) this->mapping_output.initialize(this->n_quadrature_points, flags); - this->finite_element_output.initialize( - this->n_quadrature_points, *this->fe, flags); + this->finite_element_output.initialize(this->n_quadrature_points, + *this->fe, + flags); // then get objects into which the FE and the Mapping can store // intermediate data used across calls to reinit. this can be done in parallel @@ -4924,13 +4939,13 @@ FESubfaceValues::FESubfaceValues( const Mapping & mapping, const FiniteElement &fe, const Quadrature & quadrature, - const UpdateFlags update_flags) : - FEFaceValuesBase(quadrature.size(), - fe.dofs_per_cell, - update_flags, - mapping, - fe, - quadrature) + const UpdateFlags update_flags) + : FEFaceValuesBase(quadrature.size(), + fe.dofs_per_cell, + update_flags, + mapping, + fe, + quadrature) { initialize(update_flags); } @@ -4941,13 +4956,13 @@ template FESubfaceValues::FESubfaceValues( const FiniteElement &fe, const Quadrature & quadrature, - const UpdateFlags update_flags) : - FEFaceValuesBase(quadrature.size(), - fe.dofs_per_cell, - update_flags, - StaticMappingQ1::mapping, - fe, - quadrature) + const UpdateFlags update_flags) + : FEFaceValuesBase(quadrature.size(), + fe.dofs_per_cell, + update_flags, + StaticMappingQ1::mapping, + fe, + quadrature) { initialize(update_flags); } @@ -4963,8 +4978,9 @@ FESubfaceValues::initialize(const UpdateFlags update_flags) // initialize the base classes if (flags & update_mapping) this->mapping_output.initialize(this->n_quadrature_points, flags); - this->finite_element_output.initialize( - this->n_quadrature_points, *this->fe, flags); + this->finite_element_output.initialize(this->n_quadrature_points, + *this->fe, + flags); // then get objects into which the FE and the Mapping can store // intermediate data used across calls to reinit. this can be done @@ -5021,14 +5037,16 @@ FESubfaceValues::reinit( // but unfortunately the current function is also called for // faces without children (see tests/fe/mapping.cc). Therefore, // we must use following workaround of two separate assertions - Assert( - cell->face(face_no)->has_children() || - subface_no < GeometryInfo::max_children_per_face, - ExcIndexRange(subface_no, 0, GeometryInfo::max_children_per_face)); - Assert( - !cell->face(face_no)->has_children() || - subface_no < cell->face(face_no)->number_of_children(), - ExcIndexRange(subface_no, 0, cell->face(face_no)->number_of_children())); + Assert(cell->face(face_no)->has_children() || + subface_no < GeometryInfo::max_children_per_face, + ExcIndexRange(subface_no, + 0, + GeometryInfo::max_children_per_face)); + Assert(!cell->face(face_no)->has_children() || + subface_no < cell->face(face_no)->number_of_children(), + ExcIndexRange(subface_no, + 0, + cell->face(face_no)->number_of_children())); Assert(cell->has_children() == false, ExcMessage("You can't use subface data for cells that are " "already refined. Iterate over their children " diff --git a/source/fe/fe_values.decl.1.inst.in b/source/fe/fe_values.decl.1.inst.in index d6be7f73a1..870ea97642 100644 --- a/source/fe/fe_values.decl.1.inst.in +++ b/source/fe/fe_values.decl.1.inst.in @@ -24,6 +24,7 @@ for (VEC : VECTOR_TYPES) /// @p get_interpolated_dof_values /// of the iterator with the /// given arguments. - virtual void get_interpolated_dof_values( - const VEC &in, Vector &out) const = 0; + virtual void get_interpolated_dof_values(const VEC & in, + Vector &out) + const = 0; } diff --git a/source/fe/fe_values.decl.2.inst.in b/source/fe/fe_values.decl.2.inst.in index d0633b14a5..525c6359e1 100644 --- a/source/fe/fe_values.decl.2.inst.in +++ b/source/fe/fe_values.decl.2.inst.in @@ -24,6 +24,7 @@ for (VEC : VECTOR_TYPES) /// @p get_interpolated_dof_values /// of the iterator with the /// given arguments. - virtual void get_interpolated_dof_values( - const VEC &in, Vector &out) const override; + virtual void get_interpolated_dof_values(const VEC & in, + Vector &out) + const override; } diff --git a/source/fe/fe_values.inst.in b/source/fe/fe_values.inst.in index 742db05a80..de6b29f4cf 100644 --- a/source/fe/fe_values.inst.in +++ b/source/fe/fe_values.inst.in @@ -443,8 +443,9 @@ for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS; std::vector &) const; template void FEValuesBase:: - get_function_laplacians( - const VEC &, std::vector> &) const; + get_function_laplacians(const VEC &, + std::vector> &) + const; template void FEValuesBase:: get_function_laplacians( @@ -650,8 +651,9 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : DIMENSIONS) std::vector &) const; template void FEValuesBase:: - get_function_values( - const IndexSet &, std::vector> &) const; + get_function_values(const IndexSet &, + std::vector> &) + const; template void FEValuesBase:: get_function_values( @@ -723,8 +725,9 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : DIMENSIONS) bool) const; template void FEValuesBase:: - get_function_laplacians( - const IndexSet &, std::vector &) const; + get_function_laplacians(const IndexSet &, + std::vector &) + const; template void FEValuesBase:: get_function_laplacians( const IndexSet &, diff --git a/source/fe/mapping.cc b/source/fe/mapping.cc index ec816a7112..11da97210d 100644 --- a/source/fe/mapping.cc +++ b/source/fe/mapping.cc @@ -75,8 +75,8 @@ Mapping::project_real_point_to_unit_point_on_face( template -Mapping::InternalDataBase::InternalDataBase() : - update_each(update_default) +Mapping::InternalDataBase::InternalDataBase() + : update_each(update_default) {} diff --git a/source/fe/mapping_c1.cc b/source/fe/mapping_c1.cc index 47f2ed6c1b..82dbfd2191 100644 --- a/source/fe/mapping_c1.cc +++ b/source/fe/mapping_c1.cc @@ -28,14 +28,15 @@ DEAL_II_NAMESPACE_OPEN template -MappingC1::MappingC1Generic::MappingC1Generic() : - MappingQGeneric(3) +MappingC1::MappingC1Generic::MappingC1Generic() + : MappingQGeneric(3) {} template -MappingC1::MappingC1() : MappingQ(3) +MappingC1::MappingC1() + : MappingQ(3) { Assert(dim > 1, ExcImpossibleInDim(dim)); diff --git a/source/fe/mapping_cartesian.cc b/source/fe/mapping_cartesian.cc index 698e3386f9..aad2315648 100644 --- a/source/fe/mapping_cartesian.cc +++ b/source/fe/mapping_cartesian.cc @@ -45,10 +45,10 @@ const unsigned int MappingCartesian::invalid_face_number; template MappingCartesian::InternalData::InternalData( - const Quadrature &q) : - cell_extents(numbers::signaling_nan>()), - volume_element(numbers::signaling_nan()), - quadrature_points(q.get_points()) + const Quadrature &q) + : cell_extents(numbers::signaling_nan>()) + , volume_element(numbers::signaling_nan()) + , quadrature_points(q.get_points()) {} @@ -187,11 +187,12 @@ MappingCartesian::compute_fill( // tests/fe/mapping.cc). Therefore, // we must use following workaround // of two separate assertions - Assert( - (sub_no == invalid_face_number) || - cell->face(face_no)->has_children() || - (sub_no + 1 < GeometryInfo::max_children_per_face + 1), - ExcIndexRange(sub_no, 0, GeometryInfo::max_children_per_face)); + Assert((sub_no == invalid_face_number) || + cell->face(face_no)->has_children() || + (sub_no + 1 < GeometryInfo::max_children_per_face + 1), + ExcIndexRange(sub_no, + 0, + GeometryInfo::max_children_per_face)); Assert((sub_no == invalid_face_number) || !cell->face(face_no)->has_children() || (sub_no < cell->face(face_no)->n_children()), @@ -289,8 +290,9 @@ MappingCartesian::compute_fill( { static const Point normals[GeometryInfo<1>::faces_per_cell] = {Point(-1.), Point(1.)}; - std::fill( - normal_vectors.begin(), normal_vectors.end(), normals[face_no]); + std::fill(normal_vectors.begin(), + normal_vectors.end(), + normals[face_no]); break; } @@ -301,8 +303,9 @@ MappingCartesian::compute_fill( Point(1, 0), Point(0, -1), Point(0, 1)}; - std::fill( - normal_vectors.begin(), normal_vectors.end(), normals[face_no]); + std::fill(normal_vectors.begin(), + normal_vectors.end(), + normals[face_no]); break; } @@ -315,8 +318,9 @@ MappingCartesian::compute_fill( Point(0, 1, 0), Point(0, 0, -1), Point(0, 0, 1)}; - std::fill( - normal_vectors.begin(), normal_vectors.end(), normals[face_no]); + std::fill(normal_vectors.begin(), + normal_vectors.end(), + normals[face_no]); break; } diff --git a/source/fe/mapping_fe_field.cc b/source/fe/mapping_fe_field.cc index 4e49643f2c..199e98fa18 100644 --- a/source/fe/mapping_fe_field.cc +++ b/source/fe/mapping_fe_field.cc @@ -61,12 +61,12 @@ DEAL_II_NAMESPACE_OPEN template MappingFEField::InternalData:: InternalData(const FiniteElement &fe, - const ComponentMask & mask) : - unit_tangentials(), - n_shape_functions(fe.dofs_per_cell), - mask(mask), - local_dof_indices(fe.dofs_per_cell), - local_dof_values(fe.dofs_per_cell) + const ComponentMask & mask) + : unit_tangentials() + , n_shape_functions(fe.dofs_per_cell) + , mask(mask) + , local_dof_indices(fe.dofs_per_cell) + , local_dof_values(fe.dofs_per_cell) {} @@ -89,8 +89,9 @@ MappingFEField::InternalData::shape( const unsigned int shape_nr) { Assert(qpoint * n_shape_functions + shape_nr < shape_values.size(), - ExcIndexRange( - qpoint * n_shape_functions + shape_nr, 0, shape_values.size())); + ExcIndexRange(qpoint * n_shape_functions + shape_nr, + 0, + shape_values.size())); return shape_values[qpoint * n_shape_functions + shape_nr]; } @@ -101,8 +102,9 @@ MappingFEField::InternalData:: derivative(const unsigned int qpoint, const unsigned int shape_nr) const { Assert(qpoint * n_shape_functions + shape_nr < shape_derivatives.size(), - ExcIndexRange( - qpoint * n_shape_functions + shape_nr, 0, shape_derivatives.size())); + ExcIndexRange(qpoint * n_shape_functions + shape_nr, + 0, + shape_derivatives.size())); return shape_derivatives[qpoint * n_shape_functions + shape_nr]; } @@ -114,8 +116,9 @@ MappingFEField::InternalData:: derivative(const unsigned int qpoint, const unsigned int shape_nr) { Assert(qpoint * n_shape_functions + shape_nr < shape_derivatives.size(), - ExcIndexRange( - qpoint * n_shape_functions + shape_nr, 0, shape_derivatives.size())); + ExcIndexRange(qpoint * n_shape_functions + shape_nr, + 0, + shape_derivatives.size())); return shape_derivatives[qpoint * n_shape_functions + shape_nr]; } @@ -234,18 +237,18 @@ template MappingFEField::MappingFEField( const DoFHandlerType &euler_dof_handler, const VectorType & euler_vector, - const ComponentMask & mask) : - euler_vector(&euler_vector), - euler_dof_handler(&euler_dof_handler), - fe_mask( - mask.size() ? - mask : - ComponentMask(euler_dof_handler.get_fe().get_nonzero_components(0).size(), - true)), - fe_to_real(fe_mask.size(), numbers::invalid_unsigned_int), - fe_values(this->euler_dof_handler->get_fe(), - get_vertex_quadrature(), - update_values) + const ComponentMask & mask) + : euler_vector(&euler_vector) + , euler_dof_handler(&euler_dof_handler) + , fe_mask(mask.size() ? + mask : + ComponentMask( + euler_dof_handler.get_fe().get_nonzero_components(0).size(), + true)) + , fe_to_real(fe_mask.size(), numbers::invalid_unsigned_int) + , fe_values(this->euler_dof_handler->get_fe(), + get_vertex_quadrature(), + update_values) { unsigned int size = 0; for (unsigned int i = 0; i < fe_mask.size(); ++i) @@ -259,14 +262,14 @@ MappingFEField::MappingFEField( template MappingFEField::MappingFEField( - const MappingFEField &mapping) : - euler_vector(mapping.euler_vector), - euler_dof_handler(mapping.euler_dof_handler), - fe_mask(mapping.fe_mask), - fe_to_real(mapping.fe_to_real), - fe_values(mapping.euler_dof_handler->get_fe(), - get_vertex_quadrature(), - update_values) + const MappingFEField &mapping) + : euler_vector(mapping.euler_vector) + , euler_dof_handler(mapping.euler_dof_handler) + , fe_mask(mapping.fe_mask) + , fe_to_real(mapping.fe_to_real) + , fe_values(mapping.euler_dof_handler->get_fe(), + get_vertex_quadrature(), + update_values) {} @@ -278,8 +281,9 @@ MappingFEField::InternalData::shape( const unsigned int shape_nr) const { Assert(qpoint * n_shape_functions + shape_nr < shape_values.size(), - ExcIndexRange( - qpoint * n_shape_functions + shape_nr, 0, shape_values.size())); + ExcIndexRange(qpoint * n_shape_functions + shape_nr, + 0, + shape_values.size())); return shape_values[qpoint * n_shape_functions + shape_nr]; } @@ -1574,10 +1578,10 @@ MappingFEField::fill_fe_values( { AssertDimension(output_data.JxW_values.size(), n_q_points); - Assert( - !(update_flags & update_normal_vectors) || - (output_data.normal_vectors.size() == n_q_points), - ExcDimensionMismatch(output_data.normal_vectors.size(), n_q_points)); + Assert(!(update_flags & update_normal_vectors) || + (output_data.normal_vectors.size() == n_q_points), + ExcDimensionMismatch(output_data.normal_vectors.size(), + n_q_points)); if (cell_similarity != CellSimilarity::translation) @@ -1627,9 +1631,9 @@ MappingFEField::fill_fe_values( { if (update_flags & update_normal_vectors) { - Assert( - spacedim - dim == 1, - ExcMessage("There is no cell normal in codim 2.")); + Assert(spacedim - dim == 1, + ExcMessage( + "There is no cell normal in codim 2.")); if (dim == 1) output_data.normal_vectors[point] = @@ -1818,14 +1822,14 @@ MappingFEField:: cell, face_no, numbers::invalid_unsigned_int, - QProjector::DataSetDescriptor::subface( - face_no, - subface_no, - cell->face_orientation(face_no), - cell->face_flip(face_no), - cell->face_rotation(face_no), - quadrature.size(), - cell->subface_case(face_no)), + QProjector::DataSetDescriptor::subface(face_no, + subface_no, + cell->face_orientation( + face_no), + cell->face_flip(face_no), + cell->face_rotation(face_no), + quadrature.size(), + cell->subface_case(face_no)), quadrature, data, euler_dof_handler->get_fe(), @@ -1989,8 +1993,10 @@ MappingFEField::transform( AssertDimension(input.size(), output.size()); internal::MappingFEFieldImplementation:: - transform_fields( - input, mapping_type, mapping_data, output); + transform_fields(input, + mapping_type, + mapping_data, + output); } @@ -2181,8 +2187,10 @@ MappingFEField:: update_internal_dofs(cell, dynamic_cast(*mdata)); - return do_transform_real_to_unit_cell( - cell, p, initial_p_unit, dynamic_cast(*mdata)); + return do_transform_real_to_unit_cell(cell, + p, + initial_p_unit, + dynamic_cast(*mdata)); } @@ -2340,8 +2348,9 @@ MappingFEField::update_internal_dofs( dof_cell->get_dof_indices(data.local_dof_indices); for (unsigned int i = 0; i < data.local_dof_values.size(); ++i) - data.local_dof_values[i] = internal::ElementAccess::get( - *euler_vector, data.local_dof_indices[i]); + data.local_dof_values[i] = + internal::ElementAccess::get(*euler_vector, + data.local_dof_indices[i]); } // explicit instantiations diff --git a/source/fe/mapping_manifold.cc b/source/fe/mapping_manifold.cc index aa55d28352..9a1b91e267 100644 --- a/source/fe/mapping_manifold.cc +++ b/source/fe/mapping_manifold.cc @@ -442,10 +442,10 @@ namespace internal { const Point ei = Point::unit_vector(i); const double pi = p[i]; - Assert( - pi >= 0 && pi <= 1.0, - ExcInternalError("Was expecting a quadrature point " - "inside the unit reference element.")); + Assert(pi >= 0 && pi <= 1.0, + ExcInternalError( + "Was expecting a quadrature point " + "inside the unit reference element.")); // In the length L, we store also the direction sign, // which is positive, if the coordinate is < .5, @@ -537,10 +537,10 @@ MappingManifold::fill_fe_values( { AssertDimension(output_data.JxW_values.size(), n_q_points); - Assert( - !(update_flags & update_normal_vectors) || - (output_data.normal_vectors.size() == n_q_points), - ExcDimensionMismatch(output_data.normal_vectors.size(), n_q_points)); + Assert(!(update_flags & update_normal_vectors) || + (output_data.normal_vectors.size() == n_q_points), + ExcDimensionMismatch(output_data.normal_vectors.size(), + n_q_points)); for (unsigned int point = 0; point < n_q_points; ++point) @@ -589,15 +589,15 @@ MappingManifold::fill_fe_values( { if (update_flags & update_normal_vectors) { - Assert( - spacedim == dim + 1, - ExcMessage("There is no (unique) cell normal for " + - Utilities::int_to_string(dim) + - "-dimensional cells in " + - Utilities::int_to_string(spacedim) + - "-dimensional space. This only works if the " - "space dimension is one greater than the " - "dimensionality of the mesh cells.")); + Assert(spacedim == dim + 1, + ExcMessage( + "There is no (unique) cell normal for " + + Utilities::int_to_string(dim) + + "-dimensional cells in " + + Utilities::int_to_string(spacedim) + + "-dimensional space. This only works if the " + "space dimension is one greater than the " + "dimensionality of the mesh cells.")); if (dim == 1) output_data.normal_vectors[point] = @@ -846,8 +846,9 @@ namespace internal data.manifold = &cell->face(face_no)->get_manifold(); - maybe_compute_q_points( - data_set, data, output_data.quadrature_points); + maybe_compute_q_points(data_set, + data, + output_data.quadrature_points); maybe_update_Jacobians(data_set, data); maybe_compute_face_data(mapping, @@ -869,10 +870,10 @@ namespace internal const ArrayView> & output) { AssertDimension(input.size(), output.size()); - Assert( - (dynamic_cast:: - InternalData *>(&mapping_data) != nullptr), - ExcInternalError()); + Assert((dynamic_cast::InternalData *>( + &mapping_data) != nullptr), + ExcInternalError()); const typename dealii::MappingManifold::InternalData &data = static_cast:: @@ -947,10 +948,10 @@ namespace internal const ArrayView> & output) { AssertDimension(input.size(), output.size()); - Assert( - (dynamic_cast:: - InternalData *>(&mapping_data) != nullptr), - ExcInternalError()); + Assert((dynamic_cast::InternalData *>( + &mapping_data) != nullptr), + ExcInternalError()); const typename dealii::MappingManifold::InternalData &data = static_cast:: @@ -972,8 +973,9 @@ namespace internal for (unsigned int i = 0; i < output.size(); ++i) { - DerivativeForm<1, spacedim, dim> A = apply_transformation( - data.contravariant[i], transpose(input[i])); + DerivativeForm<1, spacedim, dim> A = + apply_transformation(data.contravariant[i], + transpose(input[i])); output[i] = apply_transformation(data.covariant[i], A.transpose()); } @@ -991,8 +993,9 @@ namespace internal for (unsigned int i = 0; i < output.size(); ++i) { - DerivativeForm<1, spacedim, dim> A = apply_transformation( - data.covariant[i], transpose(input[i])); + DerivativeForm<1, spacedim, dim> A = + apply_transformation(data.covariant[i], + transpose(input[i])); output[i] = apply_transformation(data.covariant[i], A.transpose()); } @@ -1020,8 +1023,9 @@ namespace internal { DerivativeForm<1, spacedim, dim> A = apply_transformation(data.covariant[i], input[i]); - Tensor<2, spacedim> T = apply_transformation( - data.contravariant[i], A.transpose()); + Tensor<2, spacedim> T = + apply_transformation(data.contravariant[i], + A.transpose()); output[i] = transpose(T); output[i] /= data.volume_elements[i]; @@ -1046,10 +1050,10 @@ namespace internal const ArrayView> & output) { AssertDimension(input.size(), output.size()); - Assert( - (dynamic_cast:: - InternalData *>(&mapping_data) != nullptr), - ExcInternalError()); + Assert((dynamic_cast::InternalData *>( + &mapping_data) != nullptr), + ExcInternalError()); const typename dealii::MappingManifold::InternalData &data = static_cast:: @@ -1215,10 +1219,10 @@ namespace internal const ArrayView> & output) { AssertDimension(input.size(), output.size()); - Assert( - (dynamic_cast:: - InternalData *>(&mapping_data) != nullptr), - ExcInternalError()); + Assert((dynamic_cast::InternalData *>( + &mapping_data) != nullptr), + ExcInternalError()); const typename dealii::MappingManifold::InternalData &data = static_cast:: @@ -1323,8 +1327,10 @@ MappingManifold::transform( const typename Mapping::InternalDataBase &mapping_data, const ArrayView> & output) const { - internal::MappingManifoldImplementation::transform_fields( - input, mapping_type, mapping_data, output); + internal::MappingManifoldImplementation::transform_fields(input, + mapping_type, + mapping_data, + output); } @@ -1354,8 +1360,10 @@ MappingManifold::transform( switch (mapping_type) { case mapping_contravariant: - internal::MappingManifoldImplementation::transform_fields( - input, mapping_type, mapping_data, output); + internal::MappingManifoldImplementation::transform_fields(input, + mapping_type, + mapping_data, + output); return; case mapping_piola_gradient: diff --git a/source/fe/mapping_q.cc b/source/fe/mapping_q.cc index e8d711b15d..661c7286f2 100644 --- a/source/fe/mapping_q.cc +++ b/source/fe/mapping_q.cc @@ -39,8 +39,8 @@ DEAL_II_NAMESPACE_OPEN template -MappingQ::InternalData::InternalData() : - use_mapping_q1_on_current_cell(false) +MappingQ::InternalData::InternalData() + : use_mapping_q1_on_current_cell(false) {} @@ -60,8 +60,9 @@ MappingQ::InternalData::memory_consumption() const template MappingQ::MappingQ(const unsigned int degree, - const bool use_mapping_q_on_all_cells) : - polynomial_degree(degree), + const bool use_mapping_q_on_all_cells) + : polynomial_degree(degree) + , // see whether we want to use *this* mapping objects on *all* cells, // or defer to an explicit Q1 mapping on interior cells. if @@ -69,10 +70,12 @@ MappingQ::MappingQ(const unsigned int degree, // it; if dim!=spacedim, there is also no need for anything because // we're most likely on a curved manifold use_mapping_q_on_all_cells(degree == 1 || use_mapping_q_on_all_cells || - (dim != spacedim)), + (dim != spacedim)) + , // create a Q1 mapping for use on interior cells (if necessary) // or to create a good initial guess in transform_real_to_unit_cell() - q1_mapping(std::make_shared>(1)), + q1_mapping(std::make_shared>(1)) + , // create a Q_p mapping; if p=1, simply share the Q_1 mapping already // created via the shared_ptr objects @@ -84,9 +87,9 @@ MappingQ::MappingQ(const unsigned int degree, template -MappingQ::MappingQ(const MappingQ &mapping) : - polynomial_degree(mapping.polynomial_degree), - use_mapping_q_on_all_cells(mapping.use_mapping_q_on_all_cells) +MappingQ::MappingQ(const MappingQ &mapping) + : polynomial_degree(mapping.polynomial_degree) + , use_mapping_q_on_all_cells(mapping.use_mapping_q_on_all_cells) { // Note that we really do have to use clone() here, since mapping.q1_mapping // may be MappingQ1Eulerian and mapping.qp_mapping may be MappingQEulerian. diff --git a/source/fe/mapping_q1.cc b/source/fe/mapping_q1.cc index 7e29f42dc0..698bfcfafc 100644 --- a/source/fe/mapping_q1.cc +++ b/source/fe/mapping_q1.cc @@ -45,7 +45,8 @@ DEAL_II_NAMESPACE_OPEN template -MappingQ1::MappingQ1() : MappingQGeneric(1) +MappingQ1::MappingQ1() + : MappingQGeneric(1) {} diff --git a/source/fe/mapping_q1_eulerian.cc b/source/fe/mapping_q1_eulerian.cc index 46c0e30f24..d7f10d1427 100644 --- a/source/fe/mapping_q1_eulerian.cc +++ b/source/fe/mapping_q1_eulerian.cc @@ -41,10 +41,10 @@ DEAL_II_NAMESPACE_OPEN template MappingQ1Eulerian::MappingQ1Eulerian( const DoFHandler &shiftmap_dof_handler, - const VectorType & euler_transform_vectors) : - MappingQGeneric(1), - euler_transform_vectors(&euler_transform_vectors), - shiftmap_dof_handler(&shiftmap_dof_handler) + const VectorType & euler_transform_vectors) + : MappingQGeneric(1) + , euler_transform_vectors(&euler_transform_vectors) + , shiftmap_dof_handler(&shiftmap_dof_handler) {} diff --git a/source/fe/mapping_q_eulerian.cc b/source/fe/mapping_q_eulerian.cc index fbbf6fa925..ac2eb9afd5 100644 --- a/source/fe/mapping_q_eulerian.cc +++ b/source/fe/mapping_q_eulerian.cc @@ -47,13 +47,13 @@ template MappingQEulerian::MappingQEulerianGeneric:: MappingQEulerianGeneric( const unsigned int degree, - const MappingQEulerian &mapping_q_eulerian) : - MappingQGeneric(degree), - mapping_q_eulerian(mapping_q_eulerian), - support_quadrature(degree), - fe_values(mapping_q_eulerian.euler_dof_handler->get_fe(), - support_quadrature, - update_values | update_quadrature_points) + const MappingQEulerian &mapping_q_eulerian) + : MappingQGeneric(degree) + , mapping_q_eulerian(mapping_q_eulerian) + , support_quadrature(degree) + , fe_values(mapping_q_eulerian.euler_dof_handler->get_fe(), + support_quadrature, + update_values | update_quadrature_points) {} @@ -63,11 +63,11 @@ MappingQEulerian::MappingQEulerian( const unsigned int degree, const DoFHandler &euler_dof_handler, const VectorType & euler_vector, - const unsigned int level) : - MappingQ(degree, true), - euler_vector(&euler_vector), - euler_dof_handler(&euler_dof_handler), - level(level) + const unsigned int level) + : MappingQ(degree, true) + , euler_vector(&euler_vector) + , euler_dof_handler(&euler_dof_handler) + , level(level) { // reset the q1 mapping we use for interior cells (and previously // set by the MappingQ constructor) to a MappingQ1Eulerian with the @@ -96,8 +96,8 @@ MappingQEulerian::clone() const template MappingQEulerian::MappingQEulerianGeneric:: - SupportQuadrature::SupportQuadrature(const unsigned int map_degree) : - Quadrature(Utilities::fixed_power(map_degree + 1)) + SupportQuadrature::SupportQuadrature(const unsigned int map_degree) + : Quadrature(Utilities::fixed_power(map_degree + 1)) { // first we determine the support points on the unit cell in lexicographic // order, which are (in accordance with MappingQ) the support points of @@ -226,8 +226,9 @@ MappingQEulerian::MappingQEulerianGeneric:: if (mg_vector) { dof_cell->get_mg_dof_indices(dof_indices); - fe_values.get_function_values( - *mapping_q_eulerian.euler_vector, dof_indices, shift_vector); + fe_values.get_function_values(*mapping_q_eulerian.euler_vector, + dof_indices, + shift_vector); } else fe_values.get_function_values(*mapping_q_eulerian.euler_vector, diff --git a/source/fe/mapping_q_generic.cc b/source/fe/mapping_q_generic.cc index 6c5d1ae255..a991eacd2b 100644 --- a/source/fe/mapping_q_generic.cc +++ b/source/fe/mapping_q_generic.cc @@ -648,11 +648,11 @@ namespace internal template MappingQGeneric::InternalData::InternalData( - const unsigned int polynomial_degree) : - polynomial_degree(polynomial_degree), - n_shape_functions(Utilities::fixed_power(polynomial_degree + 1)), - line_support_points(QGaussLobatto<1>(polynomial_degree + 1)), - tensor_product_quadrature(false) + const unsigned int polynomial_degree) + : polynomial_degree(polynomial_degree) + , n_shape_functions(Utilities::fixed_power(polynomial_degree + 1)) + , line_support_points(QGaussLobatto<1>(polynomial_degree + 1)) + , tensor_product_quadrature(false) {} @@ -1133,8 +1133,9 @@ namespace internal GeometryInfo<1>::vertices_per_cell); for (unsigned int q = 0; q < polynomial_degree - 1; ++q) for (unsigned int i = 0; i < GeometryInfo<1>::vertices_per_cell; ++i) - output[0](q, i) = GeometryInfo<1>::d_linear_shape_function( - quadrature.point(q + 1), i); + output[0](q, i) = + GeometryInfo<1>::d_linear_shape_function(quadrature.point(q + 1), + i); if (dim > 1) output[1] = compute_support_point_weights_on_quad(polynomial_degree); @@ -2254,18 +2255,18 @@ namespace internal template -MappingQGeneric::MappingQGeneric(const unsigned int p) : - polynomial_degree(p), - line_support_points(this->polynomial_degree + 1), - fe_q(dim == 3 ? new FE_Q(this->polynomial_degree) : nullptr), - support_point_weights_perimeter_to_interior( - internal::MappingQGenericImplementation:: - compute_support_point_weights_perimeter_to_interior( - this->polynomial_degree, - dim)), - support_point_weights_cell( - internal::MappingQGenericImplementation::compute_support_point_weights_cell< - dim>(this->polynomial_degree)) +MappingQGeneric::MappingQGeneric(const unsigned int p) + : polynomial_degree(p) + , line_support_points(this->polynomial_degree + 1) + , fe_q(dim == 3 ? new FE_Q(this->polynomial_degree) : nullptr) + , support_point_weights_perimeter_to_interior( + internal::MappingQGenericImplementation:: + compute_support_point_weights_perimeter_to_interior( + this->polynomial_degree, + dim)) + , support_point_weights_cell( + internal::MappingQGenericImplementation:: + compute_support_point_weights_cell(this->polynomial_degree)) { Assert(p >= 1, ExcMessage("It only makes sense to create polynomial mappings " @@ -2276,13 +2277,13 @@ MappingQGeneric::MappingQGeneric(const unsigned int p) : template MappingQGeneric::MappingQGeneric( - const MappingQGeneric &mapping) : - polynomial_degree(mapping.polynomial_degree), - line_support_points(mapping.line_support_points), - fe_q(dim == 3 ? new FE_Q(*mapping.fe_q) : nullptr), - support_point_weights_perimeter_to_interior( - mapping.support_point_weights_perimeter_to_interior), - support_point_weights_cell(mapping.support_point_weights_cell) + const MappingQGeneric &mapping) + : polynomial_degree(mapping.polynomial_degree) + , line_support_points(mapping.line_support_points) + , fe_q(dim == 3 ? new FE_Q(*mapping.fe_q) : nullptr) + , support_point_weights_perimeter_to_interior( + mapping.support_point_weights_perimeter_to_interior) + , support_point_weights_cell(mapping.support_point_weights_cell) {} @@ -2473,8 +2474,10 @@ MappingQGeneric<1, 2>::transform_real_to_unit_cell_internal( // dispatch to the various specializations for spacedim=dim, // spacedim=dim+1, etc return internal::MappingQGenericImplementation:: - do_transform_real_to_unit_cell_internal_codim1<1>( - cell, p, initial_p_unit, *mdata); + do_transform_real_to_unit_cell_internal_codim1<1>(cell, + p, + initial_p_unit, + *mdata); } @@ -2502,8 +2505,10 @@ MappingQGeneric<2, 3>::transform_real_to_unit_cell_internal( // dispatch to the various specializations for spacedim=dim, // spacedim=dim+1, etc return internal::MappingQGenericImplementation:: - do_transform_real_to_unit_cell_internal_codim1<2>( - cell, p, initial_p_unit, *mdata); + do_transform_real_to_unit_cell_internal_codim1<2>(cell, + p, + initial_p_unit, + *mdata); } template <> @@ -2647,8 +2652,9 @@ MappingQGeneric::transform_real_to_unit_cell( // perform the Newton iteration and return the result. note that this // statement may throw an exception, which we simply pass up to the // caller - return this->transform_real_to_unit_cell_internal( - cell, p, initial_p_unit); + return this->transform_real_to_unit_cell_internal(cell, + p, + initial_p_unit); } } @@ -2816,12 +2822,12 @@ MappingQGeneric::fill_fe_values( QProjector::DataSetDescriptor::cell(), data); - internal::MappingQGenericImplementation:: - maybe_update_jacobian_grads( - computed_cell_similarity, - QProjector::DataSetDescriptor::cell(), - data, - output_data.jacobian_grads); + internal::MappingQGenericImplementation::maybe_update_jacobian_grads< + dim, + spacedim>(computed_cell_similarity, + QProjector::DataSetDescriptor::cell(), + data, + output_data.jacobian_grads); } internal::MappingQGenericImplementation:: @@ -2869,10 +2875,10 @@ MappingQGeneric::fill_fe_values( { AssertDimension(output_data.JxW_values.size(), n_q_points); - Assert( - !(update_flags & update_normal_vectors) || - (output_data.normal_vectors.size() == n_q_points), - ExcDimensionMismatch(output_data.normal_vectors.size(), n_q_points)); + Assert(!(update_flags & update_normal_vectors) || + (output_data.normal_vectors.size() == n_q_points), + ExcDimensionMismatch(output_data.normal_vectors.size(), + n_q_points)); if (computed_cell_similarity != CellSimilarity::translation) @@ -3190,8 +3196,9 @@ namespace internal { maybe_compute_q_points( data_set, data, output_data.quadrature_points); - maybe_update_Jacobians( - CellSimilarity::none, data_set, data); + maybe_update_Jacobians(CellSimilarity::none, + data_set, + data); maybe_update_jacobian_grads( CellSimilarity::none, data_set, data, output_data.jacobian_grads); } @@ -3344,10 +3351,10 @@ namespace internal const ArrayView> & output) { AssertDimension(input.size(), output.size()); - Assert( - (dynamic_cast:: - InternalData *>(&mapping_data) != nullptr), - ExcInternalError()); + Assert((dynamic_cast::InternalData *>( + &mapping_data) != nullptr), + ExcInternalError()); const typename dealii::MappingQGeneric::InternalData &data = static_cast:: @@ -3422,10 +3429,10 @@ namespace internal const ArrayView> & output) { AssertDimension(input.size(), output.size()); - Assert( - (dynamic_cast:: - InternalData *>(&mapping_data) != nullptr), - ExcInternalError()); + Assert((dynamic_cast::InternalData *>( + &mapping_data) != nullptr), + ExcInternalError()); const typename dealii::MappingQGeneric::InternalData &data = static_cast:: @@ -3447,8 +3454,9 @@ namespace internal for (unsigned int i = 0; i < output.size(); ++i) { - DerivativeForm<1, spacedim, dim> A = apply_transformation( - data.contravariant[i], transpose(input[i])); + DerivativeForm<1, spacedim, dim> A = + apply_transformation(data.contravariant[i], + transpose(input[i])); output[i] = apply_transformation(data.covariant[i], A.transpose()); } @@ -3466,8 +3474,9 @@ namespace internal for (unsigned int i = 0; i < output.size(); ++i) { - DerivativeForm<1, spacedim, dim> A = apply_transformation( - data.covariant[i], transpose(input[i])); + DerivativeForm<1, spacedim, dim> A = + apply_transformation(data.covariant[i], + transpose(input[i])); output[i] = apply_transformation(data.covariant[i], A.transpose()); } @@ -3495,8 +3504,9 @@ namespace internal { DerivativeForm<1, spacedim, dim> A = apply_transformation(data.covariant[i], input[i]); - Tensor<2, spacedim> T = apply_transformation( - data.contravariant[i], A.transpose()); + Tensor<2, spacedim> T = + apply_transformation(data.contravariant[i], + A.transpose()); output[i] = transpose(T); output[i] /= data.volume_elements[i]; @@ -3521,10 +3531,10 @@ namespace internal const ArrayView> & output) { AssertDimension(input.size(), output.size()); - Assert( - (dynamic_cast:: - InternalData *>(&mapping_data) != nullptr), - ExcInternalError()); + Assert((dynamic_cast::InternalData *>( + &mapping_data) != nullptr), + ExcInternalError()); const typename dealii::MappingQGeneric::InternalData &data = static_cast:: @@ -3690,10 +3700,10 @@ namespace internal const ArrayView> & output) { AssertDimension(input.size(), output.size()); - Assert( - (dynamic_cast:: - InternalData *>(&mapping_data) != nullptr), - ExcInternalError()); + Assert((dynamic_cast::InternalData *>( + &mapping_data) != nullptr), + ExcInternalError()); const typename dealii::MappingQGeneric::InternalData &data = static_cast:: @@ -3731,8 +3741,10 @@ MappingQGeneric::transform( const typename Mapping::InternalDataBase &mapping_data, const ArrayView> & output) const { - internal::MappingQGenericImplementation::transform_fields( - input, mapping_type, mapping_data, output); + internal::MappingQGenericImplementation::transform_fields(input, + mapping_type, + mapping_data, + output); } @@ -3762,8 +3774,10 @@ MappingQGeneric::transform( switch (mapping_type) { case mapping_contravariant: - internal::MappingQGenericImplementation::transform_fields( - input, mapping_type, mapping_data, output); + internal::MappingQGenericImplementation::transform_fields(input, + mapping_type, + mapping_data, + output); return; case mapping_piola_gradient: @@ -4066,10 +4080,10 @@ MappingQGeneric::compute_mapping_support_points( const std::size_t n_rows = support_point_weights_cell.size(0); a.resize(a.size() + n_rows); auto a_view = make_array_view(a.end() - n_rows, a.end()); - cell->get_manifold().get_new_points( - make_array_view(a.begin(), a.end() - n_rows), - support_point_weights_cell, - a_view); + cell->get_manifold().get_new_points(make_array_view(a.begin(), + a.end() - n_rows), + support_point_weights_cell, + a_view); } else switch (dim) diff --git a/source/gmsh/utilities.cc b/source/gmsh/utilities.cc index 8755d3c95c..456e4fe6f8 100644 --- a/source/gmsh/utilities.cc +++ b/source/gmsh/utilities.cc @@ -30,9 +30,9 @@ namespace Gmsh { AdditionalParameters::AdditionalParameters( const double characteristic_length, - const std::string &output_base_name) : - characteristic_length(characteristic_length), - output_base_name(output_base_name) + const std::string &output_base_name) + : characteristic_length(characteristic_length) + , output_base_name(output_base_name) {} @@ -92,9 +92,9 @@ namespace Gmsh << log_file_name << " 2> " << warnings_file_name; const auto ret_value = std::system(command.str().c_str()); - AssertThrow( - ret_value == 0, - ExcMessage("Gmsh failed to run. Check the " + log_file_name + " file.")); + AssertThrow(ret_value == 0, + ExcMessage("Gmsh failed to run. Check the " + log_file_name + + " file.")); std::ifstream grid_file(msh_file_name); Assert(grid_file, ExcIO()); @@ -124,9 +124,9 @@ namespace Gmsh ExcMessage("Failed to remove " + *filename)); } const auto ret_value = std::remove(dir_template); - AssertThrow( - ret_value == 0, - ExcMessage("Failed to remove " + std::string(dir_template))); + AssertThrow(ret_value == 0, + ExcMessage("Failed to remove " + + std::string(dir_template))); } } # endif diff --git a/source/grid/cell_id.cc b/source/grid/cell_id.cc index 44a5bbbba9..c995495da0 100644 --- a/source/grid/cell_id.cc +++ b/source/grid/cell_id.cc @@ -21,9 +21,9 @@ DEAL_II_NAMESPACE_OPEN -CellId::CellId() : - coarse_cell_id(numbers::invalid_unsigned_int), - n_child_indices(numbers::invalid_unsigned_int) +CellId::CellId() + : coarse_cell_id(numbers::invalid_unsigned_int) + , n_child_indices(numbers::invalid_unsigned_int) { // initialize the child indices to invalid values // (the only allowed values are between zero and @@ -35,9 +35,9 @@ CellId::CellId() : CellId::CellId(const unsigned int coarse_cell_id, - const std::vector &id) : - coarse_cell_id(coarse_cell_id), - n_child_indices(id.size()) + const std::vector &id) + : coarse_cell_id(coarse_cell_id) + , n_child_indices(id.size()) { Assert(n_child_indices < child_indices.size(), ExcInternalError()); std::copy(id.begin(), id.end(), child_indices.begin()); @@ -47,9 +47,9 @@ CellId::CellId(const unsigned int coarse_cell_id, CellId::CellId(const unsigned int coarse_cell_id, const unsigned int n_child_indices, - const std::uint8_t *id) : - coarse_cell_id(coarse_cell_id), - n_child_indices(n_child_indices) + const std::uint8_t *id) + : coarse_cell_id(coarse_cell_id) + , n_child_indices(n_child_indices) { Assert(n_child_indices < child_indices.size(), ExcInternalError()); memcpy(&(child_indices[0]), id, n_child_indices); @@ -157,8 +157,9 @@ template typename Triangulation::cell_iterator CellId::to_cell(const Triangulation &tria) const { - typename Triangulation::cell_iterator cell( - &tria, 0, coarse_cell_id); + typename Triangulation::cell_iterator cell(&tria, + 0, + coarse_cell_id); for (unsigned int i = 0; i < n_child_indices; ++i) cell = cell->child(static_cast(child_indices[i])); diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index 728280c398..94f28d20fa 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -553,9 +553,9 @@ namespace GridGenerator const double r) { const unsigned int dim = 3; - Assert( - n_cells > 4, - ExcMessage("More than 4 cells are needed to create a moebius grid.")); + Assert(n_cells > 4, + ExcMessage( + "More than 4 cells are needed to create a moebius grid.")); Assert(r > 0 && R > 0, ExcMessage("Outer and inner radius must be positive.")); Assert(R > r, @@ -789,10 +789,10 @@ namespace GridGenerator // Check that the order of the vertices makes sense, i.e., the volume of the // cell is positive. - Assert( - GridTools::volume(tria) > 0., - ExcMessage("The volume of the cell is not greater than zero. " - "This could be due to the wrong ordering of the vertices.")); + Assert(GridTools::volume(tria) > 0., + ExcMessage( + "The volume of the cell is not greater than zero. " + "This could be due to the wrong ordering of the vertices.")); } @@ -947,12 +947,12 @@ namespace GridGenerator { // Check that the first two vectors are not linear combinations to // avoid zero division later on. - Assert( - std::abs(edges[0] * edges[1] / - (edges[0].norm() * edges[1].norm()) - - 1.0) > 1.0e-15, - ExcMessage("Edges in subdivided_parallelepiped() must point in" - " different directions.")); + Assert(std::abs(edges[0] * edges[1] / + (edges[0].norm() * edges[1].norm()) - + 1.0) > 1.0e-15, + ExcMessage( + "Edges in subdivided_parallelepiped() must point in" + " different directions.")); const Tensor<1, spacedim> plane_normal = cross_product_3d(edges[0], edges[1]); @@ -1297,9 +1297,9 @@ namespace GridGenerator double epsilon = 10; for (unsigned int i = 0; i < dim; ++i) epsilon = std::min(epsilon, 0.01 * delta[i][i]); - Assert( - epsilon > 0, - ExcMessage("The distance between corner points must be positive.")) + Assert(epsilon > 0, + ExcMessage( + "The distance between corner points must be positive.")) // actual code is external since // 1-D is different from 2/3D. @@ -1340,12 +1340,12 @@ namespace GridGenerator double x = 0; for (unsigned int j = 0; j < step_sizes.at(i).size(); j++) x += step_sizes[i][j]; - Assert( - std::fabs(x - (p2(i) - p1(i))) <= 1e-12 * std::fabs(x), - ExcMessage("The sequence of step sizes in coordinate direction " + - Utilities::int_to_string(i) + - " must be equal to the distance of the two given " - "points in this coordinate direction.")); + Assert(std::fabs(x - (p2(i) - p1(i))) <= 1e-12 * std::fabs(x), + ExcMessage( + "The sequence of step sizes in coordinate direction " + + Utilities::int_to_string(i) + + " must be equal to the distance of the two given " + "points in this coordinate direction.")); } @@ -1516,9 +1516,9 @@ namespace GridGenerator double min_size = *std::min_element(step_sizes[0].begin(), step_sizes[0].end()); for (unsigned int i = 1; i < dim; ++i) - min_size = std::min( - min_size, - *std::min_element(step_sizes[i].begin(), step_sizes[i].end())); + min_size = std::min(min_size, + *std::min_element(step_sizes[i].begin(), + step_sizes[i].end())); const double epsilon = 0.01 * min_size; // actual code is external since @@ -2151,8 +2151,8 @@ namespace GridGenerator const double right, const bool colorize) { - const double rl2 = (right + left) / 2; - const Point<2> vertices[10] = {Point<2>(left, left), + const double rl2 = (right + left) / 2; + const Point<2> vertices[10] = {Point<2>(left, left), Point<2>(rl2, left), Point<2>(rl2, rl2), Point<2>(left, rl2), @@ -2162,8 +2162,10 @@ namespace GridGenerator Point<2>(left, right), Point<2>(right, right), Point<2>(rl2, left)}; - const int cell_vertices[4][4] = { - {0, 1, 3, 2}, {9, 4, 2, 5}, {3, 2, 7, 6}, {2, 5, 6, 8}}; + const int cell_vertices[4][4] = {{0, 1, 3, 2}, + {9, 4, 2, 5}, + {3, 2, 7, 6}, + {2, 5, 6, 8}}; std::vector> cells(4, CellData<2>()); for (unsigned int i = 0; i < 4; ++i) { @@ -2171,10 +2173,10 @@ namespace GridGenerator cells[i].vertices[j] = cell_vertices[i][j]; cells[i].material_id = 0; } - tria.create_triangulation( - std::vector>(std::begin(vertices), std::end(vertices)), - cells, - SubCellData()); // no boundary information + tria.create_triangulation(std::vector>(std::begin(vertices), + std::end(vertices)), + cells, + SubCellData()); // no boundary information if (colorize) { @@ -2252,10 +2254,10 @@ namespace GridGenerator cells[i].material_id = 0; } - tria.create_triangulation( - std::vector>(std::begin(vertices), std::end(vertices)), - cells, - SubCellData()); + tria.create_triangulation(std::vector>(std::begin(vertices), + std::end(vertices)), + cells, + SubCellData()); if (colorize) { @@ -2312,10 +2314,10 @@ namespace GridGenerator cells[i].manifold_id = i == 2 ? 1 : numbers::flat_manifold_id; } - tria.create_triangulation( - std::vector>(std::begin(vertices), std::end(vertices)), - cells, - SubCellData()); // no boundary information + tria.create_triangulation(std::vector>(std::begin(vertices), + std::end(vertices)), + cells, + SubCellData()); // no boundary information tria.set_all_manifold_ids_on_boundary(0); tria.set_manifold(0, SphericalManifold<2>(p)); if (internal_manifolds) @@ -2448,14 +2450,15 @@ namespace GridGenerator // equilibrate cell sizes at // transition from the inner part // to the radial cells - const Point vertices[7] = { - p + Point(0, 0) * radius, - p + Point(+1, 0) * radius, - p + Point(+1, 0) * (radius / 2), - p + Point(0, +1) * (radius / 2), - p + Point(+1, +1) * (radius / (2 * sqrt(2.0))), - p + Point(0, +1) * radius, - p + Point(+1, +1) * (radius / std::sqrt(2.0))}; + const Point vertices[7] = {p + Point(0, 0) * radius, + p + Point(+1, 0) * radius, + p + Point(+1, 0) * (radius / 2), + p + Point(0, +1) * (radius / 2), + p + Point(+1, +1) * + (radius / (2 * sqrt(2.0))), + p + Point(0, +1) * radius, + p + Point(+1, +1) * + (radius / std::sqrt(2.0))}; const int cell_vertices[3][4] = {{0, 2, 3, 4}, {1, 6, 2, 4}, {5, 3, 6, 4}}; @@ -2468,10 +2471,10 @@ namespace GridGenerator cells[i].material_id = 0; } - tria.create_triangulation( - std::vector>(std::begin(vertices), std::end(vertices)), - cells, - SubCellData()); // no boundary information + tria.create_triangulation(std::vector>(std::begin(vertices), + std::end(vertices)), + cells, + SubCellData()); // no boundary information Triangulation::cell_iterator cell = tria.begin(); Triangulation::cell_iterator end = tria.end(); @@ -2520,8 +2523,10 @@ namespace GridGenerator p + Point<2>(0, +1) * radius, p + Point<2>(+1, +1) * (radius / std::sqrt(2.0))}; - const int cell_vertices[5][4] = { - {0, 1, 2, 3}, {2, 3, 4, 5}, {1, 7, 3, 5}, {6, 4, 7, 5}}; + const int cell_vertices[5][4] = {{0, 1, 2, 3}, + {2, 3, 4, 5}, + {1, 7, 3, 5}, + {6, 4, 7, 5}}; std::vector> cells(4, CellData<2>()); @@ -2532,10 +2537,10 @@ namespace GridGenerator cells[i].material_id = 0; } - tria.create_triangulation( - std::vector>(std::begin(vertices), std::end(vertices)), - cells, - SubCellData()); // no boundary information + tria.create_triangulation(std::vector>(std::begin(vertices), + std::end(vertices)), + cells, + SubCellData()); // no boundary information Triangulation<2>::cell_iterator cell = tria.begin(); Triangulation<2>::cell_iterator end = tria.end(); @@ -2763,10 +2768,10 @@ namespace GridGenerator cells[i].vertices[j] = cell_vertices[i][j]; cells[i].material_id = 0; } - tria.create_triangulation( - std::vector>(std::begin(vertices), std::end(vertices)), - cells, - SubCellData()); // no boundary information + tria.create_triangulation(std::vector>(std::begin(vertices), + std::end(vertices)), + cells, + SubCellData()); // no boundary information if (colorize) { @@ -2803,9 +2808,10 @@ namespace GridGenerator for (unsigned int x = 0; x < 4; ++x) vertices[k++] = Point<3>(coords[x], coords[y], coords[z]); - const types::material_id materials[27] = { - 21, 20, 22, 17, 16, 18, 25, 24, 26, 5, 4, 6, 1, 0, - 2, 9, 8, 10, 37, 36, 38, 33, 32, 34, 41, 40, 42}; + const types::material_id materials[27] = {21, 20, 22, 17, 16, 18, 25, + 24, 26, 5, 4, 6, 1, 0, + 2, 9, 8, 10, 37, 36, 38, + 33, 32, 34, 41, 40, 42}; std::vector> cells(27); k = 0; @@ -2976,10 +2982,10 @@ namespace GridGenerator cells[i].material_id = 0; } - tria.create_triangulation( - std::vector>(std::begin(vertices), std::end(vertices)), - cells, - SubCellData()); // no boundary information + tria.create_triangulation(std::vector>(std::begin(vertices), + std::end(vertices)), + cells, + SubCellData()); // no boundary information if (colorize) { @@ -3046,10 +3052,10 @@ namespace GridGenerator cells[i].manifold_id = i == 0 ? numbers::flat_manifold_id : 1; } - tria.create_triangulation( - std::vector>(std::begin(vertices), std::end(vertices)), - cells, - SubCellData()); // no boundary information + tria.create_triangulation(std::vector>(std::begin(vertices), + std::end(vertices)), + cells, + SubCellData()); // no boundary information tria.set_all_manifold_ids_on_boundary(0); tria.set_manifold(0, SphericalManifold<3>(p)); if (internal_manifold) @@ -3136,10 +3142,10 @@ namespace GridGenerator cells[i].material_id = 0; } - tria.create_triangulation( - std::vector>(std::begin(vertices), std::end(vertices)), - cells, - SubCellData()); // no boundary information + tria.create_triangulation(std::vector>(std::begin(vertices), + std::end(vertices)), + cells, + SubCellData()); // no boundary information // set boundary indicators for the // faces at the ends to 1 and 2, @@ -3239,10 +3245,10 @@ namespace GridGenerator cells[i].material_id = 0; } - tria.create_triangulation( - std::vector>(std::begin(vertices), std::end(vertices)), - cells, - SubCellData()); // no boundary information + tria.create_triangulation(std::vector>(std::begin(vertices), + std::end(vertices)), + cells, + SubCellData()); // no boundary information Triangulation::cell_iterator cell = tria.begin(); Triangulation::cell_iterator end = tria.end(); @@ -3341,10 +3347,10 @@ namespace GridGenerator cells[i].material_id = 0; } - tria.create_triangulation( - std::vector>(std::begin(vertices), std::end(vertices)), - cells, - SubCellData()); // no boundary information + tria.create_triangulation(std::vector>(std::begin(vertices), + std::end(vertices)), + cells, + SubCellData()); // no boundary information Triangulation<3>::cell_iterator cell = tria.begin(); Triangulation<3>::cell_iterator end = tria.end(); @@ -3581,10 +3587,10 @@ namespace GridGenerator cells[i].material_id = 0; } - tria.create_triangulation( - std::vector>(std::begin(vertices), std::end(vertices)), - cells, - SubCellData()); // no boundary information + tria.create_triangulation(std::vector>(std::begin(vertices), + std::end(vertices)), + cells, + SubCellData()); // no boundary information } else { @@ -3679,8 +3685,9 @@ namespace GridGenerator cells[i].material_id = 0; } - tria.create_triangulation( - vertices, cells, SubCellData()); // no boundary information + tria.create_triangulation(vertices, + cells, + SubCellData()); // no boundary information } else { @@ -3749,8 +3756,9 @@ namespace GridGenerator for (unsigned int j = 0; j <= N_z; ++j) for (unsigned int i = 0; i < 2 * N_r; ++i) { - const Point<3> v( - vertices_2d[i][0], vertices_2d[i][1], j * length / N_z); + const Point<3> v(vertices_2d[i][0], + vertices_2d[i][1], + j * length / N_z); vertices_3d.push_back(v); } @@ -3928,13 +3936,13 @@ namespace GridGenerator ++cell) if (cells_to_remove.find(cell) == cells_to_remove.end()) { - Assert( - static_cast(cell->level()) == - input_triangulation.n_levels() - 1, - ExcMessage("Your input triangulation appears to have " - "adaptively refined cells. This is not allowed. You can " - "only call this function on a triangulation in which " - "all cells are on the same refinement level.")); + Assert(static_cast(cell->level()) == + input_triangulation.n_levels() - 1, + ExcMessage( + "Your input triangulation appears to have " + "adaptively refined cells. This is not allowed. You can " + "only call this function on a triangulation in which " + "all cells are on the same refinement level.")); CellData this_cell; for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; @@ -3948,8 +3956,10 @@ namespace GridGenerator // necessary and create the triangulation SubCellData subcell_data; std::vector considered_vertices; - GridTools::delete_duplicated_vertices( - vertices, cells, subcell_data, considered_vertices); + GridTools::delete_duplicated_vertices(vertices, + cells, + subcell_data, + considered_vertices); // then clear the old triangulation and create the new one result.clear(); @@ -3964,17 +3974,17 @@ namespace GridGenerator const double height, Triangulation<3, 3> & result) { - Assert( - input.n_levels() == 1, - ExcMessage("The input triangulation must be a coarse mesh, i.e., it must " - "not have been refined.")); + Assert(input.n_levels() == 1, + ExcMessage( + "The input triangulation must be a coarse mesh, i.e., it must " + "not have been refined.")); Assert(result.n_cells() == 0, ExcMessage("The output triangulation object needs to be empty.")); Assert(height > 0, ExcMessage("The given height for extrusion must be positive.")); - Assert( - n_slices >= 2, - ExcMessage("The number of slices for extrusion must be at least 2.")); + Assert(n_slices >= 2, + ExcMessage( + "The number of slices for extrusion must be at least 2.")); const double delta_h = height / (n_slices - 1); std::vector slices_z_values; @@ -3988,15 +3998,15 @@ namespace GridGenerator const std::vector &slice_coordinates, Triangulation<3, 3> & result) { - Assert( - input.n_levels() == 1, - ExcMessage("The input triangulation must be a coarse mesh, i.e., it must " - "not have been refined.")); + Assert(input.n_levels() == 1, + ExcMessage( + "The input triangulation must be a coarse mesh, i.e., it must " + "not have been refined.")); Assert(result.n_cells() == 0, ExcMessage("The output triangulation object needs to be empty.")); - Assert( - slice_coordinates.size() >= 2, - ExcMessage("The number of slices for extrusion must be at least 2.")); + Assert(slice_coordinates.size() >= 2, + ExcMessage( + "The number of slices for extrusion must be at least 2.")); const unsigned int n_slices = slice_coordinates.size(); Assert(std::is_sorted(slice_coordinates.begin(), slice_coordinates.end()), ExcMessage("Slice z-coordinates should be in ascending order")); @@ -4077,15 +4087,15 @@ namespace GridGenerator // then mark the bottom and top boundaries of the extruded mesh // with max_boundary_id+1 and max_boundary_id+2. check that this // remains valid - Assert( - (max_boundary_id != numbers::invalid_boundary_id) && - (max_boundary_id + 1 != numbers::invalid_boundary_id) && - (max_boundary_id + 2 != numbers::invalid_boundary_id), - ExcMessage("The input triangulation to this function is using boundary " - "indicators in a range that do not allow using " - "max_boundary_id+1 and max_boundary_id+2 as boundary " - "indicators for the bottom and top faces of the " - "extruded triangulation.")); + Assert((max_boundary_id != numbers::invalid_boundary_id) && + (max_boundary_id + 1 != numbers::invalid_boundary_id) && + (max_boundary_id + 2 != numbers::invalid_boundary_id), + ExcMessage( + "The input triangulation to this function is using boundary " + "indicators in a range that do not allow using " + "max_boundary_id+1 and max_boundary_id+2 as boundary " + "indicators for the bottom and top faces of the " + "extruded triangulation.")); for (Triangulation<2, 2>::cell_iterator cell = input.begin(); cell != input.end(); ++cell) diff --git a/source/grid/grid_in.cc b/source/grid/grid_in.cc index b0c713c698..d6f98790a2 100644 --- a/source/grid/grid_in.cc +++ b/source/grid/grid_in.cc @@ -94,9 +94,9 @@ namespace } // namespace template -GridIn::GridIn() : - tria(nullptr, typeid(*this).name()), - default_format(ucd) +GridIn::GridIn() + : tria(nullptr, typeid(*this).name()) + , default_format(ucd) {} @@ -173,9 +173,9 @@ GridIn::read_vtk(std::istream &in) } else - AssertThrow( - false, - ExcMessage("While reading VTK file, failed to find POINTS section")); + AssertThrow(false, + ExcMessage( + "While reading VTK file, failed to find POINTS section")); //////////////////ignoring space between points and cells @@ -289,9 +289,9 @@ GridIn::read_vtk(std::istream &in) } } else - AssertThrow( - false, - ExcMessage("While reading VTK file, failed to find CELLS section")); + AssertThrow(false, + ExcMessage( + "While reading VTK file, failed to find CELLS section")); /////////////////////Processing the CELL_TYPES /// section//////////////////////// @@ -354,11 +354,11 @@ GridIn::read_vtk(std::istream &in) if (linenew.size() > textnew[0].size()) linenew.resize(textnew[0].size()); - AssertThrow( - linenew.compare(textnew[i]) == 0, - ExcMessage( - std::string("While reading VTK file, failed to find <") + - textnew[i] + "> section")); + AssertThrow(linenew.compare(textnew[i]) == 0, + ExcMessage( + std::string( + "While reading VTK file, failed to find <") + + textnew[i] + "> section")); } // read material ids first for all cells, then for all @@ -408,9 +408,9 @@ GridIn::read_vtk(std::istream &in) return; } else - AssertThrow( - false, - ExcMessage("While reading VTK file, failed to find CELLS section")); + AssertThrow(false, + ExcMessage( + "While reading VTK file, failed to find CELLS section")); } @@ -572,11 +572,11 @@ GridIn::read_unv(std::istream &in) no_quad++; } else - AssertThrow( - false, - ExcMessage("Unknown element label <" + - Utilities::int_to_string(type) + - "> when running in dim=" + Utilities::int_to_string(dim))); + AssertThrow(false, + ExcMessage("Unknown element label <" + + Utilities::int_to_string(type) + + "> when running in dim=" + + Utilities::int_to_string(dim))); } // note that so far all materials and bcs are explicitly set to 0 @@ -769,8 +769,9 @@ GridIn::read_ucd(std::istream &in, else { // no such vertex index - AssertThrow( - false, ExcInvalidVertexIndex(cell, cells.back().vertices[i])); + AssertThrow(false, + ExcInvalidVertexIndex(cell, + cells.back().vertices[i])); cells.back().vertices[i] = numbers::invalid_unsigned_int; } @@ -789,9 +790,10 @@ GridIn::read_ucd(std::istream &in, std::numeric_limits::max())); // we use only boundary_ids in the range from 0 to // numbers::internal_face_boundary_id-1 - Assert( - material_id < numbers::internal_face_boundary_id, - ExcIndexRange(material_id, 0, numbers::internal_face_boundary_id)); + Assert(material_id < numbers::internal_face_boundary_id, + ExcIndexRange(material_id, + 0, + numbers::internal_face_boundary_id)); if (apply_all_indicators_to_manifolds) subcelldata.boundary_lines.back().manifold_id = @@ -812,10 +814,10 @@ GridIn::read_ucd(std::istream &in, else { // no such vertex index - AssertThrow( - false, - ExcInvalidVertexIndex( - cell, subcelldata.boundary_lines.back().vertices[i])); + AssertThrow(false, + ExcInvalidVertexIndex( + cell, + subcelldata.boundary_lines.back().vertices[i])); subcelldata.boundary_lines.back().vertices[i] = numbers::invalid_unsigned_int; }; @@ -836,9 +838,10 @@ GridIn::read_ucd(std::istream &in, std::numeric_limits::max())); // we use only boundary_ids in the range from 0 to // numbers::internal_face_boundary_id-1 - Assert( - material_id < numbers::internal_face_boundary_id, - ExcIndexRange(material_id, 0, numbers::internal_face_boundary_id)); + Assert(material_id < numbers::internal_face_boundary_id, + ExcIndexRange(material_id, + 0, + numbers::internal_face_boundary_id)); if (apply_all_indicators_to_manifolds) subcelldata.boundary_quads.back().manifold_id = @@ -1516,8 +1519,9 @@ GridIn::read_msh(std::istream &in) { AssertThrow(vertex_indices.find(cells.back().vertices[i]) != vertex_indices.end(), - ExcInvalidVertexIndexGmsh( - cell, elm_number, cells.back().vertices[i])); + ExcInvalidVertexIndexGmsh(cell, + elm_number, + cells.back().vertices[i])); // vertex with this index exists cells.back().vertices[i] = @@ -1538,9 +1542,10 @@ GridIn::read_msh(std::istream &in) std::numeric_limits::max())); // we use only boundary_ids in the range from 0 to // numbers::internal_face_boundary_id-1 - Assert( - material_id < numbers::internal_face_boundary_id, - ExcIndexRange(material_id, 0, numbers::internal_face_boundary_id)); + Assert(material_id < numbers::internal_face_boundary_id, + ExcIndexRange(material_id, + 0, + numbers::internal_face_boundary_id)); subcelldata.boundary_lines.back().boundary_id = static_cast(material_id); @@ -1557,10 +1562,10 @@ GridIn::read_msh(std::istream &in) else { // no such vertex index - AssertThrow( - false, - ExcInvalidVertexIndex( - cell, subcelldata.boundary_lines.back().vertices[i])); + AssertThrow(false, + ExcInvalidVertexIndex( + cell, + subcelldata.boundary_lines.back().vertices[i])); subcelldata.boundary_lines.back().vertices[i] = numbers::invalid_unsigned_int; }; @@ -1581,9 +1586,10 @@ GridIn::read_msh(std::istream &in) std::numeric_limits::max())); // we use only boundary_ids in the range from 0 to // numbers::internal_face_boundary_id-1 - Assert( - material_id < numbers::internal_face_boundary_id, - ExcIndexRange(material_id, 0, numbers::internal_face_boundary_id)); + Assert(material_id < numbers::internal_face_boundary_id, + ExcIndexRange(material_id, + 0, + numbers::internal_face_boundary_id)); subcelldata.boundary_quads.back().boundary_id = static_cast(material_id); @@ -1857,8 +1863,9 @@ GridIn<2>::read_netcdf(const std::string &filename) ExcIO()); std::vector vertex_indices(n_bquads * vertices_per_quad); - vertex_indices_var->get( - &*vertex_indices.begin(), n_bquads, vertices_per_quad); + vertex_indices_var->get(&*vertex_indices.begin(), + n_bquads, + vertices_per_quad); for (unsigned int i = 0; i < vertex_indices.size(); ++i) AssertThrow(vertex_indices[i] >= 0, ExcIO()); @@ -2088,14 +2095,15 @@ GridIn<3>::read_netcdf(const std::string &filename) AssertThrow(bvertex_indices_var->is_valid(), ExcIO()); AssertThrow(bvertex_indices_var->num_dims() == 2, ExcIO()); const unsigned int n_bquads = bvertex_indices_var->get_dim(0)->size(); - AssertThrow( - static_cast(bvertex_indices_var->get_dim(1)->size()) == - GeometryInfo::vertices_per_face, - ExcIO()); + AssertThrow(static_cast( + bvertex_indices_var->get_dim(1)->size()) == + GeometryInfo::vertices_per_face, + ExcIO()); std::vector bvertex_indices(n_bquads * vertices_per_quad); - bvertex_indices_var->get( - &*bvertex_indices.begin(), n_bquads, vertices_per_quad); + bvertex_indices_var->get(&*bvertex_indices.begin(), + n_bquads, + vertices_per_quad); // next we read // int boundarymarker_of_surfaces( @@ -2273,9 +2281,9 @@ GridIn::parse_tecplot_header( else if (Utilities::match_at_string_start(entries[i], "ZONETYPE=")) // unsupported ZONETYPE { - AssertThrow( - false, - ExcMessage("The tecplot file contains an unsupported ZONETYPE.")); + AssertThrow(false, + ExcMessage( + "The tecplot file contains an unsupported ZONETYPE.")); } else if (Utilities::match_at_string_start(entries[i], "DATAPACKING=POINT")) @@ -2578,8 +2586,10 @@ GridIn<2>::read_tecplot(std::istream &in) // or o-type grids around a body // (airfoil). this automatically deletes // unused vertices as well. - GridTools::delete_duplicated_vertices( - vertices, cells, subcelldata, boundary_vertices); + GridTools::delete_duplicated_vertices(vertices, + cells, + subcelldata, + boundary_vertices); } else { @@ -2645,11 +2655,12 @@ GridIn::read_assimp(const std::string &filename, Assimp::Importer importer; // And have it read the given file with some postprocessing - const aiScene *scene = importer.ReadFile( - filename.c_str(), - aiProcess_RemoveComponent | aiProcess_JoinIdenticalVertices | - aiProcess_ImproveCacheLocality | aiProcess_SortByPType | - aiProcess_OptimizeGraph | aiProcess_OptimizeMeshes); + const aiScene *scene = + importer.ReadFile(filename.c_str(), + aiProcess_RemoveComponent | + aiProcess_JoinIdenticalVertices | + aiProcess_ImproveCacheLocality | aiProcess_SortByPType | + aiProcess_OptimizeGraph | aiProcess_OptimizeMeshes); // If the import failed, report it AssertThrow(scene, ExcMessage(importer.GetErrorString())) @@ -2800,11 +2811,11 @@ GridIn::skip_empty_lines(std::istream &in) // consists only of spaces, and // if not put the whole thing // back and return - if (std::find_if( - line.begin(), - line.end(), - std::bind(std::not_equal_to(), std::placeholders::_1, ' ')) != - line.end()) + if (std::find_if(line.begin(), + line.end(), + std::bind(std::not_equal_to(), + std::placeholders::_1, + ' ')) != line.end()) { in.putback('\n'); for (int i = line.length() - 1; i >= 0; --i) @@ -3186,9 +3197,9 @@ GridIn::get_format_names() namespace { template - Abaqus_to_UCD::Abaqus_to_UCD() : - tolerance(5e-16) // Used to offset Cubit tolerance error when outputting - // value close to zero + Abaqus_to_UCD::Abaqus_to_UCD() + : tolerance(5e-16) // Used to offset Cubit tolerance error when outputting + // value close to zero { AssertThrow(dim == 2 || dim == 3, ExcNotImplemented()); } @@ -3358,8 +3369,10 @@ namespace goto cont; // Change all characters to upper case - std::transform( - line.begin(), line.end(), line.begin(), ::toupper); + std::transform(line.begin(), + line.end(), + line.begin(), + ::toupper); // Surface can be created from ELSET, or directly from cells // If elsets_list contains a key with specific name - refers to @@ -3514,8 +3527,9 @@ namespace line.find("MATERIAL=") + material_key.size(); const std::size_t material_id_start = line.find('-', last_equal); int material_id = 0; - from_string( - material_id, line.substr(material_id_start + 1), std::dec); + from_string(material_id, + line.substr(material_id_start + 1), + std::dec); // Assign material id to cells const std::vector &elset_cells = elsets_list[elset_name]; diff --git a/source/grid/grid_out.cc b/source/grid/grid_out.cc index a0b86d2ef6..e46d9f9fae 100644 --- a/source/grid/grid_out.cc +++ b/source/grid/grid_out.cc @@ -48,12 +48,12 @@ namespace GridOutFlags const bool write_faces, const bool write_diameter, const bool write_measure, - const bool write_all_faces) : - write_cells(write_cells), - write_faces(write_faces), - write_diameter(write_diameter), - write_measure(write_measure), - write_all_faces(write_all_faces) + const bool write_all_faces) + : write_cells(write_cells) + , write_faces(write_faces) + , write_diameter(write_diameter) + , write_measure(write_measure) + , write_all_faces(write_all_faces) {} void @@ -95,9 +95,9 @@ namespace GridOutFlags } - Msh::Msh(const bool write_faces, const bool write_lines) : - write_faces(write_faces), - write_lines(write_lines) + Msh::Msh(const bool write_faces, const bool write_lines) + : write_faces(write_faces) + , write_lines(write_lines) {} void @@ -118,10 +118,10 @@ namespace GridOutFlags Ucd::Ucd(const bool write_preamble, const bool write_faces, - const bool write_lines) : - write_preamble(write_preamble), - write_faces(write_faces), - write_lines(write_lines) + const bool write_lines) + : write_preamble(write_preamble) + , write_faces(write_faces) + , write_lines(write_lines) {} @@ -148,22 +148,22 @@ namespace GridOutFlags Gnuplot::Gnuplot(const bool write_cell_numbers, const unsigned int n_extra_curved_line_points, const bool curved_inner_cells, - const bool write_additional_boundary_lines) : - write_cell_numbers(write_cell_numbers), - n_extra_curved_line_points(n_extra_curved_line_points), - n_boundary_face_points(this->n_extra_curved_line_points), - curved_inner_cells(curved_inner_cells), - write_additional_boundary_lines(write_additional_boundary_lines) + const bool write_additional_boundary_lines) + : write_cell_numbers(write_cell_numbers) + , n_extra_curved_line_points(n_extra_curved_line_points) + , n_boundary_face_points(this->n_extra_curved_line_points) + , curved_inner_cells(curved_inner_cells) + , write_additional_boundary_lines(write_additional_boundary_lines) {} // TODO we can get rid of these extra constructors and assignment operators // once we remove the reference member variable. - Gnuplot::Gnuplot(const Gnuplot &flags) : - Gnuplot(flags.write_cell_numbers, - flags.n_extra_curved_line_points, - flags.curved_inner_cells, - flags.write_additional_boundary_lines) + Gnuplot::Gnuplot(const Gnuplot &flags) + : Gnuplot(flags.write_cell_numbers, + flags.n_extra_curved_line_points, + flags.curved_inner_cells, + flags.write_additional_boundary_lines) {} @@ -202,13 +202,13 @@ namespace GridOutFlags const double line_width, const bool color_lines_on_user_flag, const unsigned int n_boundary_face_points, - const bool color_lines_level) : - size_type(size_type), - size(size), - line_width(line_width), - color_lines_on_user_flag(color_lines_on_user_flag), - n_boundary_face_points(n_boundary_face_points), - color_lines_level(color_lines_level) + const bool color_lines_level) + : size_type(size_type) + , size(size) + , line_width(line_width) + , color_lines_on_user_flag(color_lines_on_user_flag) + , n_boundary_face_points(n_boundary_face_points) + , color_lines_level(color_lines_level) {} @@ -221,8 +221,10 @@ namespace GridOutFlags "Depending on this parameter, either the" "width or height " "of the eps is scaled to \"Size\""); - param.declare_entry( - "Size", "300", Patterns::Integer(), "Size of the output in points"); + param.declare_entry("Size", + "300", + Patterns::Integer(), + "Size of the output in points"); param.declare_entry("Line width", "0.5", Patterns::Double(), @@ -263,12 +265,12 @@ namespace GridOutFlags const unsigned int size, const double line_width, const bool color_lines_on_user_flag, - const unsigned int n_boundary_face_points) : - EpsFlagsBase(size_type, - size, - line_width, - color_lines_on_user_flag, - n_boundary_face_points) + const unsigned int n_boundary_face_points) + : EpsFlagsBase(size_type, + size, + line_width, + color_lines_on_user_flag, + n_boundary_face_points) {} @@ -293,16 +295,16 @@ namespace GridOutFlags const bool write_cell_numbers, const bool write_cell_number_level, const bool write_vertex_numbers, - const bool color_lines_level) : - EpsFlagsBase(size_type, - size, - line_width, - color_lines_on_user_flag, - n_boundary_face_points, - color_lines_level), - write_cell_numbers(write_cell_numbers), - write_cell_number_level(write_cell_number_level), - write_vertex_numbers(write_vertex_numbers) + const bool color_lines_level) + : EpsFlagsBase(size_type, + size, + line_width, + color_lines_on_user_flag, + n_boundary_face_points, + color_lines_level) + , write_cell_numbers(write_cell_numbers) + , write_cell_number_level(write_cell_number_level) + , write_vertex_numbers(write_vertex_numbers) {} @@ -343,14 +345,14 @@ namespace GridOutFlags const bool color_lines_on_user_flag, const unsigned int n_boundary_face_points, const double azimut_angle, - const double turn_angle) : - EpsFlagsBase(size_type, - size, - line_width, - color_lines_on_user_flag, - n_boundary_face_points), - azimut_angle(azimut_angle), - turn_angle(turn_angle) + const double turn_angle) + : EpsFlagsBase(size_type, + size, + line_width, + color_lines_on_user_flag, + n_boundary_face_points) + , azimut_angle(azimut_angle) + , turn_angle(turn_angle) {} @@ -379,17 +381,17 @@ namespace GridOutFlags - XFig::XFig() : - draw_boundary(true), - color_by(material_id), - level_depth(true), - n_boundary_face_points(0), - scaling(1., 1.), - fill_style(20), - line_style(0), - line_thickness(1), - boundary_style(0), - boundary_thickness(3) + XFig::XFig() + : draw_boundary(true) + , color_by(material_id) + , level_depth(true) + , n_boundary_face_points(0) + , scaling(1., 1.) + , fill_style(20) + , line_style(0) + , line_thickness(1) + , boundary_style(0) + , boundary_thickness(3) {} @@ -435,29 +437,30 @@ namespace GridOutFlags const bool label_material_id, const bool label_subdomain_id, const bool draw_colorbar, - const bool draw_legend) : - height(1000), - width(0), - line_thickness(line_thickness), - boundary_line_thickness(boundary_line_thickness), - margin(margin), - background(background), - azimuth_angle(azimuth_angle), - polar_angle(polar_angle), - coloring(coloring), - convert_level_number_to_height(convert_level_number_to_height), - level_height_factor(0.3f), - cell_font_scaling(1.f), - label_level_number(label_level_number), - label_cell_index(label_cell_index), - label_material_id(label_material_id), - label_subdomain_id(label_subdomain_id), - label_level_subdomain_id(false), - draw_colorbar(draw_colorbar), - draw_legend(draw_legend) + const bool draw_legend) + : height(1000) + , width(0) + , line_thickness(line_thickness) + , boundary_line_thickness(boundary_line_thickness) + , margin(margin) + , background(background) + , azimuth_angle(azimuth_angle) + , polar_angle(polar_angle) + , coloring(coloring) + , convert_level_number_to_height(convert_level_number_to_height) + , level_height_factor(0.3f) + , cell_font_scaling(1.f) + , label_level_number(label_level_number) + , label_cell_index(label_cell_index) + , label_material_id(label_material_id) + , label_subdomain_id(label_subdomain_id) + , label_level_subdomain_id(false) + , draw_colorbar(draw_colorbar) + , draw_legend(draw_legend) {} - MathGL::MathGL() : draw_bounding_box(false) // box + MathGL::MathGL() + : draw_bounding_box(false) // box {} void @@ -475,7 +478,8 @@ namespace GridOutFlags -GridOut::GridOut() : default_format(none) +GridOut::GridOut() + : default_format(none) {} @@ -662,8 +666,9 @@ GridOut::get_output_format_names() void GridOut::declare_parameters(ParameterHandler ¶m) { - param.declare_entry( - "Format", "none", Patterns::Selection(get_output_format_names())); + param.declare_entry("Format", + "none", + Patterns::Selection(get_output_format_names())); param.enter_subsection("DX"); GridOutFlags::DX::declare_parameters(param); @@ -4036,11 +4041,11 @@ namespace internal LineEntry(const Point<2> & f, const Point<2> & s, const bool c, - const unsigned int l) : - first(f), - second(s), - colorize(c), - level(l) + const unsigned int l) + : first(f) + , second(s) + , colorize(c) + , level(l) {} }; @@ -4239,16 +4244,20 @@ namespace internal cell, q_projector.point(offset + i))); const Point<2> p1(p1_dim(0), p1_dim(1)); - line_list.emplace_back( - p0, p1, face->user_flag_set(), cell->level()); + line_list.emplace_back(p0, + p1, + face->user_flag_set(), + cell->level()); p0 = p1; } // generate last piece const Point p1_dim(face->vertex(1)); const Point<2> p1(p1_dim(0), p1_dim(1)); - line_list.emplace_back( - p0, p1, face->user_flag_set(), cell->level()); + line_list.emplace_back(p0, + p1, + face->user_flag_set(), + cell->level()); } } } diff --git a/source/grid/grid_refinement.cc b/source/grid/grid_refinement.cc index e3731bf86c..8ee45e6cf1 100644 --- a/source/grid/grid_refinement.cc +++ b/source/grid/grid_refinement.cc @@ -203,8 +203,10 @@ GridRefinement::refine_and_coarsen_fixed_number( Assert(criteria.is_non_negative(), ExcNegativeCriteria()); const std::pair adjusted_fractions = - adjust_refine_and_coarsen_number_fraction( - criteria.size(), max_n_cells, top_fraction, bottom_fraction); + adjust_refine_and_coarsen_number_fraction(criteria.size(), + max_n_cells, + top_fraction, + bottom_fraction); const int refine_cells = static_cast(adjusted_fractions.first * criteria.size()); @@ -238,8 +240,9 @@ GridRefinement::refine_and_coarsen_fixed_number( tmp.begin() + tmp.size() - coarsen_cells, tmp.end(), std::greater()); - coarsen( - tria, criteria, *(tmp.begin() + tmp.size() - coarsen_cells)); + coarsen(tria, + criteria, + *(tmp.begin() + tmp.size() - coarsen_cells)); } } } diff --git a/source/grid/grid_refinement.inst.in b/source/grid/grid_refinement.inst.in index 9bcb471d2f..e173c988cf 100644 --- a/source/grid/grid_refinement.inst.in +++ b/source/grid/grid_refinement.inst.in @@ -38,15 +38,14 @@ for (S : REAL_SCALARS; deal_II_dimension : DIMENSIONS) const double, const unsigned int); - template void - GridRefinement::refine_and_coarsen_fixed_fraction( - Triangulation &, - const dealii::Vector &, - const double, - const double, - const unsigned int); + template void GridRefinement::refine_and_coarsen_fixed_fraction< + deal_II_dimension, + S, + deal_II_dimension>(Triangulation &, + const dealii::Vector &, + const double, + const double, + const unsigned int); template void GridRefinement:: refine_and_coarsen_optimize( diff --git a/source/grid/grid_reordering.cc b/source/grid/grid_reordering.cc index 58544cf44b..6d6215e99e 100644 --- a/source/grid/grid_reordering.cc +++ b/source/grid/grid_reordering.cc @@ -41,7 +41,9 @@ namespace /** * Construct an edge from the global indices of its two vertices. */ - CheapEdge(const unsigned int v0, const unsigned int v1) : v0(v0), v1(v1) + CheapEdge(const unsigned int v0, const unsigned int v1) + : v0(v0) + , v1(v1) {} /** @@ -170,18 +172,18 @@ namespace /** * Default constructor. Initialize the fields with invalid values. */ - AdjacentCell() : - cell_index(numbers::invalid_unsigned_int), - edge_within_cell(numbers::invalid_unsigned_int) + AdjacentCell() + : cell_index(numbers::invalid_unsigned_int) + , edge_within_cell(numbers::invalid_unsigned_int) {} /** * Constructor. Initialize the fields with the given values. */ AdjacentCell(const unsigned int cell_index, - const unsigned int edge_within_cell) : - cell_index(cell_index), - edge_within_cell(edge_within_cell) + const unsigned int edge_within_cell) + : cell_index(cell_index) + , edge_within_cell(edge_within_cell) {} @@ -303,8 +305,8 @@ namespace * in @p cell, and selecting the edge with number @p edge_number * within this cell. Initialize the edge as unoriented. */ - Edge(const CellData &cell, const unsigned int edge_number) : - orientation_status(not_oriented) + Edge(const CellData &cell, const unsigned int edge_number) + : orientation_status(not_oriented) { Assert(edge_number < GeometryInfo::lines_per_cell, ExcInternalError()); @@ -811,10 +813,9 @@ namespace unsigned int starting_vertex_of_edge[GeometryInfo::lines_per_cell]; for (unsigned int e = 0; e < GeometryInfo::lines_per_cell; ++e) { - Assert( - edge_list[cell_list[cell_index].edge_indices[e]].orientation_status != - Edge::not_oriented, - ExcInternalError()); + Assert(edge_list[cell_list[cell_index].edge_indices[e]] + .orientation_status != Edge::not_oriented, + ExcInternalError()); if (edge_list[cell_list[cell_index].edge_indices[e]] .orientation_status == Edge::forward) starting_vertex_of_edge[e] = @@ -1187,10 +1188,10 @@ GridReordering<2>::invert_all_cells_of_negative_grid( // might work also on single cells, grids // with both kind of cells are very likely to // be broken. Check for this here. - AssertThrow( - n_negative_cells == 0 || n_negative_cells == cells.size(), - ExcMessage( - std::string("This class assumes that either all cells have positive " + AssertThrow(n_negative_cells == 0 || n_negative_cells == cells.size(), + ExcMessage( + std::string( + "This class assumes that either all cells have positive " "volume, or that all cells have been specified in an " "inverted vertex order so that their volume is negative. " "(In the latter case, this class automatically inverts " @@ -1199,9 +1200,9 @@ GridReordering<2>::invert_all_cells_of_negative_grid( "negative volume. You need to check your mesh which " "cells these are and how they got there.\n" "As a hint, of the total ") + - Utilities::to_string(cells.size()) + " cells in the mesh, " + - Utilities::to_string(n_negative_cells) + - " appear to have a negative volume.")); + Utilities::to_string(cells.size()) + " cells in the mesh, " + + Utilities::to_string(n_negative_cells) + + " appear to have a negative volume.")); } diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 93066d615b..5f00abc06d 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -150,8 +150,10 @@ namespace GridTools // wants a finite element. create a cheap element as a dummy // element FE_Nothing dummy_fe; - FEValues fe_values( - mapping, dummy_fe, quadrature_formula, update_JxW_values); + FEValues fe_values(mapping, + dummy_fe, + quadrature_formula, + update_JxW_values); typename Triangulation::active_cell_iterator cell = triangulation.begin_active(), @@ -478,18 +480,18 @@ namespace GridTools for (unsigned int c = 0; c < subcelldata.boundary_lines.size(); ++c) for (unsigned int v = 0; v < GeometryInfo<1>::vertices_per_cell; ++v) { - Assert( - subcelldata.boundary_lines[c].vertices[v] < - new_vertex_numbers.size(), - ExcMessage("Invalid vertex index in subcelldata.boundary_lines. " - "subcelldata.boundary_lines[" + - Utilities::int_to_string(c) + "].vertices[" + - Utilities::int_to_string(v) + "]=" + - Utilities::int_to_string( - subcelldata.boundary_lines[c].vertices[v]) + - " is invalid, because only " + - Utilities::int_to_string(vertices.size()) + - " vertices were supplied.")); + Assert(subcelldata.boundary_lines[c].vertices[v] < + new_vertex_numbers.size(), + ExcMessage( + "Invalid vertex index in subcelldata.boundary_lines. " + "subcelldata.boundary_lines[" + + Utilities::int_to_string(c) + "].vertices[" + + Utilities::int_to_string(v) + "]=" + + Utilities::int_to_string( + subcelldata.boundary_lines[c].vertices[v]) + + " is invalid, because only " + + Utilities::int_to_string(vertices.size()) + + " vertices were supplied.")); subcelldata.boundary_lines[c].vertices[v] = new_vertex_numbers[subcelldata.boundary_lines[c].vertices[v]]; } @@ -497,18 +499,18 @@ namespace GridTools for (unsigned int c = 0; c < subcelldata.boundary_quads.size(); ++c) for (unsigned int v = 0; v < GeometryInfo<2>::vertices_per_cell; ++v) { - Assert( - subcelldata.boundary_quads[c].vertices[v] < - new_vertex_numbers.size(), - ExcMessage("Invalid vertex index in subcelldata.boundary_quads. " - "subcelldata.boundary_quads[" + - Utilities::int_to_string(c) + "].vertices[" + - Utilities::int_to_string(v) + "]=" + - Utilities::int_to_string( - subcelldata.boundary_quads[c].vertices[v]) + - " is invalid, because only " + - Utilities::int_to_string(vertices.size()) + - " vertices were supplied.")); + Assert(subcelldata.boundary_quads[c].vertices[v] < + new_vertex_numbers.size(), + ExcMessage( + "Invalid vertex index in subcelldata.boundary_quads. " + "subcelldata.boundary_quads[" + + Utilities::int_to_string(c) + "].vertices[" + + Utilities::int_to_string(v) + "]=" + + Utilities::int_to_string( + subcelldata.boundary_quads[c].vertices[v]) + + " is invalid, because only " + + Utilities::int_to_string(vertices.size()) + + " vertices were supplied.")); subcelldata.boundary_quads[c].vertices[v] = new_vertex_numbers[subcelldata.boundary_quads[c].vertices[v]]; @@ -607,7 +609,8 @@ namespace GridTools class Shift { public: - explicit Shift(const Tensor<1, spacedim> &shift) : shift(shift) + explicit Shift(const Tensor<1, spacedim> &shift) + : shift(shift) {} Point operator()(const Point p) const @@ -626,7 +629,8 @@ namespace GridTools class Rotate2d { public: - explicit Rotate2d(const double angle) : angle(angle) + explicit Rotate2d(const double angle) + : angle(angle) {} Point<2> operator()(const Point<2> &p) const @@ -643,9 +647,9 @@ namespace GridTools class Rotate3d { public: - Rotate3d(const double angle, const unsigned int axis) : - angle(angle), - axis(axis) + Rotate3d(const double angle, const unsigned int axis) + : angle(angle) + , axis(axis) {} Point<3> @@ -674,7 +678,8 @@ namespace GridTools class Scale { public: - explicit Scale(const double factor) : factor(factor) + explicit Scale(const double factor) + : factor(factor) {} Point operator()(const Point p) const @@ -930,8 +935,9 @@ namespace GridTools almost_infinite_length); // also note if a vertex is at the boundary - std::vector at_boundary( - keep_boundary ? triangulation.n_vertices() : 0, false); + std::vector at_boundary(keep_boundary ? triangulation.n_vertices() : + 0, + false); // for parallel::shared::Triangulation we need to work on all vertices, // not just the ones related to loacally owned cells; const bool is_parallel_shared = @@ -957,10 +963,12 @@ namespace GridTools at_boundary[line->vertex_index(1)] = true; } - minimal_length[line->vertex_index(0)] = std::min( - line->diameter(), minimal_length[line->vertex_index(0)]); - minimal_length[line->vertex_index(1)] = std::min( - line->diameter(), minimal_length[line->vertex_index(1)]); + minimal_length[line->vertex_index(0)] = + std::min(line->diameter(), + minimal_length[line->vertex_index(0)]); + minimal_length[line->vertex_index(1)] = + std::min(line->diameter(), + minimal_length[line->vertex_index(1)]); } } else // dim==1 @@ -970,10 +978,12 @@ namespace GridTools if (cell->at_boundary(vertex) == true) at_boundary[cell->vertex_index(vertex)] = true; - minimal_length[cell->vertex_index(0)] = std::min( - cell->diameter(), minimal_length[cell->vertex_index(0)]); - minimal_length[cell->vertex_index(1)] = std::min( - cell->diameter(), minimal_length[cell->vertex_index(1)]); + minimal_length[cell->vertex_index(0)] = + std::min(cell->diameter(), + minimal_length[cell->vertex_index(0)]); + minimal_length[cell->vertex_index(1)] = + std::min(cell->diameter(), + minimal_length[cell->vertex_index(1)]); } } @@ -1155,10 +1165,10 @@ namespace GridTools const std::vector> &vertices = tria.get_vertices(); - Assert( - tria.get_vertices().size() == marked_vertices.size() || - marked_vertices.size() == 0, - ExcDimensionMismatch(tria.get_vertices().size(), marked_vertices.size())); + Assert(tria.get_vertices().size() == marked_vertices.size() || + marked_vertices.size() == 0, + ExcDimensionMismatch(tria.get_vertices().size(), + marked_vertices.size())); // If p is an element of marked_vertices, // and q is that of used_Vertices, @@ -1236,10 +1246,10 @@ namespace GridTools auto vertices = extract_used_vertices(tria, mapping); - Assert( - tria.get_vertices().size() == marked_vertices.size() || - marked_vertices.size() == 0, - ExcDimensionMismatch(tria.get_vertices().size(), marked_vertices.size())); + Assert(tria.get_vertices().size() == marked_vertices.size() || + marked_vertices.size() == 0, + ExcDimensionMismatch(tria.get_vertices().size(), + marked_vertices.size())); // If p is an element of marked_vertices, // and q is that of used_Vertices, @@ -1552,8 +1562,9 @@ namespace GridTools vertex_to_cell_centers[closest_vertex_index]); }; - std::sort( - neighbor_permutation.begin(), neighbor_permutation.end(), comp); + std::sort(neighbor_permutation.begin(), + neighbor_permutation.end(), + comp); // It is possible the vertex is close // to an edge, thus we add a tolerance // setting it initially to 1e-10 @@ -1836,9 +1847,9 @@ namespace GridTools ExcMessage("Error: couldn't merge bounding boxes!")); } } - Assert( - merged_b_boxes.size() <= max_boxes, - ExcMessage("Error: couldn't reach target number of bounding boxes!")); + Assert(merged_b_boxes.size() <= max_boxes, + ExcMessage( + "Error: couldn't reach target number of bounding boxes!")); return merged_b_boxes; } } @@ -1874,9 +1885,9 @@ namespace GridTools break; // We can check now the next process } } - Assert( - owners_found.size() > 0, - ExcMessage("No owners found for the point " + std::to_string(pt))); + Assert(owners_found.size() > 0, + ExcMessage("No owners found for the point " + + std::to_string(pt))); if (owners_found.size() == 1) map_owners_found[pt] = owners_found[0]; else @@ -2003,8 +2014,9 @@ namespace GridTools adjacent_cell = vertex_to_cell[cell->vertex_index(i)].begin(), end_adj_cell = vertex_to_cell[cell->vertex_index(i)].end(); for (; adjacent_cell != end_adj_cell; ++adjacent_cell) - lowest_subdomain_id = std::min( - lowest_subdomain_id, (*adjacent_cell)->subdomain_id()); + lowest_subdomain_id = + std::min(lowest_subdomain_id, + (*adjacent_cell)->subdomain_id()); // See if I "own" this vertex if (lowest_subdomain_id == cell->subdomain_id()) @@ -2326,8 +2338,9 @@ namespace GridTools cell = triangulation.begin_active(); cell != triangulation.end(); ++cell) - indexmap[std::pair( - cell->level(), cell->index())] = cell->active_cell_index(); + indexmap[std::pair(cell->level(), + cell->index())] = + cell->active_cell_index(); // next loop over all cells and their neighbors to build the sparsity // pattern. note that it's a bit hard to enter all the connections when a @@ -2456,8 +2469,10 @@ namespace GridTools } // Call the other more general function - partition_triangulation( - n_partitions, cell_weights, triangulation, partitioner); + partition_triangulation(n_partitions, + cell_weights, + triangulation, + partitioner); } @@ -2665,8 +2680,9 @@ namespace GridTools std::vector p4est_tree_to_coarse_cell_permutation; DynamicSparsityPattern cell_connectivity; - GridTools::get_vertex_connectivity_of_cells_on_level( - triangulation, 0, cell_connectivity); + GridTools::get_vertex_connectivity_of_cells_on_level(triangulation, + 0, + cell_connectivity); coarse_cell_to_p4est_tree_permutation.resize(triangulation.n_cells(0)); SparsityTools::reorder_hierarchical(cell_connectivity, coarse_cell_to_p4est_tree_permutation); @@ -2770,9 +2786,9 @@ namespace GridTools get_subdomain_association(const Triangulation &triangulation, std::vector & subdomain) { - Assert( - subdomain.size() == triangulation.n_active_cells(), - ExcDimensionMismatch(subdomain.size(), triangulation.n_active_cells())); + Assert(subdomain.size() == triangulation.n_active_cells(), + ExcDimensionMismatch(subdomain.size(), + triangulation.n_active_cells())); for (typename Triangulation::active_cell_iterator cell = triangulation.begin_active(); cell != triangulation.end(); @@ -3124,8 +3140,9 @@ namespace GridTools ++e) diameter = std::min( diameter, - get_face_midpoint( - object, f, std::integral_constant()) + get_face_midpoint(object, + f, + std::integral_constant()) .distance(get_face_midpoint( object, e, std::integral_constant()))); @@ -3441,8 +3458,10 @@ namespace GridTools reset_boundary_ids ? std::vector(src_boundary_ids.size(), 0) : src_boundary_ids; - map_boundary_to_manifold_ids( - src_boundary_ids, dst_manifold_ids, tria, reset_boundary_id); + map_boundary_to_manifold_ids(src_boundary_ids, + dst_manifold_ids, + tria, + reset_boundary_id); } @@ -3538,8 +3557,9 @@ namespace GridTools for (unsigned int f = 0; f < GeometryInfo::faces_per_cell; ++f) { if (cell->at_boundary(f) == false) - cell->face(f)->set_manifold_id(std::min( - cell->material_id(), cell->neighbor(f)->material_id())); + cell->face(f)->set_manifold_id( + std::min(cell->material_id(), + cell->neighbor(f)->material_id())); else cell->face(f)->set_manifold_id(cell->material_id()); } @@ -3937,8 +3957,9 @@ namespace GridTools subcelldata_to_add.boundary_quads.push_back(quad); } } - GridTools::delete_unused_vertices( - vertices, cells_to_add, subcelldata_to_add); + GridTools::delete_unused_vertices(vertices, + cells_to_add, + subcelldata_to_add); GridReordering::reorder_cells(cells_to_add, true); // Save manifolds @@ -4262,16 +4283,20 @@ namespace GridTools auto &cell_maps = std::get<1>(current_c.first->second); auto &cell_pts = std::get<2>(current_c.first->second); auto &cell_ranks = std::get<3>(current_c.first->second); - cell_qpts.insert( - cell_qpts.end(), in_qpoints[c].begin(), in_qpoints[c].end()); - cell_maps.insert( - cell_maps.end(), in_maps[c].begin(), in_maps[c].end()); - cell_pts.insert( - cell_pts.end(), in_points[c].begin(), in_points[c].end()); + cell_qpts.insert(cell_qpts.end(), + in_qpoints[c].begin(), + in_qpoints[c].end()); + cell_maps.insert(cell_maps.end(), + in_maps[c].begin(), + in_maps[c].end()); + cell_pts.insert(cell_pts.end(), + in_points[c].begin(), + in_points[c].end()); std::vector ranks_tmp(in_points[c].size(), in_rank); - cell_ranks.insert( - cell_ranks.end(), ranks_tmp.begin(), ranks_tmp.end()); + cell_ranks.insert(cell_ranks.end(), + ranks_tmp.begin(), + ranks_tmp.end()); } } } @@ -4414,8 +4439,9 @@ namespace GridTools std::vector> in_maps; std::vector>> in_points; - auto cpt_loc_pts = compute_point_locations_unmap( - cache, rank_and_points.second.first); + auto cpt_loc_pts = + compute_point_locations_unmap(cache, + rank_and_points.second.first); for (const auto &map_c_pt_idx : cpt_loc_pts) { // Human-readable variables: @@ -4616,8 +4642,9 @@ namespace GridTools { const auto &point_idx = pt_to_guesses.first; const auto &probable_owners_rks = pt_to_guesses.second; - if (!std::binary_search( - classified_pts.begin(), classified_pts.end(), point_idx)) + if (!std::binary_search(classified_pts.begin(), + classified_pts.end(), + point_idx)) // The point wasn't found in ghost or locally owned cells: adding it // to the map for (unsigned int i = 0; i < probable_owners_rks.size(); ++i) @@ -4660,8 +4687,10 @@ namespace GridTools // Step 6: use compute point locations on the uncertain points and // merge output - internal::distributed_cptloc::compute_and_merge_from_map( - cache, check_pts, temporary_unmap, true); + internal::distributed_cptloc::compute_and_merge_from_map(cache, + check_pts, + temporary_unmap, + true); // Copying data from the unordered map to the tuple // and returning output @@ -4763,9 +4792,9 @@ namespace GridTools #ifndef DEAL_II_WITH_MPI (void)local_bboxes; (void)mpi_communicator; - Assert( - false, - ExcMessage("GridTools::exchange_local_bounding_boxes() requires MPI.")); + Assert(false, + ExcMessage( + "GridTools::exchange_local_bounding_boxes() requires MPI.")); return {}; #else // Step 1: preparing data to be sent diff --git a/source/grid/grid_tools_cache.cc b/source/grid/grid_tools_cache.cc index 78c50c405c..05698a7cce 100644 --- a/source/grid/grid_tools_cache.cc +++ b/source/grid/grid_tools_cache.cc @@ -22,10 +22,10 @@ namespace GridTools { template Cache::Cache(const Triangulation &tria, - const Mapping & mapping) : - update_flags(update_all), - tria(&tria), - mapping(&mapping) + const Mapping & mapping) + : update_flags(update_all) + , tria(&tria) + , mapping(&mapping) { tria_signal = tria.signals.any_change.connect([&]() { mark_for_update(update_all); }); diff --git a/source/grid/grid_tools_dof_handlers.cc b/source/grid/grid_tools_dof_handlers.cc index 60bab1cffd..578353c464 100644 --- a/source/grid/grid_tools_dof_handlers.cc +++ b/source/grid/grid_tools_dof_handlers.cc @@ -65,10 +65,10 @@ namespace GridTools const std::vector> &vertices = tria.get_vertices(); - Assert( - tria.get_vertices().size() == marked_vertices.size() || - marked_vertices.size() == 0, - ExcDimensionMismatch(tria.get_vertices().size(), marked_vertices.size())); + Assert(tria.get_vertices().size() == marked_vertices.size() || + marked_vertices.size() == 0, + ExcDimensionMismatch(tria.get_vertices().size(), + marked_vertices.size())); // If p is an element of marked_vertices, // and q is that of used_Vertices, @@ -146,10 +146,10 @@ namespace GridTools auto vertices = extract_used_vertices(tria, mapping); - Assert( - tria.get_vertices().size() == marked_vertices.size() || - marked_vertices.size() == 0, - ExcDimensionMismatch(tria.get_vertices().size(), marked_vertices.size())); + Assert(tria.get_vertices().size() == marked_vertices.size() || + marked_vertices.size() == 0, + ExcDimensionMismatch(tria.get_vertices().size(), + marked_vertices.size())); // If p is an element of marked_vertices, // and q is that of used_Vertices, @@ -1052,8 +1052,9 @@ namespace GridTools const std::vector ghost_cell_layer_within_distance = - compute_active_cell_layer_within_distance( - mesh, predicate, layer_thickness); + compute_active_cell_layer_within_distance(mesh, + predicate, + layer_thickness); // Check that we never return locally owned or artificial cells // What is left should only be the ghost cells @@ -2164,11 +2165,11 @@ namespace GridTools const unsigned int size_new = matched_pairs.size(); for (unsigned int i = size_old; i < size_new; ++i) { - Assert( - matched_pairs[i].orientation == 1, - ExcMessage("Found a face match with non standard orientation. " - "This function is only suitable for meshes with cells " - "in default orientation")); + Assert(matched_pairs[i].orientation == 1, + ExcMessage( + "Found a face match with non standard orientation. " + "This function is only suitable for meshes with cells " + "in default orientation")); } #endif } diff --git a/source/grid/intergrid_map.cc b/source/grid/intergrid_map.cc index 2290eea6de..2fbe6a4dfb 100644 --- a/source/grid/intergrid_map.cc +++ b/source/grid/intergrid_map.cc @@ -34,9 +34,9 @@ DEAL_II_NAMESPACE_OPEN template -InterGridMap::InterGridMap() : - source_grid(nullptr, typeid(*this).name()), - destination_grid(nullptr, typeid(*this).name()) +InterGridMap::InterGridMap() + : source_grid(nullptr, typeid(*this).name()) + , destination_grid(nullptr, typeid(*this).name()) {} diff --git a/source/grid/manifold.cc b/source/grid/manifold.cc index 77d38e74ce..6853c082b7 100644 --- a/source/grid/manifold.cc +++ b/source/grid/manifold.cc @@ -69,9 +69,9 @@ Manifold::get_new_point( Assert(n_points > 0, ExcMessage("There should be at least one point.")); - Assert( - n_points == weights.size(), - ExcMessage("There should be as many surrounding points as weights given.")); + Assert(n_points == weights.size(), + ExcMessage( + "There should be as many surrounding points as weights given.")); Assert(std::abs(std::accumulate(weights.begin(), weights.end(), 0.0) - 1.0) < tol, @@ -101,8 +101,9 @@ Manifold::get_new_point( weight = w / (weights[permutation[i]] + w); if (std::abs(weight) > 1e-14) - p = get_intermediate_point( - p, surrounding_points[permutation[i]], 1.0 - weight); + p = get_intermediate_point(p, + surrounding_points[permutation[i]], + 1.0 - weight); w += weights[permutation[i]]; } @@ -122,9 +123,10 @@ Manifold::get_new_points( for (unsigned int row = 0; row < weights.size(0); ++row) { - new_points[row] = get_new_point( - make_array_view(surrounding_points.begin(), surrounding_points.end()), - make_array_view(weights, row)); + new_points[row] = + get_new_point(make_array_view(surrounding_points.begin(), + surrounding_points.end()), + make_array_view(weights, row)); } } @@ -309,10 +311,10 @@ Manifold::get_new_point_on_line( const typename Triangulation::line_iterator &line) const { const auto points_weights = get_default_points_and_weights(line); - return get_new_point( - make_array_view(points_weights.first.begin(), points_weights.first.end()), - make_array_view(points_weights.second.begin(), - points_weights.second.end())); + return get_new_point(make_array_view(points_weights.first.begin(), + points_weights.first.end()), + make_array_view(points_weights.second.begin(), + points_weights.second.end())); } @@ -323,10 +325,10 @@ Manifold::get_new_point_on_quad( const typename Triangulation::quad_iterator &quad) const { const auto points_weights = get_default_points_and_weights(quad); - return get_new_point( - make_array_view(points_weights.first.begin(), points_weights.first.end()), - make_array_view(points_weights.second.begin(), - points_weights.second.end())); + return get_new_point(make_array_view(points_weights.first.begin(), + points_weights.first.end()), + make_array_view(points_weights.second.begin(), + points_weights.second.end())); } @@ -454,10 +456,10 @@ Manifold<3, 3>::get_new_point_on_hex( const Triangulation<3, 3>::hex_iterator &hex) const { const auto points_weights = get_default_points_and_weights(hex, true); - return get_new_point( - make_array_view(points_weights.first.begin(), points_weights.first.end()), - make_array_view(points_weights.second.begin(), - points_weights.second.end())); + return get_new_point(make_array_view(points_weights.first.begin(), + points_weights.first.end()), + make_array_view(points_weights.second.begin(), + points_weights.second.end())); } @@ -508,9 +510,9 @@ namespace internal template FlatManifold::FlatManifold( const Tensor<1, spacedim> &periodicity, - const double tolerance) : - periodicity(periodicity), - tolerance(tolerance) + const double tolerance) + : periodicity(periodicity) + , tolerance(tolerance) {} @@ -552,11 +554,11 @@ FlatManifold::get_new_point( for (unsigned int i = 0; i < surrounding_points.size(); ++i) { minP[d] = std::min(minP[d], surrounding_points[i][d]); - Assert( - (surrounding_points[i][d] < - periodicity[d] + tolerance * periodicity[d]) || - (surrounding_points[i][d] >= -tolerance * periodicity[d]), - ExcPeriodicBox(d, surrounding_points[i], periodicity[d])); + Assert((surrounding_points[i][d] < + periodicity[d] + tolerance * periodicity[d]) || + (surrounding_points[i][d] >= + -tolerance * periodicity[d]), + ExcPeriodicBox(d, surrounding_points[i], periodicity[d])); } // compute the weighted average point, possibly taking into account @@ -659,9 +661,10 @@ FlatManifold::get_new_points( // TODO should this use surrounding_points_start or surrounding_points? // The older version used surrounding_points - new_points[row] = project_to_manifold( - make_array_view(surrounding_points.begin(), surrounding_points.end()), - new_point); + new_points[row] = + project_to_manifold(make_array_view(surrounding_points.begin(), + surrounding_points.end()), + new_point); } } @@ -779,8 +782,10 @@ FlatManifold<3>::get_normals_at_vertices( { const unsigned int vertices_per_face = GeometryInfo<3>::vertices_per_face; - static const unsigned int neighboring_vertices[4][2] = { - {1, 2}, {3, 0}, {0, 3}, {2, 1}}; + static const unsigned int neighboring_vertices[4][2] = {{1, 2}, + {3, 0}, + {0, 3}, + {2, 1}}; for (unsigned int vertex = 0; vertex < vertices_per_face; ++vertex) { // first define the two tangent vectors at the vertex by using the @@ -943,8 +948,8 @@ FlatManifold::normal_vector( /* -------------------------- ChartManifold --------------------- */ template ChartManifold::ChartManifold( - const Tensor<1, chartdim> &periodicity) : - sub_manifold(periodicity) + const Tensor<1, chartdim> &periodicity) + : sub_manifold(periodicity) {} @@ -1042,10 +1047,10 @@ ChartManifold::get_tangent_vector( // determinant is the product of chartdim factors, take the // chartdim-th root of it in comparing against the size of the // derivative - Assert( - std::pow(std::abs(F_prime.determinant()), 1. / chartdim) >= - 1e-12 * F_prime.norm(), - ExcMessage("The derivative of a chart function must not be singular.")); + Assert(std::pow(std::abs(F_prime.determinant()), 1. / chartdim) >= + 1e-12 * F_prime.norm(), + ExcMessage( + "The derivative of a chart function must not be singular.")); const Tensor<1, chartdim> delta = sub_manifold.get_tangent_vector(pull_back(x1), pull_back(x2)); diff --git a/source/grid/manifold_lib.cc b/source/grid/manifold_lib.cc index 6e3c4d8932..af6d2834ea 100644 --- a/source/grid/manifold_lib.cc +++ b/source/grid/manifold_lib.cc @@ -118,10 +118,10 @@ namespace internal // ============================================================ template -PolarManifold::PolarManifold(const Point center) : - ChartManifold( - PolarManifold::get_periodicity()), - center(center) +PolarManifold::PolarManifold(const Point center) + : ChartManifold( + PolarManifold::get_periodicity()) + , center(center) {} @@ -279,9 +279,9 @@ PolarManifold::push_forward_gradient( template SphericalManifold::SphericalManifold( - const Point center) : - center(center), - polar_manifold(center) + const Point center) + : center(center) + , polar_manifold(center) {} @@ -434,8 +434,9 @@ SphericalManifold::normal_vector( } const auto minmax_distance = std::minmax_element(distances_to_center.begin(), distances_to_center.end()); - const auto min_distance_to_first_vertex = std::min_element( - distances_to_first_vertex.begin(), distances_to_first_vertex.end()); + const auto min_distance_to_first_vertex = + std::min_element(distances_to_first_vertex.begin(), + distances_to_first_vertex.end()); if (*minmax_distance.second - *minmax_distance.first < 1.e-10 * *min_distance_to_first_vertex) @@ -495,8 +496,9 @@ SphericalManifold::get_normals_at_vertices( } const auto minmax_distance = std::minmax_element(distances_to_center.begin(), distances_to_center.end()); - const auto min_distance_to_first_vertex = std::min_element( - distances_to_first_vertex.begin(), distances_to_first_vertex.end()); + const auto min_distance_to_first_vertex = + std::min_element(distances_to_first_vertex.begin(), + distances_to_first_vertex.end()); if (*minmax_distance.second - *minmax_distance.first < 1.e-10 * *min_distance_to_first_vertex) @@ -536,8 +538,9 @@ SphericalManifold::get_new_point( // To avoid duplicating all of the logic in get_new_points, simply call it // for one position. Point new_point; - get_new_points( - vertices, weights, make_array_view(&new_point, &new_point + 1)); + get_new_points(vertices, + weights, + make_array_view(&new_point, &new_point + 1)); return new_point; } @@ -725,8 +728,9 @@ SphericalManifold::get_new_points( const ArrayView> array_merged_directions = make_array_view(merged_directions.begin(), merged_directions.begin() + n_unique_directions); - const ArrayView array_merged_distances = make_array_view( - merged_distances.begin(), merged_distances.begin() + n_unique_directions); + const ArrayView array_merged_distances = + make_array_view(merged_distances.begin(), + merged_distances.begin() + n_unique_directions); for (unsigned int row = 0; row < weight_rows; ++row) if (!accurate_point_was_found[row]) @@ -835,8 +839,10 @@ namespace SphericalManifold<3, 3> unit_manifold; Assert(std::abs(weights[0] + weights[1] - 1.0) < 1e-13, ExcMessage("Weights do not sum up to 1")); - Point<3> intermediate = unit_manifold.get_intermediate_point( - Point<3>(directions[0]), Point<3>(directions[1]), weights[1]); + Point<3> intermediate = + unit_manifold.get_intermediate_point(Point<3>(directions[0]), + Point<3>(directions[1]), + weights[1]); return intermediate; } @@ -978,12 +984,11 @@ SphericalManifold<3, 3>::get_new_point( // CylindricalManifold // ============================================================ template -CylindricalManifold::CylindricalManifold( - const unsigned int axis, - const double tolerance) : - CylindricalManifold(Point::unit_vector(axis), - Point(), - tolerance) +CylindricalManifold::CylindricalManifold(const unsigned int axis, + const double tolerance) + : CylindricalManifold(Point::unit_vector(axis), + Point(), + tolerance) { // do not use static_assert to make dimension-independent programming // easier. @@ -997,12 +1002,12 @@ template CylindricalManifold::CylindricalManifold( const Tensor<1, spacedim> &direction, const Point & point_on_axis, - const double tolerance) : - ChartManifold(Tensor<1, 3>({0, 2. * numbers::PI, 0})), - normal_direction(internal::compute_normal(direction, true)), - direction(direction / direction.norm()), - point_on_axis(point_on_axis), - tolerance(tolerance) + const double tolerance) + : ChartManifold(Tensor<1, 3>({0, 2. * numbers::PI, 0})) + , normal_direction(internal::compute_normal(direction, true)) + , direction(direction / direction.norm()) + , point_on_axis(point_on_axis) + , tolerance(tolerance) { // do not use static_assert to make dimension-independent programming // easier. @@ -1151,13 +1156,13 @@ FunctionManifold::FunctionManifold( const Function & push_forward_function, const Function & pull_back_function, const Tensor<1, chartdim> &periodicity, - const double tolerance) : - ChartManifold(periodicity), - push_forward_function(&push_forward_function), - pull_back_function(&pull_back_function), - tolerance(tolerance), - owns_pointers(false), - finite_difference_step(0) + const double tolerance) + : ChartManifold(periodicity) + , push_forward_function(&push_forward_function) + , pull_back_function(&pull_back_function) + , tolerance(tolerance) + , owns_pointers(false) + , finite_difference_step(0) { AssertDimension(push_forward_function.n_components, spacedim); AssertDimension(pull_back_function.n_components, chartdim); @@ -1174,16 +1179,16 @@ FunctionManifold::FunctionManifold( const std::string chart_vars, const std::string space_vars, const double tolerance, - const double h) : - ChartManifold(periodicity), - const_map(const_map), - tolerance(tolerance), - owns_pointers(true), - push_forward_expression(push_forward_expression), - pull_back_expression(pull_back_expression), - chart_vars(chart_vars), - space_vars(space_vars), - finite_difference_step(h) + const double h) + : ChartManifold(periodicity) + , const_map(const_map) + , tolerance(tolerance) + , owns_pointers(true) + , push_forward_expression(push_forward_expression) + , pull_back_expression(pull_back_expression) + , chart_vars(chart_vars) + , space_vars(space_vars) + , finite_difference_step(h) { FunctionParser *pf = new FunctionParser(spacedim, 0.0, h); FunctionParser *pb = new FunctionParser(chartdim, 0.0, h); @@ -1344,10 +1349,10 @@ TorusManifold::push_forward(const Point<3> &chart_point) const template -TorusManifold::TorusManifold(const double R, const double r) : - ChartManifold(Point<3>(2 * numbers::PI, 2 * numbers::PI, 0.0)), - r(r), - R(R) +TorusManifold::TorusManifold(const double R, const double r) + : ChartManifold(Point<3>(2 * numbers::PI, 2 * numbers::PI, 0.0)) + , r(r) + , R(R) { Assert(R > r, ExcMessage("Outer radius R must be greater than the inner " @@ -1398,9 +1403,9 @@ TorusManifold::push_forward_gradient(const Point<3> &chart_point) const // ============================================================ template TransfiniteInterpolationManifold::TransfiniteInterpolationManifold() : - triangulation(nullptr), - level_coarse(-1) + spacedim>::TransfiniteInterpolationManifold() + : triangulation(nullptr) + , level_coarse(-1) { AssertThrow(dim > 1, ExcNotImplemented()); } @@ -1544,10 +1549,12 @@ namespace if (line_manifold_id == my_manifold_id || line_manifold_id == numbers::invalid_manifold_id) { - weights_vertices[GeometryInfo<2>::line_to_cell_vertices( - line, 0)] -= my_weight * (1. - line_point); - weights_vertices[GeometryInfo<2>::line_to_cell_vertices( - line, 1)] -= my_weight * line_point; + weights_vertices[GeometryInfo<2>::line_to_cell_vertices(line, + 0)] -= + my_weight * (1. - line_point); + weights_vertices[GeometryInfo<2>::line_to_cell_vertices(line, + 1)] -= + my_weight * line_point; } else { @@ -1747,10 +1754,12 @@ namespace if (line_manifold_id == my_manifold_id || line_manifold_id == numbers::invalid_manifold_id) { - weights_vertices[GeometryInfo<3>::line_to_cell_vertices( - line, 0)] -= my_weight * (1. - line_point); - weights_vertices[GeometryInfo<3>::line_to_cell_vertices( - line, 1)] -= my_weight * (line_point); + weights_vertices[GeometryInfo<3>::line_to_cell_vertices(line, + 0)] -= + my_weight * (1. - line_point); + weights_vertices[GeometryInfo<3>::line_to_cell_vertices(line, + 1)] -= + my_weight * (line_point); } else { @@ -1790,8 +1799,9 @@ TransfiniteInterpolationManifold::push_forward( Assert(GeometryInfo::is_inside_unit_cell(chart_point, 1e-6), ExcMessage("chart_point is not in unit interval")); - return compute_transfinite_interpolation( - *cell, chart_point, coarse_cell_is_flat[cell->index()]); + return compute_transfinite_interpolation(*cell, + chart_point, + coarse_cell_is_flat[cell->index()]); } @@ -1813,8 +1823,9 @@ TransfiniteInterpolationManifold::push_forward_gradient( // avoid checking outside of the unit interval modified[d] += step; Tensor<1, spacedim> difference = - compute_transfinite_interpolation( - *cell, modified, coarse_cell_is_flat[cell->index()]) - + compute_transfinite_interpolation(*cell, + modified, + coarse_cell_is_flat[cell->index()]) - pushed_forward_chart_point; for (unsigned int e = 0; e < spacedim; ++e) grad[e][d] = difference[e] / step; @@ -1845,8 +1856,10 @@ TransfiniteInterpolationManifold::pull_back( // as those are relatively expensive and failure occurs quite regularly in // the implementation of the compute_chart_points method. Tensor<1, spacedim> residual = - point - compute_transfinite_interpolation( - *cell, chart_point, coarse_cell_is_flat[cell->index()]); + point - + compute_transfinite_interpolation(*cell, + chart_point, + coarse_cell_is_flat[cell->index()]); const double tolerance = 1e-21 * Utilities::fixed_power<2>(cell->diameter()); double residual_norm_square = residual.norm_square(); DerivativeForm<1, dim, spacedim> inv_grad; @@ -1881,8 +1894,10 @@ TransfiniteInterpolationManifold::pull_back( // chart region. Note that the Jacobian here represents the // derivative of the forward map and should have a positive // determinant since we use properly oriented meshes. - DerivativeForm<1, dim, spacedim> grad = push_forward_gradient( - cell, chart_point, Point(point - residual)); + DerivativeForm<1, dim, spacedim> grad = + push_forward_gradient(cell, + chart_point, + Point(point - residual)); if (grad.determinant() <= 0.0) return outside; inv_grad = grad.covariant_form(); @@ -1897,9 +1912,10 @@ TransfiniteInterpolationManifold::pull_back( // check if point is inside 1.2 times the unit cell to avoid // hitting points very far away from valid ones in the manifolds - while (!GeometryInfo::is_inside_unit_cell( - chart_point + alpha * update, 0.2) && - alpha > 1e-7) + while ( + !GeometryInfo::is_inside_unit_cell(chart_point + alpha * update, + 0.2) && + alpha > 1e-7) alpha *= 0.5; const Tensor<1, spacedim> old_residual = residual; @@ -2240,13 +2256,13 @@ TransfiniteInterpolationManifold::compute_chart_points( message << "Transformation to chart coordinates: " << std::endl; for (unsigned int i = 0; i < surrounding_points.size(); ++i) { - message << surrounding_points[i] << " -> " - << pull_back( - cell, - surrounding_points[i], - cell->real_to_unit_cell_affine_approximation( - surrounding_points[i])) - << std::endl; + message + << surrounding_points[i] << " -> " + << pull_back(cell, + surrounding_points[i], + cell->real_to_unit_cell_affine_approximation( + surrounding_points[i])) + << std::endl; } } @@ -2303,10 +2319,10 @@ TransfiniteInterpolationManifold::get_new_points( boost::container::small_vector, 100> new_points_on_chart( weights.size(0)); - chart_manifold.get_new_points( - chart_points_view, - weights, - make_array_view(new_points_on_chart.begin(), new_points_on_chart.end())); + chart_manifold.get_new_points(chart_points_view, + weights, + make_array_view(new_points_on_chart.begin(), + new_points_on_chart.end())); for (unsigned int row = 0; row < weights.size(0); ++row) new_points[row] = push_forward(cell, new_points_on_chart[row]); diff --git a/source/grid/persistent_tria.cc b/source/grid/persistent_tria.cc index ae551f2967..2309be67e0 100644 --- a/source/grid/persistent_tria.cc +++ b/source/grid/persistent_tria.cc @@ -32,22 +32,22 @@ const unsigned int PersistentTriangulation::spacedimension; template PersistentTriangulation::PersistentTriangulation( - const Triangulation &coarse_grid) : - coarse_grid(&coarse_grid, typeid(*this).name()) + const Triangulation &coarse_grid) + : coarse_grid(&coarse_grid, typeid(*this).name()) {} template PersistentTriangulation::PersistentTriangulation( - const PersistentTriangulation &old_tria) : - // default initialize - // tria, i.e. it will be - // empty on first use - Triangulation(), - coarse_grid(old_tria.coarse_grid), - refine_flags(old_tria.refine_flags), - coarsen_flags(old_tria.coarsen_flags) + const PersistentTriangulation &old_tria) + : // default initialize + // tria, i.e. it will be + // empty on first use + Triangulation() + , coarse_grid(old_tria.coarse_grid) + , refine_flags(old_tria.refine_flags) + , coarsen_flags(old_tria.coarsen_flags) { Assert(old_tria.n_levels() == 0, ExcTriaNotEmpty()); } diff --git a/source/grid/tria.cc b/source/grid/tria.cc index b5826e91a6..7bece82c99 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -62,7 +62,10 @@ namespace internal { namespace TriangulationImplementation { - NumberCache<1>::NumberCache() : n_levels(0), n_lines(0), n_active_lines(0) + NumberCache<1>::NumberCache() + : n_levels(0) + , n_lines(0) + , n_active_lines(0) // all other fields are // default constructed {} @@ -80,7 +83,9 @@ namespace internal } - NumberCache<2>::NumberCache() : n_quads(0), n_active_quads(0) + NumberCache<2>::NumberCache() + : n_quads(0) + , n_active_quads(0) // all other fields are // default constructed {} @@ -99,7 +104,9 @@ namespace internal - NumberCache<3>::NumberCache() : n_hexes(0), n_active_hexes(0) + NumberCache<3>::NumberCache() + : n_hexes(0) + , n_active_hexes(0) // all other fields are // default constructed {} @@ -377,8 +384,9 @@ namespace const unsigned int face_no, RefinementCase &expected_face_ref_case) { - return face_will_be_refined_by_neighbor_internal( - cell, face_no, expected_face_ref_case); + return face_will_be_refined_by_neighbor_internal(cell, + face_no, + expected_face_ref_case); } @@ -1690,8 +1698,9 @@ namespace internal // throw an exception if no such cells should exist. if (!triangulation.check_for_distorted_cells) { - const double cell_measure = GridTools::cell_measure<1>( - triangulation.vertices, cells[cell_no].vertices); + const double cell_measure = + GridTools::cell_measure<1>(triangulation.vertices, + cells[cell_no].vertices); AssertThrow(cell_measure > 0, ExcGridHasInvalidCell(cell_no)); } @@ -1890,8 +1899,9 @@ namespace internal // See the note in the 1D function on this if statement. if (!triangulation.check_for_distorted_cells) { - const double cell_measure = GridTools::cell_measure<2>( - triangulation.vertices, cells[cell_no].vertices); + const double cell_measure = + GridTools::cell_measure<2>(triangulation.vertices, + cells[cell_no].vertices); AssertThrow(cell_measure > 0, ExcGridHasInvalidCell(cell_no)); } @@ -1986,13 +1996,13 @@ namespace internal // is at least two. if not so, // then clean triangulation and // exit with an exception - AssertThrow( - *(std::min_element(vertex_touch_count.begin(), - vertex_touch_count.end())) >= 2, - ExcMessage("During creation of a triangulation, a part of the " - "algorithm encountered a vertex that is part of only " - "a single adjacent line. However, in 2d, every vertex " - "needs to be at least part of two lines.")); + AssertThrow(*(std::min_element(vertex_touch_count.begin(), + vertex_touch_count.end())) >= 2, + ExcMessage( + "During creation of a triangulation, a part of the " + "algorithm encountered a vertex that is part of only " + "a single adjacent line. However, in 2d, every vertex " + "needs to be at least part of two lines.")); } // reserve enough space @@ -2122,8 +2132,9 @@ namespace internal for (; boundary_line != end_boundary_line; ++boundary_line) { typename Triangulation::line_iterator line; - std::pair line_vertices(std::make_pair( - boundary_line->vertices[0], boundary_line->vertices[1])); + std::pair line_vertices( + std::make_pair(boundary_line->vertices[0], + boundary_line->vertices[1])); if (needed_lines.find(line_vertices) != needed_lines.end()) // line found in this direction line = needed_lines[line_vertices]; @@ -2141,11 +2152,11 @@ namespace internal } // assert that we only set boundary info once - AssertThrow( - !(line->boundary_id() != 0 && - line->boundary_id() != numbers::internal_face_boundary_id), - ExcMultiplySetLineInfoOfLine(line_vertices.first, - line_vertices.second)); + AssertThrow(!(line->boundary_id() != 0 && + line->boundary_id() != + numbers::internal_face_boundary_id), + ExcMultiplySetLineInfoOfLine(line_vertices.first, + line_vertices.second)); // Assert that only exterior lines are given a boundary // indicator; however, it is possible that someone may @@ -2285,8 +2296,9 @@ namespace internal // See the note in the 1D function on this if statement. if (!triangulation.check_for_distorted_cells) { - const double cell_measure = GridTools::cell_measure<3>( - triangulation.vertices, cells[cell_no].vertices); + const double cell_measure = + GridTools::cell_measure<3>(triangulation.vertices, + cells[cell_no].vertices); AssertThrow(cell_measure > 0, ExcGridHasInvalidCell(cell_no)); } } @@ -2572,48 +2584,48 @@ namespace internal // later set the // face_orientation flag const internal::TriangulationImplementation::TriaObject<2> - test_quad_1( - quad.face(2), - quad.face(3), - quad.face(0), - quad.face(1)), // face_orientation=false, face_flip=false, - // face_rotation=false - test_quad_2( - quad.face(0), - quad.face(1), - quad.face(3), - quad.face(2)), // face_orientation=false, face_flip=false, - // face_rotation=true - test_quad_3( - quad.face(3), - quad.face(2), - quad.face(1), - quad.face(0)), // face_orientation=false, face_flip=true, - // face_rotation=false - test_quad_4( - quad.face(1), - quad.face(0), - quad.face(2), - quad.face(3)), // face_orientation=false, face_flip=true, - // face_rotation=true - test_quad_5( - quad.face(2), - quad.face(3), - quad.face(1), - quad.face(0)), // face_orientation=true, face_flip=false, - // face_rotation=true - test_quad_6( - quad.face(1), - quad.face(0), - quad.face(3), - quad.face(2)), // face_orientation=true, face_flip=true, - // face_rotation=false - test_quad_7( - quad.face(3), - quad.face(2), - quad.face(0), - quad.face(1)); // face_orientation=true, face_flip=true, - // face_rotation=true + test_quad_1(quad.face(2), + quad.face(3), + quad.face(0), + quad.face( + 1)), // face_orientation=false, face_flip=false, + // face_rotation=false + test_quad_2(quad.face(0), + quad.face(1), + quad.face(3), + quad.face( + 2)), // face_orientation=false, face_flip=false, + // face_rotation=true + test_quad_3(quad.face(3), + quad.face(2), + quad.face(1), + quad.face( + 0)), // face_orientation=false, face_flip=true, + // face_rotation=false + test_quad_4(quad.face(1), + quad.face(0), + quad.face(2), + quad.face( + 3)), // face_orientation=false, face_flip=true, + // face_rotation=true + test_quad_5(quad.face(2), + quad.face(3), + quad.face(1), + quad.face( + 0)), // face_orientation=true, face_flip=false, + // face_rotation=true + test_quad_6(quad.face(1), + quad.face(0), + quad.face(3), + quad.face( + 2)), // face_orientation=true, face_flip=true, + // face_rotation=false + test_quad_7(quad.face(3), + quad.face(2), + quad.face(0), + quad.face( + 1)); // face_orientation=true, face_flip=true, + // face_rotation=true if (needed_quads.find(test_quad_1) == needed_quads.end() && needed_quads.find(test_quad_2) == needed_quads.end() && needed_quads.find(test_quad_3) == needed_quads.end() && @@ -2787,12 +2799,12 @@ namespace internal quad.face(1), quad.face(0)), // face_orientation=false, // face_flip=true, face_rotation=false - test_quad_4( - quad.face(1), - quad.face(0), - quad.face(2), - quad.face(3)), // face_orientation=false, - // face_flip=true, face_rotation=true + test_quad_4(quad.face(1), + quad.face(0), + quad.face(2), + quad.face( + 3)), // face_orientation=false, + // face_flip=true, face_rotation=true test_quad_5( quad.face(2), quad.face(3), @@ -2805,12 +2817,12 @@ namespace internal quad.face(3), quad.face(2)), // face_orientation=true, // face_flip=true, face_rotation=false - test_quad_7( - quad.face(3), - quad.face(2), - quad.face(0), - quad.face(1)); // face_orientation=true, - // face_flip=true, face_rotation=true + test_quad_7(quad.face(3), + quad.face(2), + quad.face(0), + quad.face( + 1)); // face_orientation=true, + // face_flip=true, face_rotation=true if (needed_quads.find(test_quad_1) != needed_quads.end()) { face_iterator[face] = needed_quads[test_quad_1].first; @@ -3066,8 +3078,9 @@ namespace internal for (; boundary_line != end_boundary_line; ++boundary_line) { typename Triangulation::line_iterator line; - std::pair line_vertices(std::make_pair( - boundary_line->vertices[0], boundary_line->vertices[1])); + std::pair line_vertices( + std::make_pair(boundary_line->vertices[0], + boundary_line->vertices[1])); if (needed_lines.find(line_vertices) != needed_lines.end()) // line found in this // direction @@ -3101,10 +3114,10 @@ namespace internal // different than the // previously set value if (line->boundary_id() != 0) - AssertThrow( - line->boundary_id() == boundary_line->boundary_id, - ExcMessage("Duplicate boundary lines are only allowed " - "if they carry the same boundary indicator.")); + AssertThrow(line->boundary_id() == boundary_line->boundary_id, + ExcMessage( + "Duplicate boundary lines are only allowed " + "if they carry the same boundary indicator.")); line->set_boundary_id_internal(boundary_line->boundary_id); // Set manifold id if given @@ -3135,9 +3148,8 @@ namespace internal boundary_quad ->vertices[GeometryInfo::line_to_cell_vertices(i, 0)], - boundary_quad - ->vertices[GeometryInfo::line_to_cell_vertices( - i, 1)]); + boundary_quad->vertices + [GeometryInfo::line_to_cell_vertices(i, 1)]); // check whether line // already exists @@ -3257,10 +3269,10 @@ namespace internal // different than the // previously set value if (quad->boundary_id() != 0) - AssertThrow( - quad->boundary_id() == boundary_quad->boundary_id, - ExcMessage("Duplicate boundary quads are only allowed " - "if they carry the same boundary indicator.")); + AssertThrow(quad->boundary_id() == boundary_quad->boundary_id, + ExcMessage( + "Duplicate boundary quads are only allowed " + "if they carry the same boundary indicator.")); quad->set_boundary_id_internal(boundary_quad->boundary_id); quad->set_manifold_id(boundary_quad->manifold_id); @@ -4694,10 +4706,11 @@ namespace internal // add to needed vertices how many // vertices are already in use - needed_vertices += std::count_if( - triangulation.vertices_used.begin(), - triangulation.vertices_used.end(), - std::bind(std::equal_to(), std::placeholders::_1, true)); + needed_vertices += std::count_if(triangulation.vertices_used.begin(), + triangulation.vertices_used.end(), + std::bind(std::equal_to(), + std::placeholders::_1, + true)); // if we need more vertices: create them, if not: leave the // array as is, since shrinking is not really possible because // some of the vertices at the end may be in use @@ -5044,10 +5057,11 @@ namespace internal triangulation.faces->lines.reserve_space(n_lines_in_pairs, 0); // add to needed vertices how many vertices are already in use - needed_vertices += std::count_if( - triangulation.vertices_used.begin(), - triangulation.vertices_used.end(), - std::bind(std::equal_to(), std::placeholders::_1, true)); + needed_vertices += std::count_if(triangulation.vertices_used.begin(), + triangulation.vertices_used.end(), + std::bind(std::equal_to(), + std::placeholders::_1, + true)); // if we need more vertices: create them, if not: leave the // array as is, since shrinking is not really possible because // some of the vertices at the end may be in use @@ -5413,13 +5427,12 @@ namespace internal // face. therefore we set the user_index // uniquely { - Assert( - aface->refinement_case() == - RefinementCase::isotropic_refinement || - aface->refinement_case() == - RefinementCase::no_refinement, - ExcInternalError()); + Assert(aface->refinement_case() == + RefinementCase< + dim - 1>::isotropic_refinement || + aface->refinement_case() == + RefinementCase::no_refinement, + ExcInternalError()); aface->set_user_index(face_ref_case); } } @@ -5525,10 +5538,11 @@ namespace internal // add to needed vertices how many vertices are already in use - needed_vertices += std::count_if( - triangulation.vertices_used.begin(), - triangulation.vertices_used.end(), - std::bind(std::equal_to(), std::placeholders::_1, true)); + needed_vertices += std::count_if(triangulation.vertices_used.begin(), + triangulation.vertices_used.end(), + std::bind(std::equal_to(), + std::placeholders::_1, + true)); // if we need more vertices: create them, if not: leave the // array as is, since shrinking is not really possible because // some of the vertices at the end may be in use @@ -5724,10 +5738,11 @@ namespace internal ExcInternalError()); // this quad needs to be refined anisotropically - Assert( - quad->user_index() == RefinementCase::cut_x || - quad->user_index() == RefinementCase::cut_y, - ExcInternalError()); + Assert(quad->user_index() == + RefinementCase::cut_x || + quad->user_index() == + RefinementCase::cut_y, + ExcInternalError()); // make the new line interior to the quad typename Triangulation::raw_line_iterator @@ -5994,9 +6009,9 @@ namespace internal new_child[i]->set( internal::TriangulationImplementation:: - TriaObject<1>( - old_child[i]->vertex_index(0), - old_child[i]->vertex_index(1))); + TriaObject<1>(old_child[i]->vertex_index(0), + old_child[i]->vertex_index( + 1))); new_child[i]->set_boundary_id_internal( old_child[i]->boundary_id()); new_child[i]->set_manifold_id( @@ -7577,10 +7592,10 @@ namespace internal // first, create the new internal line new_lines[0]->set( internal::TriangulationImplementation::TriaObject< - 1>( - middle_vertex_index(hex->face(4)), - middle_vertex_index( - hex->face(5)))); + 1>(middle_vertex_index( + hex->face(4)), + middle_vertex_index( + hex->face(5)))); // again, first collect some data about the // indices of the lines, with the following @@ -8022,10 +8037,10 @@ namespace internal // first, create the new internal line new_lines[0]->set( internal::TriangulationImplementation::TriaObject< - 1>( - middle_vertex_index(hex->face(2)), - middle_vertex_index( - hex->face(3)))); + 1>(middle_vertex_index( + hex->face(2)), + middle_vertex_index( + hex->face(3)))); // again, first collect some data about the // indices of the lines, with the following @@ -8478,10 +8493,10 @@ namespace internal // internal line new_lines[0]->set( internal::TriangulationImplementation::TriaObject< - 1>( - middle_vertex_index(hex->face(0)), - middle_vertex_index( - hex->face(1)))); + 1>(middle_vertex_index( + hex->face(0)), + middle_vertex_index( + hex->face(1)))); // again, first collect some data about the // indices of the lines, with the following @@ -10122,10 +10137,10 @@ const unsigned int Triangulation::dimension; template Triangulation::Triangulation( const MeshSmoothing smooth_grid, - const bool check_for_distorted_cells) : - smooth_grid(smooth_grid), - anisotropic_refinement(false), - check_for_distorted_cells(check_for_distorted_cells) + const bool check_for_distorted_cells) + : smooth_grid(smooth_grid) + , anisotropic_refinement(false) + , check_for_distorted_cells(check_for_distorted_cells) { if (dim == 1) { @@ -10146,21 +10161,21 @@ Triangulation::Triangulation( template Triangulation::Triangulation( - Triangulation &&tria) noexcept : - Subscriptor(std::move(tria)), - smooth_grid(tria.smooth_grid), - periodic_face_pairs_level_0(std::move(tria.periodic_face_pairs_level_0)), - periodic_face_map(std::move(tria.periodic_face_map)), - levels(std::move(tria.levels)), - faces(std::move(tria.faces)), - vertices(std::move(tria.vertices)), - vertices_used(std::move(tria.vertices_used)), - manifold(std::move(tria.manifold)), - anisotropic_refinement(tria.anisotropic_refinement), - check_for_distorted_cells(tria.check_for_distorted_cells), - number_cache(std::move(tria.number_cache)), - vertex_to_boundary_id_map_1d(std::move(tria.vertex_to_boundary_id_map_1d)), - vertex_to_manifold_id_map_1d(std::move(tria.vertex_to_manifold_id_map_1d)) + Triangulation &&tria) noexcept + : Subscriptor(std::move(tria)) + , smooth_grid(tria.smooth_grid) + , periodic_face_pairs_level_0(std::move(tria.periodic_face_pairs_level_0)) + , periodic_face_map(std::move(tria.periodic_face_map)) + , levels(std::move(tria.levels)) + , faces(std::move(tria.faces)) + , vertices(std::move(tria.vertices)) + , vertices_used(std::move(tria.vertices_used)) + , manifold(std::move(tria.manifold)) + , anisotropic_refinement(tria.anisotropic_refinement) + , check_for_distorted_cells(tria.check_for_distorted_cells) + , number_cache(std::move(tria.number_cache)) + , vertex_to_boundary_id_map_1d(std::move(tria.vertex_to_boundary_id_map_1d)) + , vertex_to_manifold_id_map_1d(std::move(tria.vertex_to_manifold_id_map_1d)) { tria.number_cache = internal::TriangulationImplementation::NumberCache(); } @@ -10469,14 +10484,14 @@ Triangulation::copy_triangulation( { Assert((vertices.size() == 0) && (levels.size() == 0) && (faces == nullptr), ExcTriangulationNotEmpty(vertices.size(), levels.size())); - Assert( - (other_tria.levels.size() != 0) && (other_tria.vertices.size() != 0) && - (dim == 1 || other_tria.faces != nullptr), - ExcMessage("When calling Triangulation::copy_triangulation(), " - "the target triangulation must be empty but the source " - "triangulation (the argument to this function) must contain " - "something. Here, it seems like the source does not " - "contain anything at all.")); + Assert((other_tria.levels.size() != 0) && (other_tria.vertices.size() != 0) && + (dim == 1 || other_tria.faces != nullptr), + ExcMessage( + "When calling Triangulation::copy_triangulation(), " + "the target triangulation must be empty but the source " + "triangulation (the argument to this function) must contain " + "something. Here, it seems like the source does not " + "contain anything at all.")); // copy normal elements @@ -10689,10 +10704,10 @@ Triangulation::create_triangulation( { // If we have visited this guy, then the ordering and // the orientation should agree - Assert( - !(correct(i, j) ^ (neighbor->direction_flag() == - (*cell)->direction_flag())), - ExcNonOrientableTriangulation()); + Assert(!(correct(i, j) ^ + (neighbor->direction_flag() == + (*cell)->direction_flag())), + ExcNonOrientableTriangulation()); } else { @@ -10802,8 +10817,10 @@ Triangulation::save_refine_flags(std::ostream &out) const { std::vector v; save_refine_flags(v); - write_bool_vector( - mn_tria_refine_flags_begin, v, mn_tria_refine_flags_end, out); + write_bool_vector(mn_tria_refine_flags_begin, + v, + mn_tria_refine_flags_end, + out); } @@ -10868,8 +10885,10 @@ Triangulation::save_coarsen_flags(std::ostream &out) const { std::vector v; save_coarsen_flags(v); - write_bool_vector( - mn_tria_coarsen_flags_begin, v, mn_tria_coarsen_flags_end, out); + write_bool_vector(mn_tria_coarsen_flags_begin, + v, + mn_tria_coarsen_flags_end, + out); } @@ -10879,8 +10898,10 @@ void Triangulation::load_coarsen_flags(std::istream &in) { std::vector v; - read_bool_vector( - mn_tria_coarsen_flags_begin, v, mn_tria_coarsen_flags_end, in); + read_bool_vector(mn_tria_coarsen_flags_begin, + v, + mn_tria_coarsen_flags_end, + in); load_coarsen_flags(v); } @@ -11173,8 +11194,9 @@ Triangulation::load_user_flags(const std::vector &v) if (dim >= 2) { tmp.clear(); - tmp.insert( - tmp.end(), v.begin() + n_lines(), v.begin() + n_lines() + n_quads()); + tmp.insert(tmp.end(), + v.begin() + n_lines(), + v.begin() + n_lines() + n_quads()); load_user_flags_quad(tmp); } @@ -11214,8 +11236,10 @@ Triangulation::save_user_flags_line(std::ostream &out) const { std::vector v; save_user_flags_line(v); - write_bool_vector( - mn_tria_line_user_flags_begin, v, mn_tria_line_user_flags_end, out); + write_bool_vector(mn_tria_line_user_flags_begin, + v, + mn_tria_line_user_flags_end, + out); } @@ -11225,8 +11249,10 @@ void Triangulation::load_user_flags_line(std::istream &in) { std::vector v; - read_bool_vector( - mn_tria_line_user_flags_begin, v, mn_tria_line_user_flags_end, in); + read_bool_vector(mn_tria_line_user_flags_begin, + v, + mn_tria_line_user_flags_end, + in); load_user_flags_line(v); } @@ -11333,8 +11359,10 @@ Triangulation::save_user_flags_quad(std::ostream &out) const { std::vector v; save_user_flags_quad(v); - write_bool_vector( - mn_tria_quad_user_flags_begin, v, mn_tria_quad_user_flags_end, out); + write_bool_vector(mn_tria_quad_user_flags_begin, + v, + mn_tria_quad_user_flags_end, + out); } @@ -11344,8 +11372,10 @@ void Triangulation::load_user_flags_quad(std::istream &in) { std::vector v; - read_bool_vector( - mn_tria_quad_user_flags_begin, v, mn_tria_quad_user_flags_end, in); + read_bool_vector(mn_tria_quad_user_flags_begin, + v, + mn_tria_quad_user_flags_end, + in); load_user_flags_quad(v); } @@ -11398,8 +11428,10 @@ Triangulation::save_user_flags_hex(std::ostream &out) const { std::vector v; save_user_flags_hex(v); - write_bool_vector( - mn_tria_hex_user_flags_begin, v, mn_tria_hex_user_flags_end, out); + write_bool_vector(mn_tria_hex_user_flags_begin, + v, + mn_tria_hex_user_flags_end, + out); } @@ -11409,8 +11441,10 @@ void Triangulation::load_user_flags_hex(std::istream &in) { std::vector v; - read_bool_vector( - mn_tria_hex_user_flags_begin, v, mn_tria_hex_user_flags_end, in); + read_bool_vector(mn_tria_hex_user_flags_begin, + v, + mn_tria_hex_user_flags_end, + in); load_user_flags_hex(v); } @@ -11487,8 +11521,9 @@ Triangulation::load_user_indices( if (dim >= 2) { tmp.clear(); - tmp.insert( - tmp.end(), v.begin() + n_lines(), v.begin() + n_lines() + n_quads()); + tmp.insert(tmp.end(), + v.begin() + n_lines(), + v.begin() + n_lines() + n_quads()); load_user_indices_quad(tmp); } @@ -11740,8 +11775,9 @@ Triangulation::load_user_pointers(const std::vector &v) if (dim >= 2) { tmp.clear(); - tmp.insert( - tmp.end(), v.begin() + n_lines(), v.begin() + n_lines() + n_quads()); + tmp.insert(tmp.end(), + v.begin() + n_lines(), + v.begin() + n_lines() + n_quads()); load_user_pointers_quad(tmp); } @@ -11976,8 +12012,9 @@ template typename Triangulation::cell_iterator Triangulation::end() const { - return cell_iterator( - const_cast *>(this), -1, -1); + return cell_iterator(const_cast *>(this), + -1, + -1); } @@ -12141,8 +12178,10 @@ Triangulation::begin_vertex() const } else { - vertex_iterator i = raw_vertex_iterator( - const_cast *>(this), 0, 0); + vertex_iterator i = + raw_vertex_iterator(const_cast *>(this), + 0, + 0); if (i.state() != IteratorState::valid) return i; // This loop will end because every triangulation has used vertices. @@ -12245,8 +12284,9 @@ template typename Triangulation::line_iterator Triangulation::end_line() const { - return raw_line_iterator( - const_cast *>(this), -1, -1); + return raw_line_iterator(const_cast *>(this), + -1, + -1); } @@ -12328,8 +12368,9 @@ template typename Triangulation::quad_iterator Triangulation::end_quad() const { - return raw_quad_iterator( - const_cast *>(this), -1, -1); + return raw_quad_iterator(const_cast *>(this), + -1, + -1); } @@ -12402,8 +12443,9 @@ template typename Triangulation::hex_iterator Triangulation::end_hex() const { - return raw_hex_iterator( - const_cast *>(this), -1, -1); + return raw_hex_iterator(const_cast *>(this), + -1, + -1); } @@ -13057,10 +13099,11 @@ template unsigned int Triangulation::n_used_vertices() const { - return std::count_if( - vertices_used.begin(), - vertices_used.end(), - std::bind(std::equal_to(), std::placeholders::_1, true)); + return std::count_if(vertices_used.begin(), + vertices_used.end(), + std::bind(std::equal_to(), + std::placeholders::_1, + true)); } @@ -13485,8 +13528,9 @@ Triangulation::fix_coarsen_flags() for (unsigned int vertex = 0; vertex < GeometryInfo::vertices_per_cell; ++vertex) - vertex_level[cell->vertex_index(vertex)] = std::max( - vertex_level[cell->vertex_index(vertex)], cell->level()); + vertex_level[cell->vertex_index(vertex)] = + std::max(vertex_level[cell->vertex_index(vertex)], + cell->level()); else { // if coarsen flag is set then tentatively assume @@ -14168,8 +14212,9 @@ Triangulation::prepare_coarsening_and_refinement() for (unsigned int vertex = 0; vertex < GeometryInfo::vertices_per_cell; ++vertex) - vertex_level[cell->vertex_index(vertex)] = std::max( - vertex_level[cell->vertex_index(vertex)], cell->level()); + vertex_level[cell->vertex_index(vertex)] = + std::max(vertex_level[cell->vertex_index(vertex)], + cell->level()); else { // if coarsen flag is set then tentatively assume @@ -14793,8 +14838,9 @@ Triangulation::prepare_coarsening_and_refinement() (face_ref_case == RefinementCase::cut_y && needed_face_ref_case == RefinementCase::cut_x)) - changed = cell->flag_for_face_refinement( - i, face_ref_case); + changed = + cell->flag_for_face_refinement(i, + face_ref_case); } } } diff --git a/source/grid/tria_accessor.cc b/source/grid/tria_accessor.cc index 7dd8c7e002..ac8f3b7456 100644 --- a/source/grid/tria_accessor.cc +++ b/source/grid/tria_accessor.cc @@ -1616,8 +1616,9 @@ TriaAccessor::intermediate_point( w[i] = GeometryInfo::d_linear_shape_function(coordinates, i); } - return this->get_manifold().get_new_point( - make_array_view(p.begin(), p.end()), make_array_view(w.begin(), w.end())); + return this->get_manifold().get_new_point(make_array_view(p.begin(), p.end()), + make_array_view(w.begin(), + w.end())); } @@ -1662,9 +1663,8 @@ namespace [1] = {{-1.000000}, {1.000000}}; template <> - const double TransformR2UAffine<1>::Kb[GeometryInfo<1>::vertices_per_cell] = { - 1.000000, - 0.000000}; + const double TransformR2UAffine<1>::Kb[GeometryInfo<1>::vertices_per_cell] = + {1.000000, 0.000000}; /* @@ -2132,8 +2132,9 @@ CellAccessor::parent() const { Assert(this->used(), TriaAccessorExceptions::ExcCellNotUsed()); Assert(this->present_level > 0, TriaAccessorExceptions::ExcCellHasNoParent()); - TriaIterator> q( - this->tria, this->present_level - 1, parent_index()); + TriaIterator> q(this->tria, + this->present_level - 1, + parent_index()); return q; } @@ -2415,9 +2416,9 @@ CellAccessor::neighbor_of_coarser_neighbor( // call a helper function, that translates the current // subface number to a subface number for the current // FaceRefineCase - return std::make_pair( - face_no_guess, - translate_subface_no(face_guess, subface_no)); + return std::make_pair(face_no_guess, + translate_subface_no(face_guess, + subface_no)); if (face_guess->child(subface_no)->has_children()) for (unsigned int subsub_no = 0; @@ -2456,8 +2457,9 @@ CellAccessor::neighbor_of_coarser_neighbor( // call a helper function, that translates the current // subface number to a subface number for the current // FaceRefineCase - return std::make_pair( - face_no, translate_subface_no(face, subface_no)); + return std::make_pair(face_no, + translate_subface_no(face, + subface_no)); if (face->child(subface_no)->has_children()) for (unsigned int subsub_no = 0; @@ -2468,9 +2470,10 @@ CellAccessor::neighbor_of_coarser_neighbor( // call a helper function, that translates the current // subface number and subsubface number to a subface // number for the current FaceRefineCase - return std::make_pair( - face_no, - translate_subface_no(face, subface_no, subsub_no)); + return std::make_pair(face_no, + translate_subface_no(face, + subface_no, + subsub_no)); } } @@ -2523,8 +2526,9 @@ CellAccessor::has_periodic_neighbor( typedef TriaIterator> cell_iterator; // my_it : is the iterator to the current cell. cell_iterator my_it(*this); - if (this->tria->periodic_face_map.find(std::pair( - my_it, i_face)) != this->tria->periodic_face_map.end()) + if (this->tria->periodic_face_map.find( + std::pair(my_it, i_face)) != + this->tria->periodic_face_map.end()) return true; return false; } diff --git a/source/grid/tria_levels.cc b/source/grid/tria_levels.cc index 58310ed6e9..54a1fbe410 100644 --- a/source/grid/tria_levels.cc +++ b/source/grid/tria_levels.cc @@ -44,8 +44,9 @@ namespace internal RefinementCase::no_refinement); coarsen_flags.reserve(total_cells); - coarsen_flags.insert( - coarsen_flags.end(), total_cells - coarsen_flags.size(), false); + coarsen_flags.insert(coarsen_flags.end(), + total_cells - coarsen_flags.size(), + false); active_cell_indices.reserve(total_cells); active_cell_indices.insert(active_cell_indices.end(), @@ -53,8 +54,9 @@ namespace internal numbers::invalid_unsigned_int); subdomain_ids.reserve(total_cells); - subdomain_ids.insert( - subdomain_ids.end(), total_cells - subdomain_ids.size(), 0); + subdomain_ids.insert(subdomain_ids.end(), + total_cells - subdomain_ids.size(), + 0); level_subdomain_ids.reserve(total_cells); level_subdomain_ids.insert(level_subdomain_ids.end(), @@ -72,8 +74,9 @@ namespace internal direction_flags.clear(); parents.reserve((int)(total_cells + 1) / 2); - parents.insert( - parents.end(), (total_cells + 1) / 2 - parents.size(), -1); + parents.insert(parents.end(), + (total_cells + 1) / 2 - parents.size(), + -1); neighbors.reserve(total_cells * (2 * dimension)); neighbors.insert(neighbors.end(), @@ -133,8 +136,9 @@ namespace internal RefinementCase<3>::no_refinement); coarsen_flags.reserve(total_cells); - coarsen_flags.insert( - coarsen_flags.end(), total_cells - coarsen_flags.size(), false); + coarsen_flags.insert(coarsen_flags.end(), + total_cells - coarsen_flags.size(), + false); active_cell_indices.reserve(total_cells); active_cell_indices.insert(active_cell_indices.end(), @@ -142,8 +146,9 @@ namespace internal numbers::invalid_unsigned_int); subdomain_ids.reserve(total_cells); - subdomain_ids.insert( - subdomain_ids.end(), total_cells - subdomain_ids.size(), 0); + subdomain_ids.insert(subdomain_ids.end(), + total_cells - subdomain_ids.size(), + 0); level_subdomain_ids.reserve(total_cells); level_subdomain_ids.insert(level_subdomain_ids.end(), @@ -161,8 +166,9 @@ namespace internal direction_flags.clear(); parents.reserve((int)(total_cells + 1) / 2); - parents.insert( - parents.end(), (total_cells + 1) / 2 - parents.size(), -1); + parents.insert(parents.end(), + (total_cells + 1) / 2 - parents.size(), + -1); neighbors.reserve(total_cells * (2 * dimension)); neighbors.insert(neighbors.end(), diff --git a/source/grid/tria_objects.cc b/source/grid/tria_objects.cc index 653d22045b..34a64e0baf 100644 --- a/source/grid/tria_objects.cc +++ b/source/grid/tria_objects.cc @@ -93,14 +93,16 @@ namespace internal used.insert(used.end(), new_size - used.size(), false); user_flags.reserve(new_size); - user_flags.insert( - user_flags.end(), new_size - user_flags.size(), false); + user_flags.insert(user_flags.end(), + new_size - user_flags.size(), + false); const unsigned int factor = GeometryInfo::max_children_per_cell / 2; children.reserve(factor * new_size); - children.insert( - children.end(), factor * new_size - children.size(), -1); + children.insert(children.end(), + factor * new_size - children.size(), + -1); if (G::dimension > 1) { @@ -157,8 +159,10 @@ namespace internal else next_free_pair = pos + 2; - return typename dealii::Triangulation::raw_hex_iterator( - &tria, level, pos); + return + typename dealii::Triangulation::raw_hex_iterator(&tria, + level, + pos); } @@ -166,11 +170,11 @@ namespace internal TriaObjectsHex::reserve_space(const unsigned int new_hexes) { const unsigned int new_size = - new_hexes + - std::count_if( - used.begin(), - used.end(), - std::bind(std::equal_to(), std::placeholders::_1, true)); + new_hexes + std::count_if(used.begin(), + used.end(), + std::bind(std::equal_to(), + std::placeholders::_1, + true)); // see above... if (new_size > cells.size()) @@ -182,8 +186,9 @@ namespace internal used.insert(used.end(), new_size - used.size(), false); user_flags.reserve(new_size); - user_flags.insert( - user_flags.end(), new_size - user_flags.size(), false); + user_flags.insert(user_flags.end(), + new_size - user_flags.size(), + false); children.reserve(4 * new_size); children.insert(children.end(), 4 * new_size - children.size(), -1); diff --git a/source/hp/dof_handler.cc b/source/hp/dof_handler.cc index e6a1eb5adf..2b8f9c6552 100644 --- a/source/hp/dof_handler.cc +++ b/source/hp/dof_handler.cc @@ -468,10 +468,12 @@ namespace internal // have on each level, allocate the memory. note that we // allocate offsets for all faces, though only the active // ones will have a non-invalid value later on - face_dof_offsets = std::vector( - dof_handler.tria->n_raw_faces(), (unsigned int)(-1)); - face_dof_indices = std::vector( - n_face_slots, numbers::invalid_dof_index); + face_dof_offsets = + std::vector(dof_handler.tria->n_raw_faces(), + (unsigned int)(-1)); + face_dof_indices = + std::vector(n_face_slots, + numbers::invalid_dof_index); // with the memory now allocated, loop over the // dof_handler.cells again and prime the _offset values as @@ -791,11 +793,11 @@ namespace internal static unsigned int max_couplings_between_dofs(const DoFHandler<1, spacedim> &dof_handler) { - return std::min( - static_cast( - 3 * dof_handler.fe_collection.max_dofs_per_vertex() + - 2 * dof_handler.fe_collection.max_dofs_per_line()), - dof_handler.n_dofs()); + return std::min(static_cast( + 3 * + dof_handler.fe_collection.max_dofs_per_vertex() + + 2 * dof_handler.fe_collection.max_dofs_per_line()), + dof_handler.n_dofs()); } @@ -929,8 +931,9 @@ namespace internal active_fe_indices[cell->active_cell_index()] = cell->active_fe_index(); - Utilities::MPI::sum( - active_fe_indices, tr->get_communicator(), active_fe_indices); + Utilities::MPI::sum(active_fe_indices, + tr->get_communicator(), + active_fe_indices); // now go back and fill the active_fe_index on ghost // cells. we would like to call cell->set_active_fe_index(), @@ -976,8 +979,9 @@ namespace internal GridTools::exchange_cell_data_to_ghosts< unsigned int, - dealii::hp::DoFHandler>( - dof_handler, pack, unpack); + dealii::hp::DoFHandler>(dof_handler, + pack, + unpack); } else { @@ -1008,17 +1012,17 @@ namespace hp template - DoFHandler::DoFHandler() : - tria(nullptr, typeid(*this).name()), - faces(nullptr) + DoFHandler::DoFHandler() + : tria(nullptr, typeid(*this).name()) + , faces(nullptr) {} template DoFHandler::DoFHandler( - const Triangulation &tria) : - tria(&tria, typeid(*this).name()), - faces(nullptr) + const Triangulation &tria) + : tria(&tria, typeid(*this).name()) + , faces(nullptr) { setup_policy_and_listeners(); @@ -1390,9 +1394,9 @@ namespace hp // cover all fe indices presently in use on the mesh for (active_cell_iterator cell = begin_active(); cell != end(); ++cell) if (cell->is_locally_owned()) - Assert( - cell->active_fe_index() < fe_collection.size(), - ExcInvalidFEIndex(cell->active_fe_index(), fe_collection.size())); + Assert(cell->active_fe_index() < fe_collection.size(), + ExcInvalidFEIndex(cell->active_fe_index(), + fe_collection.size())); // then allocate space for all the other tables @@ -1471,12 +1475,12 @@ namespace hp std_cxx14::make_unique>>(*this); - tria_listeners.push_back( - this->tria->signals.pre_refinement.connect(std::bind( - &DoFHandler::pre_refinement_action, std::ref(*this)))); - tria_listeners.push_back( - this->tria->signals.post_refinement.connect(std::bind( - &DoFHandler::post_refinement_action, std::ref(*this)))); + tria_listeners.push_back(this->tria->signals.pre_refinement.connect( + std::bind(&DoFHandler::pre_refinement_action, + std::ref(*this)))); + tria_listeners.push_back(this->tria->signals.post_refinement.connect( + std::bind(&DoFHandler::post_refinement_action, + std::ref(*this)))); tria_listeners.push_back(this->tria->signals.create.connect(std::bind( &DoFHandler::post_refinement_action, std::ref(*this)))); } @@ -1497,9 +1501,9 @@ namespace hp DoFHandler::renumber_dofs( const std::vector &new_numbers) { - Assert( - levels.size() > 0, - ExcMessage("You need to distribute DoFs before you can renumber them.")); + Assert(levels.size() > 0, + ExcMessage( + "You need to distribute DoFs before you can renumber them.")); AssertDimension(new_numbers.size(), n_locally_owned_dofs()); @@ -1658,11 +1662,12 @@ namespace hp // store refinement cases, so use the 'children' vector // instead if (dim == 1) - std::transform( - tria->levels[i]->cells.children.begin(), - tria->levels[i]->cells.children.end(), - has_children_level->begin(), - std::bind(std::not_equal_to(), std::placeholders::_1, -1)); + std::transform(tria->levels[i]->cells.children.begin(), + tria->levels[i]->cells.children.end(), + has_children_level->begin(), + std::bind(std::not_equal_to(), + std::placeholders::_1, + -1)); else std::transform(tria->levels[i]->cells.refinement_cases.begin(), tria->levels[i]->cells.refinement_cases.end(), diff --git a/source/hp/fe_collection.cc b/source/hp/fe_collection.cc index b4f6f6ed37..73b086645d 100644 --- a/source/hp/fe_collection.cc +++ b/source/hp/fe_collection.cc @@ -52,9 +52,10 @@ namespace hp it != fes.end(); ++it) { - Assert( - *it < fe_collection.size(), - ExcIndexRangeType(*it, 0, fe_collection.size())); + Assert(*it < fe_collection.size(), + ExcIndexRangeType(*it, + 0, + fe_collection.size())); domination = domination & fe_collection[cur_fe].compare_for_face_domination( fe_collection[*it]); diff --git a/source/hp/fe_values.cc b/source/hp/fe_values.cc index c5f51b2a3c..16977521e6 100644 --- a/source/hp/fe_values.cc +++ b/source/hp/fe_values.cc @@ -32,17 +32,17 @@ namespace internal const dealii::hp::FECollection & fe_collection, const dealii::hp::QCollection &q_collection, - const UpdateFlags update_flags) : - fe_collection(&fe_collection), - mapping_collection(&mapping_collection), - q_collection(q_collection), - fe_values_table(fe_collection.size(), - mapping_collection.size(), - q_collection.size()), - present_fe_values_index(numbers::invalid_unsigned_int, - numbers::invalid_unsigned_int, - numbers::invalid_unsigned_int), - update_flags(update_flags) + const UpdateFlags update_flags) + : fe_collection(&fe_collection) + , mapping_collection(&mapping_collection) + , q_collection(q_collection) + , fe_values_table(fe_collection.size(), + mapping_collection.size(), + q_collection.size()) + , present_fe_values_index(numbers::invalid_unsigned_int, + numbers::invalid_unsigned_int, + numbers::invalid_unsigned_int) + , update_flags(update_flags) {} @@ -51,17 +51,17 @@ namespace internal const dealii::hp::FECollection & fe_collection, const dealii::hp::QCollection &q_collection, - const UpdateFlags update_flags) : - fe_collection(&fe_collection), - mapping_collection( - &dealii::hp::StaticMappingQ1:: - mapping_collection), - q_collection(q_collection), - fe_values_table(fe_collection.size(), 1, q_collection.size()), - present_fe_values_index(numbers::invalid_unsigned_int, - numbers::invalid_unsigned_int, - numbers::invalid_unsigned_int), - update_flags(update_flags) + const UpdateFlags update_flags) + : fe_collection(&fe_collection) + , mapping_collection( + &dealii::hp::StaticMappingQ1:: + mapping_collection) + , q_collection(q_collection) + , fe_values_table(fe_collection.size(), 1, q_collection.size()) + , present_fe_values_index(numbers::invalid_unsigned_int, + numbers::invalid_unsigned_int, + numbers::invalid_unsigned_int) + , update_flags(update_flags) {} @@ -115,12 +115,12 @@ namespace hp const hp::MappingCollection &mapping, const hp::FECollection & fe_collection, const hp::QCollection & q_collection, - const UpdateFlags update_flags) : - internal::hp::FEValuesBase>( - mapping, - fe_collection, - q_collection, - update_flags) + const UpdateFlags update_flags) + : internal::hp::FEValuesBase>( + mapping, + fe_collection, + q_collection, + update_flags) {} @@ -128,11 +128,11 @@ namespace hp FEValues::FEValues( const hp::FECollection &fe_collection, const hp::QCollection & q_collection, - const UpdateFlags update_flags) : - internal::hp::FEValuesBase>( - fe_collection, - q_collection, - update_flags) + const UpdateFlags update_flags) + : internal::hp::FEValuesBase>( + fe_collection, + q_collection, + update_flags) {} @@ -172,9 +172,10 @@ namespace hp // some checks Assert(real_q_index < this->q_collection.size(), ExcIndexRange(real_q_index, 0, this->q_collection.size())); - Assert( - real_mapping_index < this->mapping_collection->size(), - ExcIndexRange(real_mapping_index, 0, this->mapping_collection->size())); + Assert(real_mapping_index < this->mapping_collection->size(), + ExcIndexRange(real_mapping_index, + 0, + this->mapping_collection->size())); Assert(real_fe_index < this->fe_collection->size(), ExcIndexRange(real_fe_index, 0, this->fe_collection->size())); @@ -212,9 +213,10 @@ namespace hp // some checks Assert(real_q_index < this->q_collection.size(), ExcIndexRange(real_q_index, 0, this->q_collection.size())); - Assert( - real_mapping_index < this->mapping_collection->size(), - ExcIndexRange(real_mapping_index, 0, this->mapping_collection->size())); + Assert(real_mapping_index < this->mapping_collection->size(), + ExcIndexRange(real_mapping_index, + 0, + this->mapping_collection->size())); Assert(real_fe_index < this->fe_collection->size(), ExcIndexRange(real_fe_index, 0, this->fe_collection->size())); @@ -234,13 +236,13 @@ namespace hp const hp::MappingCollection &mapping, const hp::FECollection & fe_collection, const hp::QCollection & q_collection, - const UpdateFlags update_flags) : - internal::hp:: - FEValuesBase>( - mapping, - fe_collection, - q_collection, - update_flags) + const UpdateFlags update_flags) + : internal::hp:: + FEValuesBase>( + mapping, + fe_collection, + q_collection, + update_flags) {} @@ -248,12 +250,12 @@ namespace hp FEFaceValues::FEFaceValues( const hp::FECollection &fe_collection, const hp::QCollection & q_collection, - const UpdateFlags update_flags) : - internal::hp:: - FEValuesBase>( - fe_collection, - q_collection, - update_flags) + const UpdateFlags update_flags) + : internal::hp:: + FEValuesBase>( + fe_collection, + q_collection, + update_flags) {} @@ -294,9 +296,10 @@ namespace hp // some checks Assert(real_q_index < this->q_collection.size(), ExcIndexRange(real_q_index, 0, this->q_collection.size())); - Assert( - real_mapping_index < this->mapping_collection->size(), - ExcIndexRange(real_mapping_index, 0, this->mapping_collection->size())); + Assert(real_mapping_index < this->mapping_collection->size(), + ExcIndexRange(real_mapping_index, + 0, + this->mapping_collection->size())); Assert(real_fe_index < this->fe_collection->size(), ExcIndexRange(real_fe_index, 0, this->fe_collection->size())); @@ -335,9 +338,10 @@ namespace hp // some checks Assert(real_q_index < this->q_collection.size(), ExcIndexRange(real_q_index, 0, this->q_collection.size())); - Assert( - real_mapping_index < this->mapping_collection->size(), - ExcIndexRange(real_mapping_index, 0, this->mapping_collection->size())); + Assert(real_mapping_index < this->mapping_collection->size(), + ExcIndexRange(real_mapping_index, + 0, + this->mapping_collection->size())); Assert(real_fe_index < this->fe_collection->size(), ExcIndexRange(real_fe_index, 0, this->fe_collection->size())); @@ -357,13 +361,13 @@ namespace hp const hp::MappingCollection &mapping, const hp::FECollection & fe_collection, const hp::QCollection & q_collection, - const UpdateFlags update_flags) : - internal::hp:: - FEValuesBase>( - mapping, - fe_collection, - q_collection, - update_flags) + const UpdateFlags update_flags) + : internal::hp:: + FEValuesBase>( + mapping, + fe_collection, + q_collection, + update_flags) {} @@ -371,12 +375,12 @@ namespace hp FESubfaceValues::FESubfaceValues( const hp::FECollection &fe_collection, const hp::QCollection & q_collection, - const UpdateFlags update_flags) : - internal::hp:: - FEValuesBase>( - fe_collection, - q_collection, - update_flags) + const UpdateFlags update_flags) + : internal::hp:: + FEValuesBase>( + fe_collection, + q_collection, + update_flags) {} @@ -418,9 +422,10 @@ namespace hp // some checks Assert(real_q_index < this->q_collection.size(), ExcIndexRange(real_q_index, 0, this->q_collection.size())); - Assert( - real_mapping_index < this->mapping_collection->size(), - ExcIndexRange(real_mapping_index, 0, this->mapping_collection->size())); + Assert(real_mapping_index < this->mapping_collection->size(), + ExcIndexRange(real_mapping_index, + 0, + this->mapping_collection->size())); Assert(real_fe_index < this->fe_collection->size(), ExcIndexRange(real_fe_index, 0, this->fe_collection->size())); @@ -460,9 +465,10 @@ namespace hp // some checks Assert(real_q_index < this->q_collection.size(), ExcIndexRange(real_q_index, 0, this->q_collection.size())); - Assert( - real_mapping_index < this->mapping_collection->size(), - ExcIndexRange(real_mapping_index, 0, this->mapping_collection->size())); + Assert(real_mapping_index < this->mapping_collection->size(), + ExcIndexRange(real_mapping_index, + 0, + this->mapping_collection->size())); Assert(real_fe_index < this->fe_collection->size(), ExcIndexRange(real_fe_index, 0, this->fe_collection->size())); diff --git a/source/hp/mapping_collection.cc b/source/hp/mapping_collection.cc index ba78eabc14..9ae4547004 100644 --- a/source/hp/mapping_collection.cc +++ b/source/hp/mapping_collection.cc @@ -35,8 +35,9 @@ namespace hp template MappingCollection::MappingCollection( - const MappingCollection &mapping_collection) : - Subscriptor(), + const MappingCollection &mapping_collection) + : Subscriptor() + , // copy the array // of shared // pointers. nothing diff --git a/source/lac/affine_constraints.cc b/source/lac/affine_constraints.cc index da0ffe254f..56a5fa2954 100644 --- a/source/lac/affine_constraints.cc +++ b/source/lac/affine_constraints.cc @@ -30,9 +30,8 @@ DEAL_II_NAMESPACE_OPEN */ #define INSTANTIATE_DLTG_VECTOR(VectorType) \ - template void \ - AffineConstraints::condense( \ - const VectorType &, VectorType &) const; \ + template void AffineConstraints::condense< \ + VectorType>(const VectorType &, VectorType &) const; \ template void \ AffineConstraints::condense( \ VectorType &) const; \ @@ -75,20 +74,20 @@ DEAL_II_NAMESPACE_OPEN bool, \ std::integral_constant) const -#define INSTANTIATE_DLTG_MATRIX(MatrixType) \ - template void AffineConstraints:: \ - distribute_local_to_global( \ - const FullMatrix &, \ - const std::vector &, \ - const std::vector &, \ - MatrixType &) const; \ - template void AffineConstraints:: \ - distribute_local_to_global( \ - const FullMatrix &, \ - const std::vector &, \ - const AffineConstraints &, \ - const std::vector &, \ - MatrixType &) const +#define INSTANTIATE_DLTG_MATRIX(MatrixType) \ + template void \ + AffineConstraints::distribute_local_to_global< \ + MatrixType>(const FullMatrix &, \ + const std::vector &, \ + const std::vector &, \ + MatrixType &) const; \ + template void \ + AffineConstraints::distribute_local_to_global< \ + MatrixType>(const FullMatrix &, \ + const std::vector &, \ + const AffineConstraints &, \ + const std::vector &, \ + MatrixType &) const #ifdef DEAL_II_WITH_PETSC INSTANTIATE_DLTG_VECTOR(PETScWrappers::MPI::Vector); diff --git a/source/lac/affine_constraints.inst.in b/source/lac/affine_constraints.inst.in index e0b2bf81f5..4523cad087 100644 --- a/source/lac/affine_constraints.inst.in +++ b/source/lac/affine_constraints.inst.in @@ -128,11 +128,10 @@ for (S : REAL_AND_COMPLEX_SCALARS; M : AFFINE_CONSTRAINTS_MATRIX_TEMPL) for (S : REAL_AND_COMPLEX_SCALARS; T : DEAL_II_VEC_TEMPLATES) { - template void - AffineConstraints::distribute_local_to_global>>( - const FullMatrix &, - const std::vector &, - DiagonalMatrix> &) const; + template void AffineConstraints::distribute_local_to_global< + DiagonalMatrix>>(const FullMatrix &, + const std::vector &, + DiagonalMatrix> &) const; template void AffineConstraints::distribute_local_to_global< DiagonalMatrix>>( @@ -140,16 +139,15 @@ for (S : REAL_AND_COMPLEX_SCALARS; T : DEAL_II_VEC_TEMPLATES) const std::vector &, DiagonalMatrix> &) const; - template void - AffineConstraints::distribute_local_to_global>, - T>( - const FullMatrix &, - const Vector &, - const std::vector &, - DiagonalMatrix> &, - T &, - bool, - std::integral_constant) const; + template void AffineConstraints::distribute_local_to_global< + DiagonalMatrix>, + T>(const FullMatrix &, + const Vector &, + const std::vector &, + DiagonalMatrix> &, + T &, + bool, + std::integral_constant) const; template void AffineConstraints::distribute_local_to_global< DiagonalMatrix>, @@ -177,27 +175,25 @@ for (S : REAL_AND_COMPLEX_SCALARS; T : DEAL_II_VEC_TEMPLATES) for (S : REAL_AND_COMPLEX_SCALARS) { - template void - AffineConstraints::distribute_local_to_global, - Vector>( - const FullMatrix &, - const Vector &, - const std::vector::size_type> &, - BlockSparseMatrix &, - Vector &, - bool, - std::integral_constant) const; + template void AffineConstraints::distribute_local_to_global< + BlockSparseMatrix, + Vector>(const FullMatrix &, + const Vector &, + const std::vector::size_type> &, + BlockSparseMatrix &, + Vector &, + bool, + std::integral_constant) const; - template void - AffineConstraints::distribute_local_to_global, - BlockVector>( - const FullMatrix &, - const Vector &, - const std::vector::size_type> &, - BlockSparseMatrix &, - BlockVector &, - bool, - std::integral_constant) const; + template void AffineConstraints::distribute_local_to_global< + BlockSparseMatrix, + BlockVector>(const FullMatrix &, + const Vector &, + const std::vector::size_type> &, + BlockSparseMatrix &, + BlockVector &, + bool, + std::integral_constant) const; template void AffineConstraints::distribute_local_to_global>( diff --git a/source/lac/block_matrix_array.cc b/source/lac/block_matrix_array.cc index 6ee11b92cc..eb2b25086c 100644 --- a/source/lac/block_matrix_array.cc +++ b/source/lac/block_matrix_array.cc @@ -24,12 +24,12 @@ DEAL_II_NAMESPACE_OPEN template -BlockMatrixArray::Entry::Entry(const Entry &e) : - row(e.row), - col(e.col), - prefix(e.prefix), - transpose(e.transpose), - matrix(e.matrix) +BlockMatrixArray::Entry::Entry(const Entry &e) + : row(e.row) + , col(e.col) + , prefix(e.prefix) + , transpose(e.transpose) + , matrix(e.matrix) { Entry &e2 = const_cast(e); e2.matrix = nullptr; @@ -46,9 +46,9 @@ BlockMatrixArray::Entry::~Entry() template -BlockMatrixArray::BlockMatrixArray() : - block_rows(0), - block_cols(0) +BlockMatrixArray::BlockMatrixArray() + : block_rows(0) + , block_cols(0) {} @@ -56,9 +56,9 @@ BlockMatrixArray::BlockMatrixArray() : template BlockMatrixArray::BlockMatrixArray( const unsigned int n_block_rows, - const unsigned int n_block_cols) : - block_rows(n_block_rows), - block_cols(n_block_cols) + const unsigned int n_block_cols) + : block_rows(n_block_rows) + , block_cols(n_block_cols) {} @@ -255,18 +255,17 @@ BlockMatrixArray::n_block_cols() const //--------------------------------------------------------------------------- template -BlockTrianglePrecondition::BlockTrianglePrecondition() : - BlockMatrixArray(), - backward(false) +BlockTrianglePrecondition::BlockTrianglePrecondition() + : BlockMatrixArray() + , backward(false) {} template BlockTrianglePrecondition::BlockTrianglePrecondition( - const unsigned int block_rows) : - BlockMatrixArray(block_rows, block_rows), - backward(false) + const unsigned int block_rows) + : BlockMatrixArray(block_rows, block_rows) + , backward(false) {} diff --git a/source/lac/block_sparsity_pattern.cc b/source/lac/block_sparsity_pattern.cc index 8e4019f612..1383f68a53 100644 --- a/source/lac/block_sparsity_pattern.cc +++ b/source/lac/block_sparsity_pattern.cc @@ -23,9 +23,9 @@ DEAL_II_NAMESPACE_OPEN template -BlockSparsityPatternBase::BlockSparsityPatternBase() : - rows(0), - columns(0) +BlockSparsityPatternBase::BlockSparsityPatternBase() + : rows(0) + , columns(0) {} @@ -33,9 +33,9 @@ BlockSparsityPatternBase::BlockSparsityPatternBase() : template BlockSparsityPatternBase::BlockSparsityPatternBase( const size_type n_block_rows, - const size_type n_block_columns) : - rows(0), - columns(0) + const size_type n_block_columns) + : rows(0) + , columns(0) { reinit(n_block_rows, n_block_columns); } @@ -44,10 +44,10 @@ BlockSparsityPatternBase::BlockSparsityPatternBase( template BlockSparsityPatternBase::BlockSparsityPatternBase( - const BlockSparsityPatternBase &s) : - Subscriptor(), - rows(0), - columns(0) + const BlockSparsityPatternBase &s) + : Subscriptor() + , rows(0) + , columns(0) { (void)s; Assert(s.rows == 0 && s.columns == 0, @@ -330,8 +330,8 @@ BlockSparsityPatternBase::print_gnuplot( BlockSparsityPattern::BlockSparsityPattern(const size_type n_rows, - const size_type n_columns) : - BlockSparsityPatternBase(n_rows, n_columns) + const size_type n_columns) + : BlockSparsityPatternBase(n_rows, n_columns) {} @@ -351,14 +351,16 @@ BlockSparsityPattern::reinit( const size_type length = rows.block_size(i); if (row_lengths[j].size() == 1) - block(i, j).reinit( - rows.block_size(i), cols.block_size(j), row_lengths[j][0]); + block(i, j).reinit(rows.block_size(i), + cols.block_size(j), + row_lengths[j][0]); else { VectorSlice> block_rows( row_lengths[j], start, length); - block(i, j).reinit( - rows.block_size(i), cols.block_size(j), block_rows); + block(i, j).reinit(rows.block_size(i), + cols.block_size(j), + block_rows); } } this->collect_sizes(); @@ -417,17 +419,17 @@ BlockSparsityPattern::copy_from(const BlockDynamicSparsityPattern &dsp) BlockDynamicSparsityPattern::BlockDynamicSparsityPattern( const size_type n_rows, - const size_type n_columns) : - BlockSparsityPatternBase(n_rows, n_columns) + const size_type n_columns) + : BlockSparsityPatternBase(n_rows, n_columns) {} BlockDynamicSparsityPattern::BlockDynamicSparsityPattern( const std::vector &row_indices, - const std::vector &col_indices) : - BlockSparsityPatternBase(row_indices.size(), - col_indices.size()) + const std::vector &col_indices) + : BlockSparsityPatternBase(row_indices.size(), + col_indices.size()) { for (size_type i = 0; i < row_indices.size(); ++i) for (size_type j = 0; j < col_indices.size(); ++j) @@ -437,14 +439,15 @@ BlockDynamicSparsityPattern::BlockDynamicSparsityPattern( BlockDynamicSparsityPattern::BlockDynamicSparsityPattern( - const std::vector &partitioning) : - BlockSparsityPatternBase(partitioning.size(), - partitioning.size()) + const std::vector &partitioning) + : BlockSparsityPatternBase(partitioning.size(), + partitioning.size()) { for (size_type i = 0; i < partitioning.size(); ++i) for (size_type j = 0; j < partitioning.size(); ++j) - this->block(i, j).reinit( - partitioning[i].size(), partitioning[j].size(), partitioning[i]); + this->block(i, j).reinit(partitioning[i].size(), + partitioning[j].size(), + partitioning[i]); this->collect_sizes(); } @@ -477,8 +480,9 @@ BlockDynamicSparsityPattern::reinit(const std::vector &partitioning) partitioning.size()); for (size_type i = 0; i < partitioning.size(); ++i) for (size_type j = 0; j < partitioning.size(); ++j) - this->block(i, j).reinit( - partitioning[i].size(), partitioning[j].size(), partitioning[i]); + this->block(i, j).reinit(partitioning[i].size(), + partitioning[j].size(), + partitioning[i]); this->collect_sizes(); } @@ -500,17 +504,17 @@ BlockDynamicSparsityPattern::reinit(const BlockIndices &row_indices, namespace TrilinosWrappers { BlockSparsityPattern::BlockSparsityPattern(const size_type n_rows, - const size_type n_columns) : - dealii::BlockSparsityPatternBase(n_rows, n_columns) + const size_type n_columns) + : dealii::BlockSparsityPatternBase(n_rows, n_columns) {} BlockSparsityPattern::BlockSparsityPattern( const std::vector &row_indices, - const std::vector &col_indices) : - BlockSparsityPatternBase(row_indices.size(), - col_indices.size()) + const std::vector &col_indices) + : BlockSparsityPatternBase(row_indices.size(), + col_indices.size()) { for (size_type i = 0; i < row_indices.size(); ++i) for (size_type j = 0; j < col_indices.size(); ++j) @@ -521,9 +525,9 @@ namespace TrilinosWrappers BlockSparsityPattern::BlockSparsityPattern( - const std::vector ¶llel_partitioning) : - BlockSparsityPatternBase(parallel_partitioning.size(), - parallel_partitioning.size()) + const std::vector ¶llel_partitioning) + : BlockSparsityPatternBase(parallel_partitioning.size(), + parallel_partitioning.size()) { for (size_type i = 0; i < parallel_partitioning.size(); ++i) for (size_type j = 0; j < parallel_partitioning.size(); ++j) @@ -536,14 +540,15 @@ namespace TrilinosWrappers BlockSparsityPattern::BlockSparsityPattern( const std::vector ¶llel_partitioning, - const MPI_Comm & communicator) : - BlockSparsityPatternBase(parallel_partitioning.size(), - parallel_partitioning.size()) + const MPI_Comm & communicator) + : BlockSparsityPatternBase(parallel_partitioning.size(), + parallel_partitioning.size()) { for (size_type i = 0; i < parallel_partitioning.size(); ++i) for (size_type j = 0; j < parallel_partitioning.size(); ++j) - this->block(i, j).reinit( - parallel_partitioning[i], parallel_partitioning[j], communicator); + this->block(i, j).reinit(parallel_partitioning[i], + parallel_partitioning[j], + communicator); this->collect_sizes(); } @@ -553,9 +558,10 @@ namespace TrilinosWrappers const std::vector &row_parallel_partitioning, const std::vector &col_parallel_partitioning, const std::vector &writable_rows, - const MPI_Comm & communicator) : - BlockSparsityPatternBase(row_parallel_partitioning.size(), - col_parallel_partitioning.size()) + const MPI_Comm & communicator) + : BlockSparsityPatternBase( + row_parallel_partitioning.size(), + col_parallel_partitioning.size()) { for (size_type i = 0; i < row_parallel_partitioning.size(); ++i) for (size_type j = 0; j < col_parallel_partitioning.size(); ++j) @@ -606,8 +612,9 @@ namespace TrilinosWrappers parallel_partitioning.size(), parallel_partitioning.size()); for (size_type i = 0; i < parallel_partitioning.size(); ++i) for (size_type j = 0; j < parallel_partitioning.size(); ++j) - this->block(i, j).reinit( - parallel_partitioning[i], parallel_partitioning[j], communicator); + this->block(i, j).reinit(parallel_partitioning[i], + parallel_partitioning[j], + communicator); this->collect_sizes(); } diff --git a/source/lac/chunk_sparse_matrix.inst.in b/source/lac/chunk_sparse_matrix.inst.in index a7d8ba6b7c..e142e73db8 100644 --- a/source/lac/chunk_sparse_matrix.inst.in +++ b/source/lac/chunk_sparse_matrix.inst.in @@ -44,8 +44,9 @@ for (S1, S2 : REAL_SCALARS) template S2 ChunkSparseMatrix::matrix_scalar_product( const Vector &, const Vector &) const; - template S2 ChunkSparseMatrix::residual( - Vector &, const Vector &, const Vector &) const; + template S2 ChunkSparseMatrix::residual(Vector &, + const Vector &, + const Vector &) const; template void ChunkSparseMatrix::precondition_SSOR( Vector &, const Vector &, const S1) const; @@ -72,12 +73,15 @@ for (S1, S2 : REAL_SCALARS) const std::vector &, const std::vector &, const S1) const; - template void ChunkSparseMatrix::SOR_step( - Vector &, const Vector &, const S1) const; - template void ChunkSparseMatrix::TSOR_step( - Vector &, const Vector &, const S1) const; - template void ChunkSparseMatrix::SSOR_step( - Vector &, const Vector &, const S1) const; + template void ChunkSparseMatrix::SOR_step(Vector &, + const Vector &, + const S1) const; + template void ChunkSparseMatrix::TSOR_step(Vector &, + const Vector &, + const S1) const; + template void ChunkSparseMatrix::SSOR_step(Vector &, + const Vector &, + const S1) const; } diff --git a/source/lac/chunk_sparsity_pattern.cc b/source/lac/chunk_sparsity_pattern.cc index 916a426f98..98df3a2d71 100644 --- a/source/lac/chunk_sparsity_pattern.cc +++ b/source/lac/chunk_sparsity_pattern.cc @@ -29,10 +29,10 @@ ChunkSparsityPattern::ChunkSparsityPattern() -ChunkSparsityPattern::ChunkSparsityPattern(const ChunkSparsityPattern &s) : - Subscriptor(), - chunk_size(s.chunk_size), - sparsity_pattern(s.sparsity_pattern) +ChunkSparsityPattern::ChunkSparsityPattern(const ChunkSparsityPattern &s) + : Subscriptor() + , chunk_size(s.chunk_size) + , sparsity_pattern(s.sparsity_pattern) { Assert(s.rows == 0 && s.cols == 0, ExcMessage( @@ -94,11 +94,11 @@ ChunkSparsityPattern::ChunkSparsityPattern( ChunkSparsityPattern & ChunkSparsityPattern::operator=(const ChunkSparsityPattern &s) { - Assert( - s.rows == 0 && s.cols == 0, - ExcMessage("This operator can only be called if the provided argument " - "is the sparsity pattern for an empty matrix. This operator can " - "not be used to copy a non-empty sparsity pattern.")); + Assert(s.rows == 0 && s.cols == 0, + ExcMessage( + "This operator can only be called if the provided argument " + "is the sparsity pattern for an empty matrix. This operator can " + "not be used to copy a non-empty sparsity pattern.")); Assert(rows == 0 && cols == 0, ExcMessage("This operator can only be called if the current object is " @@ -303,11 +303,11 @@ ChunkSparsityPattern::create_from(const unsigned int m, m <= sparsity_pattern_for_chunks.n_rows() * chunk_size_in, ExcMessage("Number of rows m is not compatible with chunk size " "and number of rows in sparsity pattern for the chunks.")); - Assert( - n > (sparsity_pattern_for_chunks.n_cols() - 1) * chunk_size_in && - n <= sparsity_pattern_for_chunks.n_cols() * chunk_size_in, - ExcMessage("Number of columns m is not compatible with chunk size " - "and number of columns in sparsity pattern for the chunks.")); + Assert(n > (sparsity_pattern_for_chunks.n_cols() - 1) * chunk_size_in && + n <= sparsity_pattern_for_chunks.n_cols() * chunk_size_in, + ExcMessage( + "Number of columns m is not compatible with chunk size " + "and number of columns in sparsity pattern for the chunks.")); internal::copy_sparsity(sparsity_pattern_for_chunks, sparsity_pattern); chunk_size = chunk_size_in; diff --git a/source/lac/cuda_solver_direct.cu b/source/lac/cuda_solver_direct.cu index b18ad78868..dfdf9bb647 100644 --- a/source/lac/cuda_solver_direct.cu +++ b/source/lac/cuda_solver_direct.cu @@ -422,8 +422,8 @@ namespace CUDAWrappers template SolverDirect::AdditionalData::AdditionalData( - const std::string &solver_type) : - solver_type(solver_type) + const std::string &solver_type) + : solver_type(solver_type) {} @@ -431,10 +431,10 @@ namespace CUDAWrappers template SolverDirect::SolverDirect(const Utilities::CUDA::Handle &handle, SolverControl & cn, - const AdditionalData & data) : - cuda_handle(handle), - solver_control(cn), - additional_data(data.solver_type) + const AdditionalData & data) + : cuda_handle(handle) + , solver_control(cn) + , additional_data(data.solver_type) {} @@ -456,8 +456,10 @@ namespace CUDAWrappers const LinearAlgebra::CUDAWrappers::Vector &b) { if (additional_data.solver_type == "Cholesky") - internal::cholesky_factorization( - cuda_handle.cusolver_sp_handle, A, b.get_values(), x.get_values()); + internal::cholesky_factorization(cuda_handle.cusolver_sp_handle, + A, + b.get_values(), + x.get_values()); else if (additional_data.solver_type == "LU_dense") internal::lu_factorization(cuda_handle.cusparse_handle, cuda_handle.cusolver_dn_handle, @@ -465,8 +467,10 @@ namespace CUDAWrappers b.get_values(), x.get_values()); else if (additional_data.solver_type == "LU_host") - internal::lu_factorization( - cuda_handle.cusolver_sp_handle, A, b.get_values(), x.get_values()); + internal::lu_factorization(cuda_handle.cusolver_sp_handle, + A, + b.get_values(), + x.get_values()); else AssertThrow(false, ExcMessage("The provided solver name " + diff --git a/source/lac/cuda_sparse_matrix.cu b/source/lac/cuda_sparse_matrix.cu index 792df619f5..dfd9d7956b 100644 --- a/source/lac/cuda_sparse_matrix.cu +++ b/source/lac/cuda_sparse_matrix.cu @@ -165,13 +165,13 @@ namespace CUDAWrappers template - SparseMatrix::SparseMatrix() : - nnz(0), - n_rows(0), - val_dev(nullptr), - column_index_dev(nullptr), - row_ptr_dev(nullptr), - descr(nullptr) + SparseMatrix::SparseMatrix() + : nnz(0) + , n_rows(0) + , val_dev(nullptr) + , column_index_dev(nullptr) + , row_ptr_dev(nullptr) + , descr(nullptr) {} @@ -179,11 +179,11 @@ namespace CUDAWrappers template SparseMatrix::SparseMatrix( Utilities::CUDA::Handle & handle, - const ::dealii::SparseMatrix &sparse_matrix_host) : - val_dev(nullptr), - column_index_dev(nullptr), - row_ptr_dev(nullptr), - descr(nullptr) + const ::dealii::SparseMatrix &sparse_matrix_host) + : val_dev(nullptr) + , column_index_dev(nullptr) + , row_ptr_dev(nullptr) + , descr(nullptr) { reinit(handle, sparse_matrix_host); } @@ -299,8 +299,10 @@ namespace CUDAWrappers // Copy the elements to the gpu cudaError_t error_code = cudaMalloc(&val_dev, nnz * sizeof(Number)); AssertCuda(error_code); - error_code = cudaMemcpy( - val_dev, &val[0], nnz * sizeof(Number), cudaMemcpyHostToDevice); + error_code = cudaMemcpy(val_dev, + &val[0], + nnz * sizeof(Number), + cudaMemcpyHostToDevice); AssertCuda(error_code); // Copy the column indices to the gpu diff --git a/source/lac/cuda_vector.cu b/source/lac/cuda_vector.cu index 1aee0a2a46..7f6b1c40e2 100644 --- a/source/lac/cuda_vector.cu +++ b/source/lac/cuda_vector.cu @@ -195,23 +195,29 @@ namespace LinearAlgebra typename Vector::size_type local_idx) { if (block_size >= 64) - result_buffer[local_idx] = Operation::reduction_op( - result_buffer[local_idx], result_buffer[local_idx + 32]); + result_buffer[local_idx] = + Operation::reduction_op(result_buffer[local_idx], + result_buffer[local_idx + 32]); if (block_size >= 32) - result_buffer[local_idx] = Operation::reduction_op( - result_buffer[local_idx], result_buffer[local_idx + 16]); + result_buffer[local_idx] = + Operation::reduction_op(result_buffer[local_idx], + result_buffer[local_idx + 16]); if (block_size >= 16) - result_buffer[local_idx] = Operation::reduction_op( - result_buffer[local_idx], result_buffer[local_idx + 8]); + result_buffer[local_idx] = + Operation::reduction_op(result_buffer[local_idx], + result_buffer[local_idx + 8]); if (block_size >= 8) - result_buffer[local_idx] = Operation::reduction_op( - result_buffer[local_idx], result_buffer[local_idx + 4]); + result_buffer[local_idx] = + Operation::reduction_op(result_buffer[local_idx], + result_buffer[local_idx + 4]); if (block_size >= 4) - result_buffer[local_idx] = Operation::reduction_op( - result_buffer[local_idx], result_buffer[local_idx + 2]); + result_buffer[local_idx] = + Operation::reduction_op(result_buffer[local_idx], + result_buffer[local_idx + 2]); if (block_size >= 2) - result_buffer[local_idx] = Operation::reduction_op( - result_buffer[local_idx], result_buffer[local_idx + 1]); + result_buffer[local_idx] = + Operation::reduction_op(result_buffer[local_idx], + result_buffer[local_idx + 1]); } @@ -228,8 +234,9 @@ namespace LinearAlgebra s = s >> 1) { if (local_idx < s) - result_buffer[local_idx] = Operation::reduction_op( - result_buffer[local_idx], result_buffer[local_idx + s]); + result_buffer[local_idx] = + Operation::reduction_op(result_buffer[local_idx], + result_buffer[local_idx + s]); __syncthreads(); } @@ -499,27 +506,34 @@ namespace LinearAlgebra template - Vector::Vector() : val(nullptr), n_elements(0) + Vector::Vector() + : val(nullptr) + , n_elements(0) {} template - Vector::Vector(const Vector &V) : n_elements(V.n_elements) + Vector::Vector(const Vector &V) + : n_elements(V.n_elements) { // Allocate the memory cudaError_t error_code = cudaMalloc(&val, n_elements * sizeof(Number)); AssertCuda(error_code); // Copy the values. - error_code = cudaMemcpy( - val, V.val, n_elements * sizeof(Number), cudaMemcpyDeviceToDevice); + error_code = cudaMemcpy(val, + V.val, + n_elements * sizeof(Number), + cudaMemcpyDeviceToDevice); AssertCuda(error_code); } template - Vector::Vector(const size_type n) : val(nullptr), n_elements(0) + Vector::Vector(const size_type n) + : val(nullptr) + , n_elements(0) { reinit(n, false); } @@ -767,16 +781,18 @@ namespace LinearAlgebra const int n_blocks = 1 + (n_elements - 1) / (chunk_size * block_size); internal::double_vector_reduction> - <<>>( - result_device, - val, - down_V.val, - static_cast(n_elements)); + <<>>(result_device, + val, + down_V.val, + static_cast( + n_elements)); // Copy the result back to the host Number result; - error_code = cudaMemcpy( - &result, result_device, sizeof(Number), cudaMemcpyDeviceToHost); + error_code = cudaMemcpy(&result, + result_device, + sizeof(Number), + cudaMemcpyDeviceToHost); AssertCuda(error_code); // Free the memory on the device error_code = cudaFree(result_device); @@ -920,8 +936,10 @@ namespace LinearAlgebra "Cannot scale two vectors with different numbers of elements.")); const int n_blocks = 1 + (n_elements - 1) / (chunk_size * block_size); - internal::scale<<>>( - val, down_scaling_factors.val, n_elements); + internal::scale + <<>>(val, + down_scaling_factors.val, + n_elements); // Check that the kernel was launched correctly AssertCuda(cudaGetLastError()); @@ -980,13 +998,16 @@ namespace LinearAlgebra const int n_blocks = 1 + (n_elements - 1) / (chunk_size * block_size); internal::reduction> - <<>>( - result_device, val, n_elements); + <<>>(result_device, + val, + n_elements); // Copy the result back to the host Number result; - error_code = cudaMemcpy( - &result, result_device, sizeof(Number), cudaMemcpyDeviceToHost); + error_code = cudaMemcpy(&result, + result_device, + sizeof(Number), + cudaMemcpyDeviceToHost); AssertCuda(error_code); // Free the memory on the device error_code = cudaFree(result_device); @@ -1009,13 +1030,16 @@ namespace LinearAlgebra const int n_blocks = 1 + (n_elements - 1) / (chunk_size * block_size); internal::reduction> - <<>>( - result_device, val, n_elements); + <<>>(result_device, + val, + n_elements); // Copy the result back to the host Number result; - error_code = cudaMemcpy( - &result, result_device, sizeof(Number), cudaMemcpyDeviceToHost); + error_code = cudaMemcpy(&result, + result_device, + sizeof(Number), + cudaMemcpyDeviceToHost); AssertCuda(error_code); // Free the memory on the device error_code = cudaFree(result_device); @@ -1046,13 +1070,16 @@ namespace LinearAlgebra const int n_blocks = 1 + (n_elements - 1) / (chunk_size * block_size); internal::reduction> - <<>>( - result_device, val, n_elements); + <<>>(result_device, + val, + n_elements); // Copy the result back to the host Number result; - error_code = cudaMemcpy( - &result, result_device, sizeof(Number), cudaMemcpyDeviceToHost); + error_code = cudaMemcpy(&result, + result_device, + sizeof(Number), + cudaMemcpyDeviceToHost); AssertCuda(error_code); // Free the memory on the device error_code = cudaFree(result_device); @@ -1129,8 +1156,10 @@ namespace LinearAlgebra // Copy the vector to the host Number * cpu_val = new Number[n_elements]; - cudaError_t error_code = cudaMemcpy( - cpu_val, val, n_elements * sizeof(Number), cudaMemcpyHostToDevice); + cudaError_t error_code = cudaMemcpy(cpu_val, + val, + n_elements * sizeof(Number), + cudaMemcpyHostToDevice); AssertCuda(error_code); for (unsigned int i = 0; i < n_elements; ++i) out << cpu_val[i] << std::endl; diff --git a/source/lac/dynamic_sparsity_pattern.cc b/source/lac/dynamic_sparsity_pattern.cc index 9de9ec5eb9..567340242a 100644 --- a/source/lac/dynamic_sparsity_pattern.cc +++ b/source/lac/dynamic_sparsity_pattern.cc @@ -217,22 +217,21 @@ DynamicSparsityPattern::Line::memory_consumption() const } -DynamicSparsityPattern::DynamicSparsityPattern() : - have_entries(false), - rows(0), - cols(0), - rowset(0) +DynamicSparsityPattern::DynamicSparsityPattern() + : have_entries(false) + , rows(0) + , cols(0) + , rowset(0) {} -DynamicSparsityPattern::DynamicSparsityPattern( - const DynamicSparsityPattern &s) : - Subscriptor(), - have_entries(false), - rows(0), - cols(0), - rowset(0) +DynamicSparsityPattern::DynamicSparsityPattern(const DynamicSparsityPattern &s) + : Subscriptor() + , have_entries(false) + , rows(0) + , cols(0) + , rowset(0) { (void)s; Assert(s.rows == 0 && s.cols == 0, @@ -246,31 +245,31 @@ DynamicSparsityPattern::DynamicSparsityPattern( DynamicSparsityPattern::DynamicSparsityPattern(const size_type m, const size_type n, - const IndexSet &rowset_) : - have_entries(false), - rows(0), - cols(0), - rowset(0) + const IndexSet &rowset_) + : have_entries(false) + , rows(0) + , cols(0) + , rowset(0) { reinit(m, n, rowset_); } -DynamicSparsityPattern::DynamicSparsityPattern(const IndexSet &rowset_) : - have_entries(false), - rows(0), - cols(0), - rowset(0) +DynamicSparsityPattern::DynamicSparsityPattern(const IndexSet &rowset_) + : have_entries(false) + , rows(0) + , cols(0) + , rowset(0) { reinit(rowset_.size(), rowset_.size(), rowset_); } -DynamicSparsityPattern::DynamicSparsityPattern(const size_type n) : - have_entries(false), - rows(0), - cols(0), - rowset(0) +DynamicSparsityPattern::DynamicSparsityPattern(const size_type n) + : have_entries(false) + , rows(0) + , cols(0) + , rowset(0) { reinit(n, n); } @@ -281,11 +280,11 @@ DynamicSparsityPattern & DynamicSparsityPattern::operator=(const DynamicSparsityPattern &s) { (void)s; - Assert( - s.rows == 0 && s.cols == 0, - ExcMessage("This operator can only be called if the provided argument " - "is the sparsity pattern for an empty matrix. This operator can " - "not be used to copy a non-empty sparsity pattern.")); + Assert(s.rows == 0 && s.cols == 0, + ExcMessage( + "This operator can only be called if the provided argument " + "is the sparsity pattern for an empty matrix. This operator can " + "not be used to copy a non-empty sparsity pattern.")); Assert(rows == 0 && cols == 0, ExcMessage("This operator can only be called if the current object is" @@ -306,14 +305,14 @@ DynamicSparsityPattern::reinit(const size_type m, cols = n; rowset = rowset_; - Assert( - rowset.size() == 0 || rowset.size() == m, - ExcMessage("The IndexSet argument to this function needs to either " - "be empty (indicating the complete set of rows), or have size " - "equal to the desired number of rows as specified by the " - "first argument to this function. (Of course, the number " - "of indices in this IndexSet may be less than the number " - "of rows, but the *size* of the IndexSet must be equal.)")); + Assert(rowset.size() == 0 || rowset.size() == m, + ExcMessage( + "The IndexSet argument to this function needs to either " + "be empty (indicating the complete set of rows), or have size " + "equal to the desired number of rows as specified by the " + "first argument to this function. (Of course, the number " + "of indices in this IndexSet may be less than the number " + "of rows, but the *size* of the IndexSet must be equal.)")); std::vector new_lines(rowset.size() == 0 ? rows : rowset.n_elements()); lines.swap(new_lines); @@ -365,8 +364,9 @@ DynamicSparsityPattern::exists(const size_type i, const size_type j) const const size_type rowindex = rowset.size() == 0 ? i : rowset.index_within_set(i); - return std::binary_search( - lines[rowindex].entries.begin(), lines[rowindex].entries.end(), j); + return std::binary_search(lines[rowindex].entries.begin(), + lines[rowindex].entries.end(), + j); } diff --git a/source/lac/exceptions.cc b/source/lac/exceptions.cc index 918ca00d31..e481beef4a 100644 --- a/source/lac/exceptions.cc +++ b/source/lac/exceptions.cc @@ -26,7 +26,8 @@ DEAL_II_NAMESPACE_OPEN namespace LACExceptions { - ExcPETScError::ExcPETScError(const int error_code) : error_code(error_code) + ExcPETScError::ExcPETScError(const int error_code) + : error_code(error_code) {} void diff --git a/source/lac/full_matrix.inst.in b/source/lac/full_matrix.inst.in index 91fc815eb9..a6c3ee23f9 100644 --- a/source/lac/full_matrix.inst.in +++ b/source/lac/full_matrix.inst.in @@ -19,10 +19,12 @@ for (S : REAL_AND_COMPLEX_SCALARS) { template class FullMatrix; - template void FullMatrix::print( - LogStream &, const unsigned int, const unsigned int) const; - template void FullMatrix::print( - std::ostream &, const unsigned int, const unsigned int) const; + template void FullMatrix::print(LogStream &, + const unsigned int, + const unsigned int) const; + template void FullMatrix::print(std::ostream &, + const unsigned int, + const unsigned int) const; template void FullMatrix::copy_from<1>(const Tensor<2, 1> &, const unsigned int, @@ -86,8 +88,10 @@ for (S1, S2 : REAL_SCALARS) template void FullMatrix::fill( const FullMatrix &, size_type, size_type, size_type, size_type); template void FullMatrix::add(const S1, const FullMatrix &); - template void FullMatrix::add( - const S1, const FullMatrix &, const S1, const FullMatrix &); + template void FullMatrix::add(const S1, + const FullMatrix &, + const S1, + const FullMatrix &); template void FullMatrix::add(const S1, const FullMatrix &, const S1, @@ -100,22 +104,28 @@ for (S1, S2 : REAL_SCALARS) template void FullMatrix::Tadd( const FullMatrix &, S1, size_type, size_type, size_type, size_type); template void FullMatrix::equ(const S1, const FullMatrix &); - template void FullMatrix::equ( - const S1, const FullMatrix &, const S1, const FullMatrix &); + template void FullMatrix::equ(const S1, + const FullMatrix &, + const S1, + const FullMatrix &); template void FullMatrix::equ(const S1, const FullMatrix &, const S1, const FullMatrix &, const S1, const FullMatrix &); - template void FullMatrix::mmult( - FullMatrix &, const FullMatrix &, const bool) const; - template void FullMatrix::Tmmult( - FullMatrix &, const FullMatrix &, const bool) const; - template void FullMatrix::mTmult( - FullMatrix &, const FullMatrix &, const bool) const; - template void FullMatrix::TmTmult( - FullMatrix &, const FullMatrix &, const bool) const; + template void FullMatrix::mmult(FullMatrix &, + const FullMatrix &, + const bool) const; + template void FullMatrix::Tmmult(FullMatrix &, + const FullMatrix &, + const bool) const; + template void FullMatrix::mTmult(FullMatrix &, + const FullMatrix &, + const bool) const; + template void FullMatrix::TmTmult(FullMatrix &, + const FullMatrix &, + const bool) const; template void FullMatrix::invert(const FullMatrix &); template void FullMatrix::left_invert(const FullMatrix &); @@ -136,50 +146,59 @@ for (S1, S2 : REAL_SCALARS) // real matrices can be multiplied by real or complex vectors for (S1 : REAL_SCALARS; S2 : REAL_AND_COMPLEX_SCALARS) { - template void FullMatrix::vmult( - Vector &, const Vector &, bool) const; - template void FullMatrix::Tvmult( - Vector &, const Vector &, bool) const; - template S2 FullMatrix::matrix_norm_square(const Vector &) + template void FullMatrix::vmult(Vector &, + const Vector &, + bool) const; + template void FullMatrix::Tvmult(Vector &, + const Vector &, + bool) const; + template S2 FullMatrix::matrix_norm_square(const Vector &) + const; + template S2 FullMatrix::matrix_scalar_product(const Vector &, + const Vector &) const; - template S2 FullMatrix::matrix_scalar_product( - const Vector &, const Vector &) const; template void FullMatrix::forward(Vector &, const Vector &) const; template void FullMatrix::backward(Vector &, const Vector &) const; - template void FullMatrix::precondition_Jacobi( - Vector &, const Vector &, const S1) const; + template void FullMatrix::precondition_Jacobi(Vector &, + const Vector &, + const S1) const; } // complex matrices can be multiplied only by complex vectors for (S1 : COMPLEX_SCALARS; S2 : COMPLEX_SCALARS) { - template void FullMatrix::vmult( - Vector &, const Vector &, bool) const; - template void FullMatrix::Tvmult( - Vector &, const Vector &, bool) const; - template S2 FullMatrix::matrix_norm_square(const Vector &) + template void FullMatrix::vmult(Vector &, + const Vector &, + bool) const; + template void FullMatrix::Tvmult(Vector &, + const Vector &, + bool) const; + template S2 FullMatrix::matrix_norm_square(const Vector &) + const; + template S2 FullMatrix::matrix_scalar_product(const Vector &, + const Vector &) const; - template S2 FullMatrix::matrix_scalar_product( - const Vector &, const Vector &) const; template void FullMatrix::forward(Vector &, const Vector &) const; template void FullMatrix::backward(Vector &, const Vector &) const; - template void FullMatrix::precondition_Jacobi( - Vector &, const Vector &, const S1) const; + template void FullMatrix::precondition_Jacobi(Vector &, + const Vector &, + const S1) const; } for (S1, S2, S3 : REAL_SCALARS) { - template S1 FullMatrix::residual( - Vector &, const Vector &, const Vector &) const; + template S1 FullMatrix::residual(Vector &, + const Vector &, + const Vector &) const; } @@ -189,8 +208,10 @@ for (S1, S2 : COMPLEX_SCALARS) template void FullMatrix::fill( const FullMatrix &, size_type, size_type, size_type, size_type); template void FullMatrix::add(const S1, const FullMatrix &); - template void FullMatrix::add( - const S1, const FullMatrix &, const S1, const FullMatrix &); + template void FullMatrix::add(const S1, + const FullMatrix &, + const S1, + const FullMatrix &); template void FullMatrix::add(const S1, const FullMatrix &, const S1, @@ -203,18 +224,22 @@ for (S1, S2 : COMPLEX_SCALARS) template void FullMatrix::Tadd( const FullMatrix &, S1, size_type, size_type, size_type, size_type); template void FullMatrix::equ(const S1, const FullMatrix &); - template void FullMatrix::equ( - const S1, const FullMatrix &, const S1, const FullMatrix &); + template void FullMatrix::equ(const S1, + const FullMatrix &, + const S1, + const FullMatrix &); template void FullMatrix::equ(const S1, const FullMatrix &, const S1, const FullMatrix &, const S1, const FullMatrix &); - template void FullMatrix::mmult( - FullMatrix &, const FullMatrix &, const bool) const; - template void FullMatrix::Tmmult( - FullMatrix &, const FullMatrix &, const bool) const; + template void FullMatrix::mmult(FullMatrix &, + const FullMatrix &, + const bool) const; + template void FullMatrix::Tmmult(FullMatrix &, + const FullMatrix &, + const bool) const; template void FullMatrix::invert(const FullMatrix &); template void FullMatrix::left_invert(const FullMatrix &); @@ -228,6 +253,7 @@ for (S1, S2 : COMPLEX_SCALARS) for (S1, S2, S3 : COMPLEX_SCALARS) { - template S1 FullMatrix::residual( - Vector &, const Vector &, const Vector &) const; + template S1 FullMatrix::residual(Vector &, + const Vector &, + const Vector &) const; } diff --git a/source/lac/lapack_full_matrix.cc b/source/lac/lapack_full_matrix.cc index 442dbe534c..80532838be 100644 --- a/source/lac/lapack_full_matrix.cc +++ b/source/lac/lapack_full_matrix.cc @@ -31,27 +31,26 @@ DEAL_II_NAMESPACE_OPEN using namespace LAPACKSupport; template -LAPACKFullMatrix::LAPACKFullMatrix(const size_type n) : - TransposeTable(n, n), - state(matrix), - property(general) +LAPACKFullMatrix::LAPACKFullMatrix(const size_type n) + : TransposeTable(n, n) + , state(matrix) + , property(general) {} template -LAPACKFullMatrix::LAPACKFullMatrix(const size_type m, - const size_type n) : - TransposeTable(m, n), - state(matrix), - property(general) +LAPACKFullMatrix::LAPACKFullMatrix(const size_type m, const size_type n) + : TransposeTable(m, n) + , state(matrix) + , property(general) {} template -LAPACKFullMatrix::LAPACKFullMatrix(const LAPACKFullMatrix &M) : - TransposeTable(M), - state(matrix), - property(general) +LAPACKFullMatrix::LAPACKFullMatrix(const LAPACKFullMatrix &M) + : TransposeTable(M) + , state(matrix) + , property(general) {} @@ -1491,9 +1490,9 @@ LAPACKFullMatrix::solve(Vector &v, const bool transposed) const } else { - Assert( - false, - ExcMessage("The matrix has to be either factorized or triangular.")); + Assert(false, + ExcMessage( + "The matrix has to be either factorized or triangular.")); } Assert(info == 0, ExcInternalError()); @@ -1546,9 +1545,9 @@ LAPACKFullMatrix::solve(LAPACKFullMatrix &B, } else { - Assert( - false, - ExcMessage("The matrix has to be either factorized or triangular.")); + Assert(false, + ExcMessage( + "The matrix has to be either factorized or triangular.")); } Assert(info == 0, ExcInternalError()); diff --git a/source/lac/matrix_lib.cc b/source/lac/matrix_lib.cc index d8826ebc4c..cee3ab37c1 100644 --- a/source/lac/matrix_lib.cc +++ b/source/lac/matrix_lib.cc @@ -18,7 +18,8 @@ DEAL_II_NAMESPACE_OPEN -MeanValueFilter::MeanValueFilter(size_type component) : component(component) +MeanValueFilter::MeanValueFilter(size_type component) + : component(component) {} template void diff --git a/source/lac/matrix_out.cc b/source/lac/matrix_out.cc index dbc4233bab..86b58a1878 100644 --- a/source/lac/matrix_out.cc +++ b/source/lac/matrix_out.cc @@ -20,10 +20,10 @@ DEAL_II_NAMESPACE_OPEN MatrixOut::Options::Options(const bool show_absolute_values, const unsigned int block_size, - const bool discontinuous) : - show_absolute_values(show_absolute_values), - block_size(block_size), - discontinuous(discontinuous) + const bool discontinuous) + : show_absolute_values(show_absolute_values) + , block_size(block_size) + , discontinuous(discontinuous) {} diff --git a/source/lac/petsc_matrix_base.cc b/source/lac/petsc_matrix_base.cc index d87389ece8..8cd7b94b90 100644 --- a/source/lac/petsc_matrix_base.cc +++ b/source/lac/petsc_matrix_base.cc @@ -73,9 +73,9 @@ namespace PETScWrappers - MatrixBase::MatrixBase() : - matrix(nullptr), - last_action(VectorOperation::unknown) + MatrixBase::MatrixBase() + : matrix(nullptr) + , last_action(VectorOperation::unknown) {} diff --git a/source/lac/petsc_matrix_free.cc b/source/lac/petsc_matrix_free.cc index 7b075a0d99..c73cf83828 100644 --- a/source/lac/petsc_matrix_free.cc +++ b/source/lac/petsc_matrix_free.cc @@ -25,7 +25,8 @@ DEAL_II_NAMESPACE_OPEN namespace PETScWrappers { - MatrixFree::MatrixFree() : communicator(PETSC_COMM_SELF) + MatrixFree::MatrixFree() + : communicator(PETSC_COMM_SELF) { const int m = 0; do_reinit(m, m, m, m); @@ -37,8 +38,8 @@ namespace PETScWrappers const unsigned int m, const unsigned int n, const unsigned int local_rows, - const unsigned int local_columns) : - communicator(communicator) + const unsigned int local_columns) + : communicator(communicator) { do_reinit(m, n, local_rows, local_columns); } @@ -51,8 +52,8 @@ namespace PETScWrappers const unsigned int n, const std::vector &local_rows_per_process, const std::vector &local_columns_per_process, - const unsigned int this_process) : - communicator(communicator) + const unsigned int this_process) + : communicator(communicator) { Assert(local_rows_per_process.size() == local_columns_per_process.size(), ExcDimensionMismatch(local_rows_per_process.size(), @@ -70,8 +71,8 @@ namespace PETScWrappers MatrixFree::MatrixFree(const unsigned int m, const unsigned int n, const unsigned int local_rows, - const unsigned int local_columns) : - communicator(MPI_COMM_WORLD) + const unsigned int local_columns) + : communicator(MPI_COMM_WORLD) { do_reinit(m, n, local_rows, local_columns); } @@ -83,8 +84,8 @@ namespace PETScWrappers const unsigned int n, const std::vector &local_rows_per_process, const std::vector &local_columns_per_process, - const unsigned int this_process) : - communicator(MPI_COMM_WORLD) + const unsigned int this_process) + : communicator(MPI_COMM_WORLD) { Assert(local_rows_per_process.size() == local_columns_per_process.size(), ExcDimensionMismatch(local_rows_per_process.size(), diff --git a/source/lac/petsc_parallel_sparse_matrix.cc b/source/lac/petsc_parallel_sparse_matrix.cc index b853dbb36f..ae3f970d33 100644 --- a/source/lac/petsc_parallel_sparse_matrix.cc +++ b/source/lac/petsc_parallel_sparse_matrix.cc @@ -31,7 +31,8 @@ namespace PETScWrappers { namespace MPI { - SparseMatrix::SparseMatrix() : communicator(MPI_COMM_SELF) + SparseMatrix::SparseMatrix() + : communicator(MPI_COMM_SELF) { // just like for vectors: since we // create an empty matrix, we can as @@ -55,8 +56,8 @@ namespace PETScWrappers const size_type local_columns, const size_type n_nonzero_per_row, const bool is_symmetric, - const size_type n_offdiag_nonzero_per_row) : - communicator(communicator) + const size_type n_offdiag_nonzero_per_row) + : communicator(communicator) { do_reinit(m, n, @@ -77,8 +78,8 @@ namespace PETScWrappers const size_type local_columns, const std::vector &row_lengths, const bool is_symmetric, - const std::vector &offdiag_row_lengths) : - communicator(communicator) + const std::vector &offdiag_row_lengths) + : communicator(communicator) { do_reinit(m, n, @@ -98,8 +99,8 @@ namespace PETScWrappers const std::vector &local_rows_per_process, const std::vector &local_columns_per_process, const unsigned int this_process, - const bool preset_nonzero_locations) : - communicator(communicator) + const bool preset_nonzero_locations) + : communicator(communicator) { do_reinit(sparsity_pattern, local_rows_per_process, @@ -316,17 +317,19 @@ namespace PETScWrappers // TODO: There must be a significantly better way to provide information // about the off-diagonal blocks of the matrix. this way, petsc keeps // allocating tiny chunks of memory, and gets completely hung up over this - const PetscErrorCode ierr = MatCreateAIJ( - communicator, - local_rows, - local_columns, - m, - n, - 0, - int_row_lengths.data(), - 0, - offdiag_row_lengths.size() ? int_offdiag_row_lengths.data() : nullptr, - &matrix); + const PetscErrorCode ierr = + MatCreateAIJ(communicator, + local_rows, + local_columns, + m, + n, + 0, + int_row_lengths.data(), + 0, + offdiag_row_lengths.size() ? + int_offdiag_row_lengths.data() : + nullptr, + &matrix); // TODO: Sometimes the actual number of nonzero entries allocated is // greater than the number of nonzero entries, which petsc will complain @@ -703,9 +706,9 @@ namespace PETScWrappers ierr = MatGetOwnershipRangeColumn(matrix, &min, &max); AssertThrow(ierr == 0, ExcPETScError(ierr)); - Assert( - n_loc_cols == max - min, - ExcMessage("PETSc is requiring non contiguous memory allocation.")); + Assert(n_loc_cols == max - min, + ExcMessage( + "PETSc is requiring non contiguous memory allocation.")); IndexSet indices(n_cols); indices.add_range(min, max); @@ -729,9 +732,9 @@ namespace PETScWrappers ierr = MatGetOwnershipRange(matrix, &min, &max); AssertThrow(ierr == 0, ExcPETScError(ierr)); - Assert( - n_loc_rows == max - min, - ExcMessage("PETSc is requiring non contiguous memory allocation.")); + Assert(n_loc_rows == max - min, + ExcMessage( + "PETSc is requiring non contiguous memory allocation.")); IndexSet indices(n_rows); indices.add_range(min, max); diff --git a/source/lac/petsc_parallel_vector.cc b/source/lac/petsc_parallel_vector.cc index 0f86dd0cec..22621dbc7d 100644 --- a/source/lac/petsc_parallel_vector.cc +++ b/source/lac/petsc_parallel_vector.cc @@ -28,7 +28,8 @@ namespace PETScWrappers { namespace MPI { - Vector::Vector() : communicator(MPI_COMM_SELF) + Vector::Vector() + : communicator(MPI_COMM_SELF) { // virtual functions called in constructors and destructors never use the // override in a derived class @@ -40,8 +41,8 @@ namespace PETScWrappers Vector::Vector(const MPI_Comm &communicator, const size_type n, - const size_type local_size) : - communicator(communicator) + const size_type local_size) + : communicator(communicator) { Vector::create_vector(n, local_size); } @@ -50,9 +51,9 @@ namespace PETScWrappers Vector::Vector(const MPI_Comm & communicator, const VectorBase &v, - const size_type local_size) : - VectorBase(v), - communicator(communicator) + const size_type local_size) + : VectorBase(v) + , communicator(communicator) { // In the past (before it was deprecated) this constructor did a // byte-for-byte copy of v. This choice resulted in two problems: @@ -70,8 +71,8 @@ namespace PETScWrappers Vector::Vector(const IndexSet &local, const IndexSet &ghost, - const MPI_Comm &communicator) : - communicator(communicator) + const MPI_Comm &communicator) + : communicator(communicator) { Assert(local.is_ascending_and_one_to_one(communicator), ExcNotImplemented()); @@ -84,8 +85,8 @@ namespace PETScWrappers - Vector::Vector(const IndexSet &local, const MPI_Comm &communicator) : - communicator(communicator) + Vector::Vector(const IndexSet &local, const MPI_Comm &communicator) + : communicator(communicator) { Assert(local.is_ascending_and_one_to_one(communicator), ExcNotImplemented()); diff --git a/source/lac/petsc_precondition.cc b/source/lac/petsc_precondition.cc index 2734c4e0e3..cccfd03301 100644 --- a/source/lac/petsc_precondition.cc +++ b/source/lac/petsc_precondition.cc @@ -33,7 +33,9 @@ DEAL_II_NAMESPACE_OPEN namespace PETScWrappers { - PreconditionerBase::PreconditionerBase() : pc(nullptr), matrix(nullptr) + PreconditionerBase::PreconditionerBase() + : pc(nullptr) + , matrix(nullptr) {} PreconditionerBase::~PreconditionerBase() @@ -211,8 +213,8 @@ namespace PETScWrappers /* ----------------- PreconditionSOR -------------------- */ - PreconditionSOR::AdditionalData::AdditionalData(const double omega) : - omega(omega) + PreconditionSOR::AdditionalData::AdditionalData(const double omega) + : omega(omega) {} @@ -252,8 +254,8 @@ namespace PETScWrappers /* ----------------- PreconditionSSOR -------------------- */ - PreconditionSSOR::AdditionalData::AdditionalData(const double omega) : - omega(omega) + PreconditionSSOR::AdditionalData::AdditionalData(const double omega) + : omega(omega) {} @@ -297,8 +299,8 @@ namespace PETScWrappers /* ----------------- PreconditionEisenstat -------------------- */ - PreconditionEisenstat::AdditionalData::AdditionalData(const double omega) : - omega(omega) + PreconditionEisenstat::AdditionalData::AdditionalData(const double omega) + : omega(omega) {} @@ -340,8 +342,8 @@ namespace PETScWrappers /* ----------------- PreconditionICC -------------------- */ - PreconditionICC::AdditionalData::AdditionalData(const unsigned int levels) : - levels(levels) + PreconditionICC::AdditionalData::AdditionalData(const unsigned int levels) + : levels(levels) {} @@ -381,8 +383,8 @@ namespace PETScWrappers /* ----------------- PreconditionILU -------------------- */ - PreconditionILU::AdditionalData::AdditionalData(const unsigned int levels) : - levels(levels) + PreconditionILU::AdditionalData::AdditionalData(const unsigned int levels) + : levels(levels) {} @@ -427,12 +429,12 @@ namespace PETScWrappers const double strong_threshold, const double max_row_sum, const unsigned int aggressive_coarsening_num_levels, - const bool output_details) : - symmetric_operator(symmetric_operator), - strong_threshold(strong_threshold), - max_row_sum(max_row_sum), - aggressive_coarsening_num_levels(aggressive_coarsening_num_levels), - output_details(output_details) + const bool output_details) + : symmetric_operator(symmetric_operator) + , strong_threshold(strong_threshold) + , max_row_sum(max_row_sum) + , aggressive_coarsening_num_levels(aggressive_coarsening_num_levels) + , output_details(output_details) {} @@ -479,9 +481,9 @@ namespace PETScWrappers set_option_value("-pc_hypre_boomeramg_print_statistics", "1"); } - set_option_value( - "-pc_hypre_boomeramg_agg_nl", - Utilities::to_string(additional_data.aggressive_coarsening_num_levels)); + set_option_value("-pc_hypre_boomeramg_agg_nl", + Utilities::to_string( + additional_data.aggressive_coarsening_num_levels)); std::stringstream ssStream; ssStream << additional_data.max_row_sum; @@ -550,12 +552,12 @@ namespace PETScWrappers const unsigned int n_levels, const double threshold, const double filter, - const bool output_details) : - symmetric(symmetric), - n_levels(n_levels), - threshold(threshold), - filter(filter), - output_details(output_details) + const bool output_details) + : symmetric(symmetric) + , n_levels(n_levels) + , threshold(threshold) + , filter(filter) + , output_details(output_details) {} @@ -688,10 +690,10 @@ namespace PETScWrappers PreconditionLU::AdditionalData::AdditionalData(const double pivoting, const double zero_pivot, - const double damping) : - pivoting(pivoting), - zero_pivot(zero_pivot), - damping(damping) + const double damping) + : pivoting(pivoting) + , zero_pivot(zero_pivot) + , damping(damping) {} diff --git a/source/lac/petsc_solver.cc b/source/lac/petsc_solver.cc index fe9acd420e..ea262c98ff 100644 --- a/source/lac/petsc_solver.cc +++ b/source/lac/petsc_solver.cc @@ -42,9 +42,9 @@ namespace PETScWrappers - SolverBase::SolverBase(SolverControl &cn, const MPI_Comm &mpi_communicator) : - solver_control(cn), - mpi_communicator(mpi_communicator) + SolverBase::SolverBase(SolverControl &cn, const MPI_Comm &mpi_communicator) + : solver_control(cn) + , mpi_communicator(mpi_communicator) {} @@ -97,8 +97,10 @@ namespace PETScWrappers # if DEAL_II_PETSC_VERSION_LT(3, 5, 0) // the last argument is irrelevant here, // since we use the solver only once anyway - ierr = KSPSetOperators( - solver_data->ksp, A, preconditioner, SAME_PRECONDITIONER); + ierr = KSPSetOperators(solver_data->ksp, + A, + preconditioner, + SAME_PRECONDITIONER); # else ierr = KSPSetOperators(solver_data->ksp, A, preconditioner); # endif @@ -247,17 +249,17 @@ namespace PETScWrappers /* ---------------------- SolverRichardson ------------------------ */ - SolverRichardson::AdditionalData::AdditionalData(const double omega) : - omega(omega) + SolverRichardson::AdditionalData::AdditionalData(const double omega) + : omega(omega) {} SolverRichardson::SolverRichardson(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) {} @@ -303,9 +305,9 @@ namespace PETScWrappers SolverChebychev::SolverChebychev(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) {} @@ -327,9 +329,9 @@ namespace PETScWrappers SolverCG::SolverCG(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) {} @@ -351,9 +353,9 @@ namespace PETScWrappers SolverBiCG::SolverBiCG(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) {} @@ -375,18 +377,18 @@ namespace PETScWrappers SolverGMRES::AdditionalData::AdditionalData( const unsigned int restart_parameter, - const bool right_preconditioning) : - restart_parameter(restart_parameter), - right_preconditioning(right_preconditioning) + const bool right_preconditioning) + : restart_parameter(restart_parameter) + , right_preconditioning(right_preconditioning) {} SolverGMRES::SolverGMRES(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) {} @@ -417,8 +419,9 @@ namespace PETScWrappers // and do some equally nasty stuff that at // least doesn't yield warnings... int (*fun_ptr)(KSP, int); - ierr = PetscObjectQueryFunction( - (PetscObject)(ksp), "KSPGMRESSetRestart_C", (void (**)()) & fun_ptr); + ierr = PetscObjectQueryFunction((PetscObject)(ksp), + "KSPGMRESSetRestart_C", + (void (**)()) & fun_ptr); AssertThrow(ierr == 0, ExcPETScError(ierr)); ierr = (*fun_ptr)(ksp, additional_data.restart_parameter); @@ -444,9 +447,9 @@ namespace PETScWrappers SolverBicgstab::SolverBicgstab(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) {} @@ -468,9 +471,9 @@ namespace PETScWrappers SolverCGS::SolverCGS(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) {} @@ -492,9 +495,9 @@ namespace PETScWrappers SolverTFQMR::SolverTFQMR(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) {} @@ -516,9 +519,9 @@ namespace PETScWrappers SolverTCQMR::SolverTCQMR(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) {} @@ -540,9 +543,9 @@ namespace PETScWrappers SolverCR::SolverCR(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) {} @@ -564,9 +567,9 @@ namespace PETScWrappers SolverLSQR::SolverLSQR(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) {} @@ -588,9 +591,9 @@ namespace PETScWrappers SolverPreOnly::SolverPreOnly(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) {} @@ -630,10 +633,10 @@ namespace PETScWrappers SparseDirectMUMPS::SparseDirectMUMPS(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data), - symmetric_mode(false) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) + , symmetric_mode(false) {} diff --git a/source/lac/petsc_sparse_matrix.cc b/source/lac/petsc_sparse_matrix.cc index a684ca78d2..325936ee0c 100644 --- a/source/lac/petsc_sparse_matrix.cc +++ b/source/lac/petsc_sparse_matrix.cc @@ -197,8 +197,10 @@ namespace PETScWrappers for (size_type i = 0; i < sparsity_pattern.n_rows(); ++i) row_lengths[i] = sparsity_pattern.row_length(i); - do_reinit( - sparsity_pattern.n_rows(), sparsity_pattern.n_cols(), row_lengths, false); + do_reinit(sparsity_pattern.n_rows(), + sparsity_pattern.n_cols(), + row_lengths, + false); // next preset the exact given matrix // entries with zeros, if the user diff --git a/source/lac/petsc_vector_base.cc b/source/lac/petsc_vector_base.cc index 8dc346dbfc..1a5b5843f8 100644 --- a/source/lac/petsc_vector_base.cc +++ b/source/lac/petsc_vector_base.cc @@ -112,11 +112,11 @@ namespace PETScWrappers } } // namespace internal - VectorBase::VectorBase() : - vector(nullptr), - ghosted(false), - last_action(::dealii::VectorOperation::unknown), - obtained_ownership(true) + VectorBase::VectorBase() + : vector(nullptr) + , ghosted(false) + , last_action(::dealii::VectorOperation::unknown) + , obtained_ownership(true) { Assert(MultithreadInfo::is_running_single_threaded(), ExcMessage("PETSc does not support multi-threaded access, set " @@ -125,12 +125,12 @@ namespace PETScWrappers - VectorBase::VectorBase(const VectorBase &v) : - Subscriptor(), - ghosted(v.ghosted), - ghost_indices(v.ghost_indices), - last_action(::dealii::VectorOperation::unknown), - obtained_ownership(true) + VectorBase::VectorBase(const VectorBase &v) + : Subscriptor() + , ghosted(v.ghosted) + , ghost_indices(v.ghost_indices) + , last_action(::dealii::VectorOperation::unknown) + , obtained_ownership(true) { Assert(MultithreadInfo::is_running_single_threaded(), ExcMessage("PETSc does not support multi-threaded access, set " @@ -145,12 +145,12 @@ namespace PETScWrappers - VectorBase::VectorBase(const Vec &v) : - Subscriptor(), - vector(v), - ghosted(false), - last_action(::dealii::VectorOperation::unknown), - obtained_ownership(false) + VectorBase::VectorBase(const Vec &v) + : Subscriptor() + , vector(v) + , ghosted(false) + , last_action(::dealii::VectorOperation::unknown) + , obtained_ownership(false) { Assert(MultithreadInfo::is_running_single_threaded(), ExcMessage("PETSc does not support multi-threaded access, set " diff --git a/source/lac/scalapack.cc b/source/lac/scalapack.cc index 1ad599ad6f..9baf808aa7 100644 --- a/source/lac/scalapack.cc +++ b/source/lac/scalapack.cc @@ -82,12 +82,13 @@ ScaLAPACKMatrix::ScaLAPACKMatrix( const std::shared_ptr &process_grid, const size_type row_block_size_, const size_type column_block_size_, - const LAPACKSupport::Property property_) : - uplo('L'), // for non-symmetric matrices this is not needed - first_process_row(0), - first_process_column(0), - submatrix_row(1), - submatrix_column(1) + const LAPACKSupport::Property property_) + : uplo('L') + , // for non-symmetric matrices this is not needed + first_process_row(0) + , first_process_column(0) + , submatrix_row(1) + , submatrix_column(1) { reinit(n_rows_, n_columns_, @@ -104,13 +105,13 @@ ScaLAPACKMatrix::ScaLAPACKMatrix( const size_type size, const std::shared_ptr process_grid, const size_type block_size, - const LAPACKSupport::Property property) : - ScaLAPACKMatrix(size, - size, - process_grid, - block_size, - block_size, - property) + const LAPACKSupport::Property property) + : ScaLAPACKMatrix(size, + size, + process_grid, + block_size, + block_size, + property) {} @@ -383,8 +384,9 @@ ScaLAPACKMatrix::copy_to( // Currently, copying of matrices will only be supported if A and B share the // same MPI communicator int ierr, comparison; - ierr = MPI_Comm_compare( - grid->mpi_communicator, B.grid->mpi_communicator, &comparison); + ierr = MPI_Comm_compare(grid->mpi_communicator, + B.grid->mpi_communicator, + &comparison); AssertThrowMPI(ierr); Assert(comparison == MPI_IDENT, ExcMessage("Matrix A and B must have a common MPI Communicator")); @@ -400,8 +402,10 @@ ScaLAPACKMatrix::copy_to( int union_n_process_rows = Utilities::MPI::n_mpi_processes(this->grid->mpi_communicator); int union_n_process_columns = 1; - Cblacs_gridinit( - &union_blacs_context, order, union_n_process_rows, union_n_process_columns); + Cblacs_gridinit(&union_blacs_context, + order, + union_n_process_rows, + union_n_process_columns); int n_grid_rows_A, n_grid_columns_A, my_row_A, my_column_A; Cblacs_gridinfo(this->grid->blacs_context, @@ -540,8 +544,10 @@ ScaLAPACKMatrix::copy_to(ScaLAPACKMatrix &dest) const // first argument, even if the program we are currently running // and that is calling this function only works on a subset of // processes. the same holds for the wrapper/fallback we are using here. - ierr = Utilities::MPI::create_group( - MPI_COMM_WORLD, group_union, 5, &mpi_communicator_union); + ierr = Utilities::MPI::create_group(MPI_COMM_WORLD, + group_union, + 5, + &mpi_communicator_union); AssertThrowMPI(ierr); /* @@ -755,9 +761,9 @@ ScaLAPACKMatrix::mult(const NumberType b, ExcDimensionMismatch(B.n_rows, C.n_columns)); Assert(this->row_block_size == C.row_block_size, ExcDimensionMismatch(this->row_block_size, C.row_block_size)); - Assert( - this->column_block_size == B.column_block_size, - ExcDimensionMismatch(this->column_block_size, B.column_block_size)); + Assert(this->column_block_size == B.column_block_size, + ExcDimensionMismatch(this->column_block_size, + B.column_block_size)); Assert(B.row_block_size == C.column_block_size, ExcDimensionMismatch(B.row_block_size, C.column_block_size)); } @@ -1098,8 +1104,9 @@ ScaLAPACKMatrix::eigenpairs_symmetric_by_value( Assert(!std::isnan(value_limits.second), ExcMessage("value_limits.second is NaN")); - std::pair indices = std::make_pair( - numbers::invalid_unsigned_int, numbers::invalid_unsigned_int); + std::pair indices = + std::make_pair(numbers::invalid_unsigned_int, + numbers::invalid_unsigned_int); return eigenpairs_symmetric(compute_eigenvectors, indices, value_limits); } @@ -1140,8 +1147,9 @@ ScaLAPACKMatrix::eigenpairs_symmetric( // distributed matrix std::unique_ptr> eigenvectors = compute_eigenvectors ? - std_cxx14::make_unique>( - n_rows, grid, row_block_size) : + std_cxx14::make_unique>(n_rows, + grid, + row_block_size) : std_cxx14::make_unique>( grid->n_process_rows, grid->n_process_columns, grid, 1, 1); @@ -1427,8 +1435,9 @@ ScaLAPACKMatrix::eigenpairs_symmetric_by_value_MRRR( AssertIsFinite(value_limits.first); AssertIsFinite(value_limits.second); - const std::pair indices = std::make_pair( - numbers::invalid_unsigned_int, numbers::invalid_unsigned_int); + const std::pair indices = + std::make_pair(numbers::invalid_unsigned_int, + numbers::invalid_unsigned_int); return eigenpairs_symmetric_MRRR(compute_eigenvectors, indices, value_limits); } @@ -1469,8 +1478,9 @@ ScaLAPACKMatrix::eigenpairs_symmetric_MRRR( // distributed matrix. std::unique_ptr> eigenvectors = compute_eigenvectors ? - std_cxx14::make_unique>( - n_rows, grid, row_block_size) : + std_cxx14::make_unique>(n_rows, + grid, + row_block_size) : std_cxx14::make_unique>( grid->n_process_rows, grid->n_process_columns, grid, 1, 1); @@ -1680,9 +1690,9 @@ ScaLAPACKMatrix::compute_SVD(ScaLAPACKMatrix *U, ExcDimensionMismatch(row_block_size, VT->row_block_size)); Assert(column_block_size == VT->column_block_size, ExcDimensionMismatch(column_block_size, VT->column_block_size)); - Assert( - grid->blacs_context == VT->grid->blacs_context, - ExcDimensionMismatch(grid->blacs_context, VT->grid->blacs_context)); + Assert(grid->blacs_context == VT->grid->blacs_context, + ExcDimensionMismatch(grid->blacs_context, + VT->grid->blacs_context)); } Threads::Mutex::ScopedLock lock(mutex); @@ -1789,15 +1799,15 @@ ScaLAPACKMatrix::least_squares(ScaLAPACKMatrix &B, // see // https://www.ibm.com/support/knowledgecenter/en/SSNR5K_4.2.0/com.ibm.cluster.pessl.v4r2.pssl100.doc/am6gr_lgels.htm - Assert( - row_block_size == column_block_size, - ExcMessage("Use identical block sizes for rows and columns of matrix A")); - Assert( - B.row_block_size == B.column_block_size, - ExcMessage("Use identical block sizes for rows and columns of matrix B")); - Assert( - row_block_size == B.row_block_size, - ExcMessage("Use identical block-cyclic distribution for matrices A and B")); + Assert(row_block_size == column_block_size, + ExcMessage( + "Use identical block sizes for rows and columns of matrix A")); + Assert(B.row_block_size == B.column_block_size, + ExcMessage( + "Use identical block sizes for rows and columns of matrix B")); + Assert(row_block_size == B.row_block_size, + ExcMessage( + "Use identical block-cyclic distribution for matrices A and B")); Threads::Mutex::ScopedLock lock(mutex); @@ -1863,9 +1873,9 @@ ScaLAPACKMatrix::pseudoinverse(const NumberType ratio) Assert(state == LAPACKSupport::matrix, ExcMessage( "Matrix has to be in Matrix state before calling this function.")); - Assert( - row_block_size == column_block_size, - ExcMessage("Use identical block sizes for rows and columns of matrix A")); + Assert(row_block_size == column_block_size, + ExcMessage( + "Use identical block sizes for rows and columns of matrix A")); Assert( ratio > 0. && ratio < 1., ExcMessage( @@ -2304,8 +2314,10 @@ ScaLAPACKMatrix::save_serial( * an effectively serial ScaLAPACK matrix to gather the contents from the * current object */ - const auto column_grid = std::make_shared( - this->grid->mpi_communicator, 1, 1); + const auto column_grid = + std::make_shared(this->grid->mpi_communicator, + 1, + 1); const int MB = n_rows, NB = n_columns; ScaLAPACKMatrix tmp(n_rows, n_columns, column_grid, MB, NB); @@ -2460,8 +2472,10 @@ ScaLAPACKMatrix::save_parallel( * * Create a 1xn_processes column grid */ - const auto column_grid = std::make_shared( - this->grid->mpi_communicator, 1, n_mpi_processes); + const auto column_grid = + std::make_shared(this->grid->mpi_communicator, + 1, + n_mpi_processes); const int MB = n_rows, NB = std::ceil(n_columns / n_mpi_processes); ScaLAPACKMatrix tmp(n_rows, n_columns, column_grid, MB, NB); @@ -2690,8 +2704,10 @@ ScaLAPACKMatrix::load_serial(const char *filename) * file */ // create a 1xP column grid with P being the number of MPI processes - const auto one_grid = std::make_shared( - this->grid->mpi_communicator, 1, 1); + const auto one_grid = + std::make_shared(this->grid->mpi_communicator, + 1, + 1); const int MB = n_rows, NB = n_columns; ScaLAPACKMatrix tmp(n_rows, n_columns, one_grid, MB, NB); @@ -2872,8 +2888,10 @@ ScaLAPACKMatrix::load_parallel(const char *filename) * of the matrix, which they can write to the file */ // create a 1xP column grid with P being the number of MPI processes - const auto column_grid = std::make_shared( - this->grid->mpi_communicator, 1, n_mpi_processes); + const auto column_grid = + std::make_shared(this->grid->mpi_communicator, + 1, + n_mpi_processes); const int MB = n_rows, NB = std::ceil(n_columns / n_mpi_processes); ScaLAPACKMatrix tmp(n_rows, n_columns, column_grid, MB, NB); diff --git a/source/lac/slepc_solver.cc b/source/lac/slepc_solver.cc index 1b9235331c..d52547d93c 100644 --- a/source/lac/slepc_solver.cc +++ b/source/lac/slepc_solver.cc @@ -32,10 +32,10 @@ DEAL_II_NAMESPACE_OPEN namespace SLEPcWrappers { - SolverBase::SolverBase(SolverControl &cn, const MPI_Comm &mpi_communicator) : - solver_control(cn), - mpi_communicator(mpi_communicator), - reason(EPS_CONVERGED_ITERATING) + SolverBase::SolverBase(SolverControl &cn, const MPI_Comm &mpi_communicator) + : solver_control(cn) + , mpi_communicator(mpi_communicator) + , reason(EPS_CONVERGED_ITERATING) { // create eigensolver context PetscErrorCode ierr = EPSCreate(mpi_communicator, &eps); @@ -43,8 +43,9 @@ namespace SLEPcWrappers // hand over the absolute tolerance and the maximum number of // iteration steps to the SLEPc convergence criterion. - ierr = EPSSetTolerances( - eps, this->solver_control.tolerance(), this->solver_control.max_steps()); + ierr = EPSSetTolerances(eps, + this->solver_control.tolerance(), + this->solver_control.max_steps()); AssertThrow(ierr == 0, ExcSLEPcError(ierr)); // default values: @@ -339,9 +340,9 @@ namespace SLEPcWrappers /* ---------------------- SolverKrylovSchur ------------------------ */ SolverKrylovSchur::SolverKrylovSchur(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) { const PetscErrorCode ierr = EPSSetType(eps, const_cast(EPSKRYLOVSCHUR)); @@ -350,15 +351,15 @@ namespace SLEPcWrappers /* ---------------------- SolverArnoldi ------------------------ */ SolverArnoldi::AdditionalData::AdditionalData( - const bool delayed_reorthogonalization) : - delayed_reorthogonalization(delayed_reorthogonalization) + const bool delayed_reorthogonalization) + : delayed_reorthogonalization(delayed_reorthogonalization) {} SolverArnoldi::SolverArnoldi(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) { PetscErrorCode ierr = EPSSetType(eps, const_cast(EPSARNOLDI)); AssertThrow(ierr == 0, ExcSLEPcError(ierr)); @@ -374,16 +375,15 @@ namespace SLEPcWrappers /* ---------------------- Lanczos ------------------------ */ - SolverLanczos::AdditionalData::AdditionalData( - const EPSLanczosReorthogType r) : - reorthog(r) + SolverLanczos::AdditionalData::AdditionalData(const EPSLanczosReorthogType r) + : reorthog(r) {} SolverLanczos::SolverLanczos(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) { PetscErrorCode ierr = EPSSetType(eps, const_cast(EPSLANCZOS)); AssertThrow(ierr == 0, ExcSLEPcError(ierr)); @@ -395,9 +395,9 @@ namespace SLEPcWrappers /* ----------------------- Power ------------------------- */ SolverPower::SolverPower(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) { PetscErrorCode ierr = EPSSetType(eps, const_cast(EPSPOWER)); AssertThrow(ierr == 0, ExcSLEPcError(ierr)); @@ -405,16 +405,16 @@ namespace SLEPcWrappers /* ---------------- Generalized Davidson ----------------- */ SolverGeneralizedDavidson::AdditionalData::AdditionalData( - bool double_expansion) : - double_expansion(double_expansion) + bool double_expansion) + : double_expansion(double_expansion) {} SolverGeneralizedDavidson::SolverGeneralizedDavidson( SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) { PetscErrorCode ierr = EPSSetType(eps, const_cast(EPSGD)); AssertThrow(ierr == 0, ExcSLEPcError(ierr)); @@ -429,9 +429,9 @@ namespace SLEPcWrappers /* ------------------ Jacobi Davidson -------------------- */ SolverJacobiDavidson::SolverJacobiDavidson(SolverControl & cn, const MPI_Comm &mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) { const PetscErrorCode ierr = EPSSetType(eps, const_cast(EPSJD)); AssertThrow(ierr == 0, ExcSLEPcError(ierr)); @@ -440,9 +440,9 @@ namespace SLEPcWrappers /* ---------------------- LAPACK ------------------------- */ SolverLAPACK::SolverLAPACK(SolverControl & cn, const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - SolverBase(cn, mpi_communicator), - additional_data(data) + const AdditionalData &data) + : SolverBase(cn, mpi_communicator) + , additional_data(data) { // 'Tis overwhelmingly likely that PETSc/SLEPc *always* has // BLAS/LAPACK, but let's be defensive. diff --git a/source/lac/slepc_spectral_transformation.cc b/source/lac/slepc_spectral_transformation.cc index a176fb62b9..e3d39cbb92 100644 --- a/source/lac/slepc_spectral_transformation.cc +++ b/source/lac/slepc_spectral_transformation.cc @@ -62,14 +62,14 @@ namespace SLEPcWrappers /* ------------------- TransformationShift --------------------- */ TransformationShift::AdditionalData::AdditionalData( - const double shift_parameter) : - shift_parameter(shift_parameter) + const double shift_parameter) + : shift_parameter(shift_parameter) {} TransformationShift::TransformationShift(const MPI_Comm &mpi_communicator, - const AdditionalData &data) : - TransformationBase(mpi_communicator), - additional_data(data) + const AdditionalData &data) + : TransformationBase(mpi_communicator) + , additional_data(data) { PetscErrorCode ierr = STSetType(st, const_cast(STSHIFT)); AssertThrow(ierr == 0, SolverBase::ExcSLEPcError(ierr)); @@ -81,15 +81,15 @@ namespace SLEPcWrappers /* ---------------- TransformationShiftInvert ------------------ */ TransformationShiftInvert::AdditionalData::AdditionalData( - const double shift_parameter) : - shift_parameter(shift_parameter) + const double shift_parameter) + : shift_parameter(shift_parameter) {} TransformationShiftInvert::TransformationShiftInvert( const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - TransformationBase(mpi_communicator), - additional_data(data) + const AdditionalData &data) + : TransformationBase(mpi_communicator) + , additional_data(data) { PetscErrorCode ierr = STSetType(st, const_cast(STSINVERT)); AssertThrow(ierr == 0, SolverBase::ExcSLEPcError(ierr)); @@ -101,15 +101,15 @@ namespace SLEPcWrappers /* --------------- TransformationSpectrumFolding ----------------- */ TransformationSpectrumFolding::AdditionalData::AdditionalData( - const double shift_parameter) : - shift_parameter(shift_parameter) + const double shift_parameter) + : shift_parameter(shift_parameter) {} TransformationSpectrumFolding::TransformationSpectrumFolding( const MPI_Comm & mpi_communicator, - const AdditionalData &data) : - TransformationBase(mpi_communicator), - additional_data(data) + const AdditionalData &data) + : TransformationBase(mpi_communicator) + , additional_data(data) { # if DEAL_II_PETSC_VERSION_LT(3, 5, 0) PetscErrorCode ierr = STSetType(st, const_cast(STFOLD)); @@ -131,15 +131,15 @@ namespace SLEPcWrappers TransformationCayley::AdditionalData::AdditionalData( const double shift_parameter, - const double antishift_parameter) : - shift_parameter(shift_parameter), - antishift_parameter(antishift_parameter) + const double antishift_parameter) + : shift_parameter(shift_parameter) + , antishift_parameter(antishift_parameter) {} TransformationCayley::TransformationCayley(const MPI_Comm &mpi_communicator, - const AdditionalData &data) : - TransformationBase(mpi_communicator), - additional_data(data) + const AdditionalData &data) + : TransformationBase(mpi_communicator) + , additional_data(data) { PetscErrorCode ierr = STSetType(st, const_cast(STCAYLEY)); AssertThrow(ierr == 0, SolverBase::ExcSLEPcError(ierr)); diff --git a/source/lac/solver_bicgstab.cc b/source/lac/solver_bicgstab.cc index 6408c37292..16dd36ee9f 100644 --- a/source/lac/solver_bicgstab.cc +++ b/source/lac/solver_bicgstab.cc @@ -19,14 +19,14 @@ DEAL_II_NAMESPACE_OPEN -internal::SolverBicgstabData::SolverBicgstabData() : - alpha(0.), - beta(0.), - omega(0.), - rho(0.), - rhobar(0.), - step(numbers::invalid_unsigned_int), - res(numbers::signaling_nan()) +internal::SolverBicgstabData::SolverBicgstabData() + : alpha(0.) + , beta(0.) + , omega(0.) + , rho(0.) + , rhobar(0.) + , step(numbers::invalid_unsigned_int) + , res(numbers::signaling_nan()) {} diff --git a/source/lac/solver_control.cc b/source/lac/solver_control.cc index e617a04db3..a5789cc76b 100644 --- a/source/lac/solver_control.cc +++ b/source/lac/solver_control.cc @@ -30,20 +30,20 @@ DEAL_II_NAMESPACE_OPEN SolverControl::SolverControl(const unsigned int maxiter, const double tolerance, const bool m_log_history, - const bool m_log_result) : - maxsteps(maxiter), - tol(tolerance), - lcheck(failure), - initial_val(numbers::signaling_nan()), - lvalue(numbers::signaling_nan()), - lstep(numbers::invalid_unsigned_int), - check_failure(false), - relative_failure_residual(0), - failure_residual(0), - m_log_history(m_log_history), - m_log_frequency(1), - m_log_result(m_log_result), - history_data_enabled(false) + const bool m_log_result) + : maxsteps(maxiter) + , tol(tolerance) + , lcheck(failure) + , initial_val(numbers::signaling_nan()) + , lvalue(numbers::signaling_nan()) + , lstep(numbers::invalid_unsigned_int) + , check_failure(false) + , relative_failure_residual(0) + , failure_residual(0) + , m_log_history(m_log_history) + , m_log_frequency(1) + , m_log_result(m_log_result) + , history_data_enabled(false) {} @@ -228,17 +228,17 @@ ReductionControl::ReductionControl(const unsigned int n, const double tol, const double red, const bool m_log_history, - const bool m_log_result) : - SolverControl(n, tol, m_log_history, m_log_result), - reduce(red), - reduced_tol(numbers::signaling_nan()) + const bool m_log_result) + : SolverControl(n, tol, m_log_history, m_log_result) + , reduce(red) + , reduced_tol(numbers::signaling_nan()) {} -ReductionControl::ReductionControl(const SolverControl &c) : - SolverControl(c), - reduce(numbers::signaling_nan()), - reduced_tol(numbers::signaling_nan()) +ReductionControl::ReductionControl(const SolverControl &c) + : SolverControl(c) + , reduce(numbers::signaling_nan()) + , reduced_tol(numbers::signaling_nan()) { set_reduction(0.); } @@ -312,8 +312,8 @@ ReductionControl::parse_parameters(ParameterHandler ¶m) IterationNumberControl::IterationNumberControl(const unsigned int n, const double tolerance, const bool m_log_history, - const bool m_log_result) : - SolverControl(n, tolerance, m_log_history, m_log_result) + const bool m_log_result) + : SolverControl(n, tolerance, m_log_history, m_log_result) {} @@ -346,10 +346,10 @@ ConsecutiveControl::ConsecutiveControl( const double tolerance, const unsigned int n_consecutive_iterations, const bool m_log_history, - const bool m_log_result) : - SolverControl(n, tolerance, m_log_history, m_log_result), - n_consecutive_iterations(n_consecutive_iterations), - n_converged_iterations(0) + const bool m_log_result) + : SolverControl(n, tolerance, m_log_history, m_log_result) + , n_consecutive_iterations(n_consecutive_iterations) + , n_converged_iterations(0) { AssertThrow(n_consecutive_iterations > 0, ExcMessage("n_consecutive_iterations should be positive")); @@ -357,10 +357,10 @@ ConsecutiveControl::ConsecutiveControl( -ConsecutiveControl::ConsecutiveControl(const SolverControl &c) : - SolverControl(c), - n_consecutive_iterations(1), - n_converged_iterations(0) +ConsecutiveControl::ConsecutiveControl(const SolverControl &c) + : SolverControl(c) + , n_consecutive_iterations(1) + , n_converged_iterations(0) {} diff --git a/source/lac/sparse_direct.cc b/source/lac/sparse_direct.cc index 519eb15423..000732abce 100644 --- a/source/lac/sparse_direct.cc +++ b/source/lac/sparse_direct.cc @@ -51,12 +51,12 @@ SparseDirectUMFPACK::initialize(const SparsityPattern &) #ifdef DEAL_II_WITH_UMFPACK -SparseDirectUMFPACK::SparseDirectUMFPACK() : - _m(0), - _n(0), - symbolic_decomposition(nullptr), - numeric_decomposition(nullptr), - control(UMFPACK_CONTROL) +SparseDirectUMFPACK::SparseDirectUMFPACK() + : _m(0) + , _n(0) + , symbolic_decomposition(nullptr) + , numeric_decomposition(nullptr) + , control(UMFPACK_CONTROL) { umfpack_dl_defaults(control.data()); } @@ -367,12 +367,12 @@ SparseDirectUMFPACK::solve(const Matrix & matrix, #else -SparseDirectUMFPACK::SparseDirectUMFPACK() : - _m(0), - _n(0), - symbolic_decomposition(0), - numeric_decomposition(0), - control(0) +SparseDirectUMFPACK::SparseDirectUMFPACK() + : _m(0) + , _n(0) + , symbolic_decomposition(0) + , numeric_decomposition(0) + , control(0) {} @@ -500,10 +500,12 @@ SparseDirectUMFPACK::n() const // explicit instantiations for SparseMatrixUMFPACK #define InstantiateUMFPACK(MatrixType) \ template void SparseDirectUMFPACK::factorize(const MatrixType &); \ - template void SparseDirectUMFPACK::solve( \ - const MatrixType &, Vector &, bool); \ - template void SparseDirectUMFPACK::solve( \ - const MatrixType &, BlockVector &, bool); \ + template void SparseDirectUMFPACK::solve(const MatrixType &, \ + Vector &, \ + bool); \ + template void SparseDirectUMFPACK::solve(const MatrixType &, \ + BlockVector &, \ + bool); \ template void SparseDirectUMFPACK::initialize(const MatrixType &, \ const AdditionalData); diff --git a/source/lac/sparse_matrix.inst.in b/source/lac/sparse_matrix.inst.in index d184c149e9..3a870a14d0 100644 --- a/source/lac/sparse_matrix.inst.in +++ b/source/lac/sparse_matrix.inst.in @@ -53,11 +53,13 @@ for (S1, S2 : REAL_SCALARS) template S2 SparseMatrix::matrix_norm_square(const Vector &) const; - template S2 SparseMatrix::matrix_scalar_product( - const Vector &, const Vector &) const; + template S2 SparseMatrix::matrix_scalar_product(const Vector &, + const Vector &) + const; - template S2 SparseMatrix::residual( - Vector &, const Vector &, const Vector &) const; + template S2 SparseMatrix::residual(Vector &, + const Vector &, + const Vector &) const; template void SparseMatrix::precondition_SSOR( Vector &, @@ -65,14 +67,17 @@ for (S1, S2 : REAL_SCALARS) const S1, const std::vector &) const; - template void SparseMatrix::precondition_SOR( - Vector &, const Vector &, const S1) const; + template void SparseMatrix::precondition_SOR(Vector &, + const Vector &, + const S1) const; - template void SparseMatrix::precondition_TSOR( - Vector &, const Vector &, const S1) const; + template void SparseMatrix::precondition_TSOR(Vector &, + const Vector &, + const S1) const; - template void SparseMatrix::precondition_Jacobi( - Vector &, const Vector &, const S1) const; + template void SparseMatrix::precondition_Jacobi(Vector &, + const Vector &, + const S1) const; template void SparseMatrix::SOR(Vector &, const S1) const; template void SparseMatrix::TSOR(Vector &, const S1) const; @@ -85,14 +90,18 @@ for (S1, S2 : REAL_SCALARS) const std::vector &, const std::vector &, const S1) const; - template void SparseMatrix::Jacobi_step( - Vector &, const Vector &, const S1) const; - template void SparseMatrix::SOR_step( - Vector &, const Vector &, const S1) const; - template void SparseMatrix::TSOR_step( - Vector &, const Vector &, const S1) const; - template void SparseMatrix::SSOR_step( - Vector &, const Vector &, const S1) const; + template void SparseMatrix::Jacobi_step(Vector &, + const Vector &, + const S1) const; + template void SparseMatrix::SOR_step(Vector &, + const Vector &, + const S1) const; + template void SparseMatrix::TSOR_step(Vector &, + const Vector &, + const S1) const; + template void SparseMatrix::SSOR_step(Vector &, + const Vector &, + const S1) const; } for (S1, S2, S3 : REAL_SCALARS; V1, V2 : DEAL_II_VEC_TEMPLATES) @@ -180,11 +189,13 @@ for (S1, S2 : COMPLEX_SCALARS) template S2 SparseMatrix::matrix_norm_square(const Vector &) const; - template S2 SparseMatrix::matrix_scalar_product( - const Vector &, const Vector &) const; + template S2 SparseMatrix::matrix_scalar_product(const Vector &, + const Vector &) + const; - template S2 SparseMatrix::residual( - Vector &, const Vector &, const Vector &) const; + template S2 SparseMatrix::residual(Vector &, + const Vector &, + const Vector &) const; template void SparseMatrix::precondition_SSOR( Vector &, @@ -192,14 +203,17 @@ for (S1, S2 : COMPLEX_SCALARS) const S1, const std::vector &) const; - template void SparseMatrix::precondition_SOR( - Vector &, const Vector &, const S1) const; + template void SparseMatrix::precondition_SOR(Vector &, + const Vector &, + const S1) const; - template void SparseMatrix::precondition_TSOR( - Vector &, const Vector &, const S1) const; + template void SparseMatrix::precondition_TSOR(Vector &, + const Vector &, + const S1) const; - template void SparseMatrix::precondition_Jacobi( - Vector &, const Vector &, const S1) const; + template void SparseMatrix::precondition_Jacobi(Vector &, + const Vector &, + const S1) const; template void SparseMatrix::SOR(Vector &, const S1) const; template void SparseMatrix::TSOR(Vector &, const S1) const; @@ -212,14 +226,18 @@ for (S1, S2 : COMPLEX_SCALARS) const std::vector &, const std::vector &, const S1) const; - template void SparseMatrix::Jacobi_step( - Vector &, const Vector &, const S1) const; - template void SparseMatrix::SOR_step( - Vector &, const Vector &, const S1) const; - template void SparseMatrix::TSOR_step( - Vector &, const Vector &, const S1) const; - template void SparseMatrix::SSOR_step( - Vector &, const Vector &, const S1) const; + template void SparseMatrix::Jacobi_step(Vector &, + const Vector &, + const S1) const; + template void SparseMatrix::SOR_step(Vector &, + const Vector &, + const S1) const; + template void SparseMatrix::TSOR_step(Vector &, + const Vector &, + const S1) const; + template void SparseMatrix::SSOR_step(Vector &, + const Vector &, + const S1) const; } for (S1, S2, S3 : COMPLEX_SCALARS; V1, V2 : DEAL_II_VEC_TEMPLATES) diff --git a/source/lac/sparse_matrix_ez.inst.in b/source/lac/sparse_matrix_ez.inst.in index c6a5029f08..7c96fdffd0 100644 --- a/source/lac/sparse_matrix_ez.inst.in +++ b/source/lac/sparse_matrix_ez.inst.in @@ -37,10 +37,12 @@ for (S1, S2 : REAL_SCALARS) const Vector &, const S1, const std::vector &) const; - template void SparseMatrixEZ::precondition_SOR( - Vector &, const Vector &, const S1) const; - template void SparseMatrixEZ::precondition_TSOR( - Vector &, const Vector &, const S1) const; + template void SparseMatrixEZ::precondition_SOR(Vector &, + const Vector &, + const S1) const; + template void SparseMatrixEZ::precondition_TSOR(Vector &, + const Vector &, + const S1) const; template void SparseMatrixEZ::precondition_Jacobi( Vector &, const Vector &, const S1) const; } diff --git a/source/lac/sparsity_pattern.cc b/source/lac/sparsity_pattern.cc index e7890ecee3..0fea8a96d7 100644 --- a/source/lac/sparsity_pattern.cc +++ b/source/lac/sparsity_pattern.cc @@ -39,27 +39,27 @@ __declspec(selectany) // Weak extern binding due to multiple link error -SparsityPattern::SparsityPattern() : - max_dim(0), - max_vec_len(0), - rowstart(nullptr), - colnums(nullptr), - compressed(false), - store_diagonal_first_in_row(false) +SparsityPattern::SparsityPattern() + : max_dim(0) + , max_vec_len(0) + , rowstart(nullptr) + , colnums(nullptr) + , compressed(false) + , store_diagonal_first_in_row(false) { reinit(0, 0, 0); } -SparsityPattern::SparsityPattern(const SparsityPattern &s) : - Subscriptor(), - max_dim(0), - max_vec_len(0), - rowstart(nullptr), - colnums(nullptr), - compressed(false), - store_diagonal_first_in_row(false) +SparsityPattern::SparsityPattern(const SparsityPattern &s) + : Subscriptor() + , max_dim(0) + , max_vec_len(0) + , rowstart(nullptr) + , colnums(nullptr) + , compressed(false) + , store_diagonal_first_in_row(false) { (void)s; Assert(s.empty(), @@ -75,13 +75,13 @@ SparsityPattern::SparsityPattern(const SparsityPattern &s) : SparsityPattern::SparsityPattern(const size_type m, const size_type n, - const unsigned int max_per_row) : - max_dim(0), - max_vec_len(0), - rowstart(nullptr), - colnums(nullptr), - compressed(false), - store_diagonal_first_in_row(m == n) + const unsigned int max_per_row) + : max_dim(0) + , max_vec_len(0) + , rowstart(nullptr) + , colnums(nullptr) + , compressed(false) + , store_diagonal_first_in_row(m == n) { reinit(m, n, max_per_row); } @@ -90,12 +90,12 @@ SparsityPattern::SparsityPattern(const size_type m, SparsityPattern::SparsityPattern(const size_type m, const size_type n, - const std::vector &row_lengths) : - max_dim(0), - max_vec_len(0), - rowstart(nullptr), - colnums(nullptr), - store_diagonal_first_in_row(m == n) + const std::vector &row_lengths) + : max_dim(0) + , max_vec_len(0) + , rowstart(nullptr) + , colnums(nullptr) + , store_diagonal_first_in_row(m == n) { reinit(m, n, row_lengths); } @@ -103,11 +103,11 @@ SparsityPattern::SparsityPattern(const size_type m, SparsityPattern::SparsityPattern(const size_type m, - const unsigned int max_per_row) : - max_dim(0), - max_vec_len(0), - rowstart(nullptr), - colnums(nullptr) + const unsigned int max_per_row) + : max_dim(0) + , max_vec_len(0) + , rowstart(nullptr) + , colnums(nullptr) { reinit(m, m, max_per_row); } @@ -115,11 +115,11 @@ SparsityPattern::SparsityPattern(const size_type m, SparsityPattern::SparsityPattern(const size_type m, - const std::vector &row_lengths) : - max_dim(0), - max_vec_len(0), - rowstart(nullptr), - colnums(nullptr) + const std::vector &row_lengths) + : max_dim(0) + , max_vec_len(0) + , rowstart(nullptr) + , colnums(nullptr) { reinit(m, m, row_lengths); } @@ -128,11 +128,11 @@ SparsityPattern::SparsityPattern(const size_type m, SparsityPattern::SparsityPattern(const SparsityPattern &original, const unsigned int max_per_row, - const size_type extra_off_diagonals) : - max_dim(0), - max_vec_len(0), - rowstart(nullptr), - colnums(nullptr) + const size_type extra_off_diagonals) + : max_dim(0) + , max_vec_len(0) + , rowstart(nullptr) + , colnums(nullptr) { Assert(original.rows == original.cols, ExcNotQuadratic()); Assert(original.is_compressed(), ExcNotCompressed()); @@ -164,14 +164,16 @@ SparsityPattern::SparsityPattern(const SparsityPattern &original, // necessary (see the @p{copy} commands) const size_type *const original_last_before_side_diagonals = (row > extra_off_diagonals ? - Utilities::lower_bound( - original_row_start, original_row_end, row - extra_off_diagonals) : + Utilities::lower_bound(original_row_start, + original_row_end, + row - extra_off_diagonals) : original_row_start); const size_type *const original_first_after_side_diagonals = (row < rows - extra_off_diagonals - 1 ? - std::upper_bound( - original_row_start, original_row_end, row + extra_off_diagonals) : + std::upper_bound(original_row_start, + original_row_end, + row + extra_off_diagonals) : original_row_end); // find first free slot. the first slot in each row is the diagonal @@ -192,8 +194,9 @@ SparsityPattern::SparsityPattern(const SparsityPattern &original, *next_free_slot = row + i; // copy rest - next_free_slot = std::copy( - original_first_after_side_diagonals, original_row_end, next_free_slot); + next_free_slot = std::copy(original_first_after_side_diagonals, + original_row_end, + next_free_slot); // this error may happen if the sum of previous elements per row and // those of the new diagonals exceeds the maximum number of elements per @@ -209,11 +212,11 @@ SparsityPattern & SparsityPattern::operator=(const SparsityPattern &s) { (void)s; - Assert( - s.empty(), - ExcMessage("This operator can only be called if the provided argument " - "is the sparsity pattern for an empty matrix. This operator can " - "not be used to copy a non-empty sparsity pattern.")); + Assert(s.empty(), + ExcMessage( + "This operator can only be called if the provided argument " + "is the sparsity pattern for an empty matrix. This operator can " + "not be used to copy a non-empty sparsity pattern.")); Assert(this->empty(), ExcMessage("This operator can only be called if the current object is " @@ -290,11 +293,12 @@ SparsityPattern::reinit( colnums = std_cxx14::make_unique(max_vec_len); } - max_row_length = (row_lengths.size() == 0 ? - 0 : - std::min(static_cast(*std::max_element( - row_lengths.begin(), row_lengths.end())), - n)); + max_row_length = + (row_lengths.size() == 0 ? + 0 : + std::min(static_cast( + *std::max_element(row_lengths.begin(), row_lengths.end())), + n)); if (store_diagonal_first_in_row && (max_row_length == 0) && (m != 0)) max_row_length = 1; @@ -363,11 +367,12 @@ SparsityPattern::compress() // first find out how many non-zero elements there are, in order to allocate // the right amount of memory - const std::size_t nonzero_elements = std::count_if( - &colnums[rowstart[0]], - &colnums[rowstart[rows]], - std::bind( - std::not_equal_to(), std::placeholders::_1, invalid_entry)); + const std::size_t nonzero_elements = + std::count_if(&colnums[rowstart[0]], + &colnums[rowstart[rows]], + std::bind(std::not_equal_to(), + std::placeholders::_1, + invalid_entry)); // now allocate the respective memory std::unique_ptr new_colnums(new size_type[nonzero_elements]); @@ -674,8 +679,10 @@ SparsityPattern::operator()(const size_type i, const size_type j) const const size_type *sorted_region_start = (store_diagonal_first_in_row ? &colnums[rowstart[i] + 1] : &colnums[rowstart[i]]); - const size_type *const p = Utilities::lower_bound( - sorted_region_start, &colnums[rowstart[i + 1]], j); + const size_type *const p = + Utilities::lower_bound(sorted_region_start, + &colnums[rowstart[i + 1]], + j); if ((p != &colnums[rowstart[i + 1]]) && (*p == j)) return (p - colnums.get()); else @@ -740,9 +747,9 @@ SparsityPattern::add_entries(const size_type row, { if (store_diagonal_first_in_row && *it == row) continue; - Assert( - k <= rowstart[row + 1], - ExcNotEnoughSpace(row, rowstart[row + 1] - rowstart[row])); + Assert(k <= rowstart[row + 1], + ExcNotEnoughSpace(row, + rowstart[row + 1] - rowstart[row])); colnums[k++] = *it; } else diff --git a/source/lac/sparsity_tools.cc b/source/lac/sparsity_tools.cc index be78e8450b..a968b3c01d 100644 --- a/source/lac/sparsity_tools.cc +++ b/source/lac/sparsity_tools.cc @@ -118,8 +118,9 @@ namespace SparsityTools ExcDimensionMismatch(cell_weights.size(), sparsity_pattern.n_rows())); int_cell_weights.resize(cell_weights.size()); - std::copy( - cell_weights.begin(), cell_weights.end(), int_cell_weights.begin()); + std::copy(cell_weights.begin(), + cell_weights.end(), + int_cell_weights.begin()); } // Set a pointer to the optional cell weighting information. // METIS expects a null pointer if there are no weights to be considered. @@ -424,9 +425,9 @@ namespace SparsityTools SparsityPattern::ExcNotCompressed()); Assert(n_partitions > 0, ExcInvalidNumberOfPartitions(n_partitions)); - Assert( - partition_indices.size() == sparsity_pattern.n_rows(), - ExcInvalidArraySize(partition_indices.size(), sparsity_pattern.n_rows())); + Assert(partition_indices.size() == sparsity_pattern.n_rows(), + ExcInvalidArraySize(partition_indices.size(), + sparsity_pattern.n_rows())); // check for an easy return if (n_partitions == 1 || (sparsity_pattern.n_rows() == 1)) @@ -436,11 +437,15 @@ namespace SparsityTools } if (partitioner == Partitioner::metis) - partition_metis( - sparsity_pattern, cell_weights, n_partitions, partition_indices); + partition_metis(sparsity_pattern, + cell_weights, + n_partitions, + partition_indices); else if (partitioner == Partitioner::zoltan) - partition_zoltan( - sparsity_pattern, cell_weights, n_partitions, partition_indices); + partition_zoltan(sparsity_pattern, + cell_weights, + n_partitions, + partition_indices); else AssertThrow(false, ExcInternalError()); } @@ -493,8 +498,10 @@ namespace SparsityTools global_ids[i] = i; // Call ZOLTAN coloring algorithm - int rc = zz->Color( - num_gid_entries, num_objects, global_ids.data(), color_exp.data()); + int rc = zz->Color(num_gid_entries, + num_objects, + global_ids.data(), + color_exp.data()); (void)rc; // Check for error code @@ -581,10 +588,10 @@ namespace SparsityTools Assert(starting_indices.size() <= sparsity.n_rows(), ExcMessage( "You can't specify more starting indices than there are rows")); - Assert( - sparsity.row_index_set().size() == 0 || - sparsity.row_index_set().size() == sparsity.n_rows(), - ExcMessage("Only valid for sparsity patterns which store all rows.")); + Assert(sparsity.row_index_set().size() == 0 || + sparsity.row_index_set().size() == sparsity.n_rows(), + ExcMessage( + "Only valid for sparsity patterns which store all rows.")); for (SparsityPattern::size_type i = 0; i < starting_indices.size(); ++i) Assert(starting_indices[i] < sparsity.n_rows(), ExcMessage("Invalid starting index: All starting indices need " @@ -597,8 +604,9 @@ namespace SparsityTools starting_indices); // initialize the new_indices array with invalid values - std::fill( - new_indices.begin(), new_indices.end(), numbers::invalid_size_type); + std::fill(new_indices.begin(), + new_indices.end(), + numbers::invalid_size_type); // if no starting indices were given: find dof with lowest coordination // number @@ -726,10 +734,10 @@ namespace SparsityTools { AssertDimension(connectivity.n_rows(), connectivity.n_cols()); AssertDimension(connectivity.n_rows(), renumbering.size()); - Assert( - connectivity.row_index_set().size() == 0 || - connectivity.row_index_set().size() == connectivity.n_rows(), - ExcMessage("Only valid for sparsity patterns which store all rows.")); + Assert(connectivity.row_index_set().size() == 0 || + connectivity.row_index_set().size() == connectivity.n_rows(), + ExcMessage( + "Only valid for sparsity patterns which store all rows.")); std::vector touched_nodes( connectivity.n_rows(), numbers::invalid_dof_index); diff --git a/source/lac/tridiagonal_matrix.cc b/source/lac/tridiagonal_matrix.cc index c06d689729..48aec2743a 100644 --- a/source/lac/tridiagonal_matrix.cc +++ b/source/lac/tridiagonal_matrix.cc @@ -25,12 +25,12 @@ DEAL_II_NAMESPACE_OPEN using namespace LAPACKSupport; template -TridiagonalMatrix::TridiagonalMatrix(size_type size, bool symmetric) : - diagonal(size, 0.), - left((symmetric ? 0 : size), 0.), - right(size, 0.), - is_symmetric(symmetric), - state(matrix) +TridiagonalMatrix::TridiagonalMatrix(size_type size, bool symmetric) + : diagonal(size, 0.) + , left((symmetric ? 0 : size), 0.) + , right(size, 0.) + , is_symmetric(symmetric) + , state(matrix) {} diff --git a/source/lac/trilinos_block_sparse_matrix.cc b/source/lac/trilinos_block_sparse_matrix.cc index 15cb8a4332..1d05461182 100644 --- a/source/lac/trilinos_block_sparse_matrix.cc +++ b/source/lac/trilinos_block_sparse_matrix.cc @@ -197,11 +197,11 @@ namespace TrilinosWrappers for (size_type r = 0; r < this->n_block_rows(); ++r) for (size_type c = 0; c < this->n_block_cols(); ++c) { - this->sub_objects[r][c]->reinit( - parallel_partitioning[r], - parallel_partitioning[c], - dealii_block_sparse_matrix.block(r, c), - drop_tolerance); + this->sub_objects[r][c]->reinit(parallel_partitioning[r], + parallel_partitioning[c], + dealii_block_sparse_matrix.block(r, + c), + drop_tolerance); } collect_sizes(); diff --git a/source/lac/trilinos_block_vector.cc b/source/lac/trilinos_block_vector.cc index 265f0e40f0..628e5da397 100644 --- a/source/lac/trilinos_block_vector.cc +++ b/source/lac/trilinos_block_vector.cc @@ -84,8 +84,9 @@ namespace TrilinosWrappers components.resize(n_blocks()); for (size_type i = 0; i < n_blocks(); ++i) - components[i].reinit( - parallel_partitioning[i], communicator, omit_zeroing_entries); + components[i].reinit(parallel_partitioning[i], + communicator, + omit_zeroing_entries); collect_sizes(); } diff --git a/source/lac/trilinos_epetra_vector.cc b/source/lac/trilinos_epetra_vector.cc index c0b3d9aed0..654a3668ed 100644 --- a/source/lac/trilinos_epetra_vector.cc +++ b/source/lac/trilinos_epetra_vector.cc @@ -40,24 +40,24 @@ namespace LinearAlgebra { namespace EpetraWrappers { - Vector::Vector() : - vector(new Epetra_FEVector( - Epetra_Map(0, 0, 0, Utilities::Trilinos::comm_self()))) + Vector::Vector() + : vector(new Epetra_FEVector( + Epetra_Map(0, 0, 0, Utilities::Trilinos::comm_self()))) {} - Vector::Vector(const Vector &V) : - Subscriptor(), - vector(new Epetra_FEVector(V.trilinos_vector())) + Vector::Vector(const Vector &V) + : Subscriptor() + , vector(new Epetra_FEVector(V.trilinos_vector())) {} Vector::Vector(const IndexSet ¶llel_partitioner, - const MPI_Comm &communicator) : - vector(new Epetra_FEVector( - parallel_partitioner.make_trilinos_map(communicator, false))) + const MPI_Comm &communicator) + : vector(new Epetra_FEVector( + parallel_partitioner.make_trilinos_map(communicator, false))) {} @@ -240,8 +240,9 @@ namespace LinearAlgebra # if DEAL_II_TRILINOS_VERSION_GTE(11, 11, 0) Epetra_Import data_exchange(vector->Map(), down_V.trilinos_vector().Map()); - const int ierr = vector->Import( - down_V.trilinos_vector(), data_exchange, Epetra_AddLocalAlso); + const int ierr = vector->Import(down_V.trilinos_vector(), + data_exchange, + Epetra_AddLocalAlso); Assert(ierr == 0, ExcTrilinosError(ierr)); (void)ierr; # else @@ -395,8 +396,10 @@ namespace LinearAlgebra Assert(vector->Map().SameAs(down_scaling_factors.trilinos_vector().Map()), ExcDifferentParallelPartitioning()); - const int ierr = vector->Multiply( - 1.0, down_scaling_factors.trilinos_vector(), *vector, 0.0); + const int ierr = vector->Multiply(1.0, + down_scaling_factors.trilinos_vector(), + *vector, + 0.0); Assert(ierr == 0, ExcTrilinosError(ierr)); (void)ierr; } @@ -646,8 +649,10 @@ namespace LinearAlgebra const MPI_Comm &mpi_comm) { source_stored_elements = source_index_set; - epetra_comm_pattern = std::make_shared( - locally_owned_elements(), source_index_set, mpi_comm); + epetra_comm_pattern = + std::make_shared(locally_owned_elements(), + source_index_set, + mpi_comm); } } // namespace EpetraWrappers } // namespace LinearAlgebra diff --git a/source/lac/trilinos_precondition.cc b/source/lac/trilinos_precondition.cc index 72cc5e9298..2365635f1b 100644 --- a/source/lac/trilinos_precondition.cc +++ b/source/lac/trilinos_precondition.cc @@ -33,18 +33,19 @@ namespace TrilinosWrappers { PreconditionBase::PreconditionBase() # ifdef DEAL_II_WITH_MPI - : - communicator(MPI_COMM_SELF) + : communicator(MPI_COMM_SELF) # endif {} - PreconditionBase::PreconditionBase(const PreconditionBase &base) : - Subscriptor(), - preconditioner(base.preconditioner), + PreconditionBase::PreconditionBase(const PreconditionBase &base) + : Subscriptor() + , preconditioner(base.preconditioner) + , # ifdef DEAL_II_WITH_MPI - communicator(base.communicator), + communicator(base.communicator) + , # endif vector_distributor(new Epetra_Map(*base.vector_distributor)) {} @@ -100,10 +101,10 @@ namespace TrilinosWrappers PreconditionJacobi::AdditionalData::AdditionalData( const double omega, const double min_diagonal, - const unsigned int n_sweeps) : - omega(omega), - min_diagonal(min_diagonal), - n_sweeps(n_sweeps) + const unsigned int n_sweeps) + : omega(omega) + , min_diagonal(min_diagonal) + , n_sweeps(n_sweeps) {} @@ -149,15 +150,14 @@ namespace TrilinosWrappers /* -------------------------- PreconditionSSOR -------------------------- */ - PreconditionSSOR::AdditionalData::AdditionalData( - const double omega, - const double min_diagonal, - const unsigned int overlap, - const unsigned int n_sweeps) : - omega(omega), - min_diagonal(min_diagonal), - overlap(overlap), - n_sweeps(n_sweeps) + PreconditionSSOR::AdditionalData::AdditionalData(const double omega, + const double min_diagonal, + const unsigned int overlap, + const unsigned int n_sweeps) + : omega(omega) + , min_diagonal(min_diagonal) + , overlap(overlap) + , n_sweeps(n_sweeps) {} @@ -206,11 +206,11 @@ namespace TrilinosWrappers PreconditionSOR::AdditionalData::AdditionalData(const double omega, const double min_diagonal, const unsigned int overlap, - const unsigned int n_sweeps) : - omega(omega), - min_diagonal(min_diagonal), - overlap(overlap), - n_sweeps(n_sweeps) + const unsigned int n_sweeps) + : omega(omega) + , min_diagonal(min_diagonal) + , overlap(overlap) + , n_sweeps(n_sweeps) {} @@ -261,12 +261,12 @@ namespace TrilinosWrappers const std::string &block_creation_type, const double omega, const double min_diagonal, - const unsigned int n_sweeps) : - block_size(block_size), - block_creation_type(block_creation_type), - omega(omega), - min_diagonal(min_diagonal), - n_sweeps(n_sweeps) + const unsigned int n_sweeps) + : block_size(block_size) + , block_creation_type(block_creation_type) + , omega(omega) + , min_diagonal(min_diagonal) + , n_sweeps(n_sweeps) {} @@ -280,11 +280,12 @@ namespace TrilinosWrappers // Block relaxation setup fails if we have no locally owned rows. As a // work-around we just pretend to use point relaxation on those processors: - preconditioner.reset(Ifpack().Create( - (matrix.trilinos_matrix().NumMyRows() == 0) ? "point relaxation" : - "block relaxation", - const_cast(&matrix.trilinos_matrix()), - 0)); + preconditioner.reset( + Ifpack().Create((matrix.trilinos_matrix().NumMyRows() == 0) ? + "point relaxation" : + "block relaxation", + const_cast(&matrix.trilinos_matrix()), + 0)); Ifpack_Preconditioner *ifpack = static_cast(preconditioner.get()); @@ -328,13 +329,13 @@ namespace TrilinosWrappers const double omega, const double min_diagonal, const unsigned int overlap, - const unsigned int n_sweeps) : - block_size(block_size), - block_creation_type(block_creation_type), - omega(omega), - min_diagonal(min_diagonal), - overlap(overlap), - n_sweeps(n_sweeps) + const unsigned int n_sweeps) + : block_size(block_size) + , block_creation_type(block_creation_type) + , omega(omega) + , min_diagonal(min_diagonal) + , overlap(overlap) + , n_sweeps(n_sweeps) {} @@ -347,11 +348,12 @@ namespace TrilinosWrappers // Block relaxation setup fails if we have no locally owned rows. As a // work-around we just pretend to use point relaxation on those processors: - preconditioner.reset(Ifpack().Create( - (matrix.trilinos_matrix().NumMyRows() == 0) ? "point relaxation" : - "block relaxation", - const_cast(&matrix.trilinos_matrix()), - additional_data.overlap)); + preconditioner.reset( + Ifpack().Create((matrix.trilinos_matrix().NumMyRows() == 0) ? + "point relaxation" : + "block relaxation", + const_cast(&matrix.trilinos_matrix()), + additional_data.overlap)); Ifpack_Preconditioner *ifpack = static_cast(preconditioner.get()); @@ -396,13 +398,13 @@ namespace TrilinosWrappers const double omega, const double min_diagonal, const unsigned int overlap, - const unsigned int n_sweeps) : - block_size(block_size), - block_creation_type(block_creation_type), - omega(omega), - min_diagonal(min_diagonal), - overlap(overlap), - n_sweeps(n_sweeps) + const unsigned int n_sweeps) + : block_size(block_size) + , block_creation_type(block_creation_type) + , omega(omega) + , min_diagonal(min_diagonal) + , overlap(overlap) + , n_sweeps(n_sweeps) {} @@ -415,11 +417,12 @@ namespace TrilinosWrappers // Block relaxation setup fails if we have no locally owned rows. As a // work-around we just pretend to use point relaxation on those processors: - preconditioner.reset(Ifpack().Create( - (matrix.trilinos_matrix().NumMyRows() == 0) ? "point relaxation" : - "block relaxation", - const_cast(&matrix.trilinos_matrix()), - additional_data.overlap)); + preconditioner.reset( + Ifpack().Create((matrix.trilinos_matrix().NumMyRows() == 0) ? + "point relaxation" : + "block relaxation", + const_cast(&matrix.trilinos_matrix()), + additional_data.overlap)); Ifpack_Preconditioner *ifpack = static_cast(preconditioner.get()); @@ -461,11 +464,11 @@ namespace TrilinosWrappers PreconditionIC::AdditionalData::AdditionalData(const unsigned int ic_fill, const double ic_atol, const double ic_rtol, - const unsigned int overlap) : - ic_fill(ic_fill), - ic_atol(ic_atol), - ic_rtol(ic_rtol), - overlap(overlap) + const unsigned int overlap) + : ic_fill(ic_fill) + , ic_atol(ic_atol) + , ic_rtol(ic_rtol) + , overlap(overlap) {} @@ -511,11 +514,11 @@ namespace TrilinosWrappers PreconditionILU::AdditionalData::AdditionalData(const unsigned int ilu_fill, const double ilu_atol, const double ilu_rtol, - const unsigned int overlap) : - ilu_fill(ilu_fill), - ilu_atol(ilu_atol), - ilu_rtol(ilu_rtol), - overlap(overlap) + const unsigned int overlap) + : ilu_fill(ilu_fill) + , ilu_atol(ilu_atol) + , ilu_rtol(ilu_rtol) + , overlap(overlap) {} @@ -563,12 +566,12 @@ namespace TrilinosWrappers const unsigned int ilut_fill, const double ilut_atol, const double ilut_rtol, - const unsigned int overlap) : - ilut_drop(ilut_drop), - ilut_fill(ilut_fill), - ilut_atol(ilut_atol), - ilut_rtol(ilut_rtol), - overlap(overlap) + const unsigned int overlap) + : ilut_drop(ilut_drop) + , ilut_fill(ilut_fill) + , ilut_atol(ilut_atol) + , ilut_rtol(ilut_rtol) + , overlap(overlap) {} @@ -613,8 +616,8 @@ namespace TrilinosWrappers /* ---------------------- PreconditionBlockDirect --------------------- */ PreconditionBlockwiseDirect::AdditionalData::AdditionalData( - const unsigned int overlap) : - overlap(overlap) + const unsigned int overlap) + : overlap(overlap) {} @@ -660,13 +663,13 @@ namespace TrilinosWrappers const double eigenvalue_ratio, const double min_eigenvalue, const double min_diagonal, - const bool nonzero_starting) : - degree(degree), - max_eigenvalue(max_eigenvalue), - eigenvalue_ratio(eigenvalue_ratio), - min_eigenvalue(min_eigenvalue), - min_diagonal(min_diagonal), - nonzero_starting(nonzero_starting) + const bool nonzero_starting) + : degree(degree) + , max_eigenvalue(max_eigenvalue) + , eigenvalue_ratio(eigenvalue_ratio) + , min_eigenvalue(min_eigenvalue) + , min_diagonal(min_diagonal) + , nonzero_starting(nonzero_starting) {} diff --git a/source/lac/trilinos_precondition_ml.cc b/source/lac/trilinos_precondition_ml.cc index fd6088ec74..57c8234437 100644 --- a/source/lac/trilinos_precondition_ml.cc +++ b/source/lac/trilinos_precondition_ml.cc @@ -48,18 +48,18 @@ namespace TrilinosWrappers const unsigned int smoother_overlap, const bool output_details, const char * smoother_type, - const char * coarse_type) : - elliptic(elliptic), - higher_order_elements(higher_order_elements), - n_cycles(n_cycles), - w_cycle(w_cycle), - aggregation_threshold(aggregation_threshold), - constant_modes(constant_modes), - smoother_sweeps(smoother_sweeps), - smoother_overlap(smoother_overlap), - output_details(output_details), - smoother_type(smoother_type), - coarse_type(coarse_type) + const char * coarse_type) + : elliptic(elliptic) + , higher_order_elements(higher_order_elements) + , n_cycles(n_cycles) + , w_cycle(w_cycle) + , aggregation_threshold(aggregation_threshold) + , constant_modes(constant_modes) + , smoother_sweeps(smoother_sweeps) + , smoother_overlap(smoother_overlap) + , output_details(output_details) + , smoother_type(smoother_type) + , coarse_type(coarse_type) {} @@ -155,9 +155,9 @@ namespace TrilinosWrappers Assert(global_size == static_cast( TrilinosWrappers::global_length(distributed_constant_modes)), - ExcDimensionMismatch( - global_size, - TrilinosWrappers::global_length(distributed_constant_modes))); + ExcDimensionMismatch(global_size, + TrilinosWrappers::global_length( + distributed_constant_modes))); const bool constant_modes_are_global = additional_data.constant_modes[0].size() == global_size; const size_type my_size = domain_map.NumMyElements(); @@ -225,8 +225,9 @@ namespace TrilinosWrappers const Teuchos::ParameterList &ml_parameters) { preconditioner.reset(); - preconditioner = std::make_shared( - matrix, ml_parameters); + preconditioner = + std::make_shared(matrix, + ml_parameters); } diff --git a/source/lac/trilinos_precondition_muelu.cc b/source/lac/trilinos_precondition_muelu.cc index a85d9ab7a9..808a5a89e8 100644 --- a/source/lac/trilinos_precondition_muelu.cc +++ b/source/lac/trilinos_precondition_muelu.cc @@ -47,17 +47,17 @@ namespace TrilinosWrappers const unsigned int smoother_overlap, const bool output_details, const char * smoother_type, - const char * coarse_type) : - elliptic(elliptic), - n_cycles(n_cycles), - w_cycle(w_cycle), - aggregation_threshold(aggregation_threshold), - constant_modes(constant_modes), - smoother_sweeps(smoother_sweeps), - smoother_overlap(smoother_overlap), - output_details(output_details), - smoother_type(smoother_type), - coarse_type(coarse_type) + const char * coarse_type) + : elliptic(elliptic) + , n_cycles(n_cycles) + , w_cycle(w_cycle) + , aggregation_threshold(aggregation_threshold) + , constant_modes(constant_modes) + , smoother_sweeps(smoother_sweeps) + , smoother_overlap(smoother_overlap) + , output_details(output_details) + , smoother_type(smoother_type) + , coarse_type(coarse_type) {} @@ -65,9 +65,9 @@ namespace TrilinosWrappers PreconditionAMGMueLu::PreconditionAMGMueLu() { # ifdef DEAL_II_WITH_64BIT_INDICES - AssertThrow( - false, - ExcMessage("PreconditionAMGMueLu does not support 64bit-indices!")); + AssertThrow(false, + ExcMessage( + "PreconditionAMGMueLu does not support 64bit-indices!")); # endif } @@ -155,9 +155,9 @@ namespace TrilinosWrappers ExcDimensionMismatch(n_relevant_rows, my_size)); Assert(n_rows == static_cast(TrilinosWrappers::global_length( distributed_constant_modes)), - ExcDimensionMismatch( - n_rows, - TrilinosWrappers::global_length(distributed_constant_modes))); + ExcDimensionMismatch(n_rows, + TrilinosWrappers::global_length( + distributed_constant_modes))); (void)n_relevant_rows; (void)global_length; diff --git a/source/lac/trilinos_solver.cc b/source/lac/trilinos_solver.cc index c9e6629eff..eae22fd400 100644 --- a/source/lac/trilinos_solver.cc +++ b/source/lac/trilinos_solver.cc @@ -39,27 +39,27 @@ namespace TrilinosWrappers { SolverBase::AdditionalData::AdditionalData( const bool output_solver_details, - const unsigned int gmres_restart_parameter) : - output_solver_details(output_solver_details), - gmres_restart_parameter(gmres_restart_parameter) + const unsigned int gmres_restart_parameter) + : output_solver_details(output_solver_details) + , gmres_restart_parameter(gmres_restart_parameter) {} - SolverBase::SolverBase(SolverControl &cn, const AdditionalData &data) : - solver_name(gmres), - solver_control(cn), - additional_data(data) + SolverBase::SolverBase(SolverControl &cn, const AdditionalData &data) + : solver_name(gmres) + , solver_control(cn) + , additional_data(data) {} SolverBase::SolverBase(const SolverBase::SolverName solver_name, SolverControl & cn, - const AdditionalData & data) : - solver_name(solver_name), - solver_control(cn), - additional_data(data) + const AdditionalData & data) + : solver_name(solver_name) + , solver_control(cn) + , additional_data(data) {} @@ -186,8 +186,9 @@ namespace TrilinosWrappers ExcMessage("Matrix is not compressed. Call compress() method.")); Epetra_Vector ep_x(View, A.domain_partitioner(), x.begin()); - Epetra_Vector ep_b( - View, A.range_partitioner(), const_cast(b.begin())); + Epetra_Vector ep_b(View, + A.range_partitioner(), + const_cast(b.begin())); // We need an Epetra_LinearProblem object to let the AztecOO solver know // about the matrix and vectors. @@ -206,8 +207,9 @@ namespace TrilinosWrappers const PreconditionBase & preconditioner) { Epetra_Vector ep_x(View, A.OperatorDomainMap(), x.begin()); - Epetra_Vector ep_b( - View, A.OperatorRangeMap(), const_cast(b.begin())); + Epetra_Vector ep_b(View, + A.OperatorRangeMap(), + const_cast(b.begin())); // We need an Epetra_LinearProblem object to let the AztecOO solver know // about the matrix and vectors. @@ -227,16 +229,17 @@ namespace TrilinosWrappers { // In case we call the solver with deal.II vectors, we create views of the // vectors in Epetra format. - AssertDimension( - static_cast(x.local_size()), - A.domain_partitioner().NumMyElements()); - AssertDimension( - static_cast(b.local_size()), - A.range_partitioner().NumMyElements()); + AssertDimension(static_cast( + x.local_size()), + A.domain_partitioner().NumMyElements()); + AssertDimension(static_cast( + b.local_size()), + A.range_partitioner().NumMyElements()); Epetra_Vector ep_x(View, A.domain_partitioner(), x.begin()); - Epetra_Vector ep_b( - View, A.range_partitioner(), const_cast(b.begin())); + Epetra_Vector ep_b(View, + A.range_partitioner(), + const_cast(b.begin())); // We need an Epetra_LinearProblem object to let the AztecOO solver know // about the matrix and vectors. @@ -254,16 +257,17 @@ namespace TrilinosWrappers const dealii::LinearAlgebra::distributed::Vector &b, const PreconditionBase &preconditioner) { - AssertDimension( - static_cast(x.local_size()), - A.OperatorDomainMap().NumMyElements()); - AssertDimension( - static_cast(b.local_size()), - A.OperatorRangeMap().NumMyElements()); + AssertDimension(static_cast( + x.local_size()), + A.OperatorDomainMap().NumMyElements()); + AssertDimension(static_cast( + b.local_size()), + A.OperatorRangeMap().NumMyElements()); Epetra_Vector ep_x(View, A.OperatorDomainMap(), x.begin()); - Epetra_Vector ep_b( - View, A.OperatorRangeMap(), const_cast(b.begin())); + Epetra_Vector ep_b(View, + A.OperatorRangeMap(), + const_cast(b.begin())); // We need an Epetra_LinearProblem object to let the AztecOO solver know // about the matrix and vectors. @@ -319,8 +323,10 @@ namespace TrilinosWrappers if (CurrentIter == 0) initial_residual = current_residual; - return status_test_collection->CheckStatus( - CurrentIter, CurrentResVector, CurrentResNormEst, SolutionUpdated); + return status_test_collection->CheckStatus(CurrentIter, + CurrentResVector, + CurrentResNormEst, + SolutionUpdated); } virtual AztecOO_StatusType @@ -361,9 +367,9 @@ namespace TrilinosWrappers const int & max_steps, const double & tolerance, const double & reduction, - const Epetra_LinearProblem &linear_problem) : - initial_residual(std::numeric_limits::max()), - current_residual(std::numeric_limits::max()) + const Epetra_LinearProblem &linear_problem) + : initial_residual(std::numeric_limits::max()) + , current_residual(std::numeric_limits::max()) { // Consider linear problem converged if any of the collection // of criterion are met @@ -447,8 +453,9 @@ namespace TrilinosWrappers set_preconditioner(solver, preconditioner); // ... set some options, ... - solver.SetAztecOption( - AZ_output, additional_data.output_solver_details ? AZ_all : AZ_none); + solver.SetAztecOption(AZ_output, + additional_data.output_solver_details ? AZ_all : + AZ_none); solver.SetAztecOption(AZ_conv, AZ_noscaled); // By default, the Trilinos solver chooses convergence criterion based on @@ -591,15 +598,15 @@ namespace TrilinosWrappers /* ---------------------- SolverCG ------------------------ */ - SolverCG::AdditionalData::AdditionalData(const bool output_solver_details) : - SolverBase::AdditionalData(output_solver_details) + SolverCG::AdditionalData::AdditionalData(const bool output_solver_details) + : SolverBase::AdditionalData(output_solver_details) {} - SolverCG::SolverCG(SolverControl &cn, const AdditionalData &data) : - SolverBase(cn, data), - additional_data(data) + SolverCG::SolverCG(SolverControl &cn, const AdditionalData &data) + : SolverBase(cn, data) + , additional_data(data) { solver_name = cg; } @@ -609,15 +616,15 @@ namespace TrilinosWrappers SolverGMRES::AdditionalData::AdditionalData( const bool output_solver_details, - const unsigned int restart_parameter) : - SolverBase::AdditionalData(output_solver_details, restart_parameter) + const unsigned int restart_parameter) + : SolverBase::AdditionalData(output_solver_details, restart_parameter) {} - SolverGMRES::SolverGMRES(SolverControl &cn, const AdditionalData &data) : - SolverBase(cn, data), - additional_data(data) + SolverGMRES::SolverGMRES(SolverControl &cn, const AdditionalData &data) + : SolverBase(cn, data) + , additional_data(data) { solver_name = gmres; } @@ -626,16 +633,15 @@ namespace TrilinosWrappers /* ---------------------- SolverBicgstab ------------------------ */ SolverBicgstab::AdditionalData::AdditionalData( - const bool output_solver_details) : - SolverBase::AdditionalData(output_solver_details) + const bool output_solver_details) + : SolverBase::AdditionalData(output_solver_details) {} - SolverBicgstab::SolverBicgstab(SolverControl & cn, - const AdditionalData &data) : - SolverBase(cn, data), - additional_data(data) + SolverBicgstab::SolverBicgstab(SolverControl &cn, const AdditionalData &data) + : SolverBase(cn, data) + , additional_data(data) { solver_name = bicgstab; } @@ -643,15 +649,15 @@ namespace TrilinosWrappers /* ---------------------- SolverCGS ------------------------ */ - SolverCGS::AdditionalData::AdditionalData(const bool output_solver_details) : - SolverBase::AdditionalData(output_solver_details) + SolverCGS::AdditionalData::AdditionalData(const bool output_solver_details) + : SolverBase::AdditionalData(output_solver_details) {} - SolverCGS::SolverCGS(SolverControl &cn, const AdditionalData &data) : - SolverBase(cn, data), - additional_data(data) + SolverCGS::SolverCGS(SolverControl &cn, const AdditionalData &data) + : SolverBase(cn, data) + , additional_data(data) { solver_name = cgs; } @@ -659,16 +665,15 @@ namespace TrilinosWrappers /* ---------------------- SolverTFQMR ------------------------ */ - SolverTFQMR::AdditionalData::AdditionalData( - const bool output_solver_details) : - SolverBase::AdditionalData(output_solver_details) + SolverTFQMR::AdditionalData::AdditionalData(const bool output_solver_details) + : SolverBase::AdditionalData(output_solver_details) {} - SolverTFQMR::SolverTFQMR(SolverControl &cn, const AdditionalData &data) : - SolverBase(cn, data), - additional_data(data) + SolverTFQMR::SolverTFQMR(SolverControl &cn, const AdditionalData &data) + : SolverBase(cn, data) + , additional_data(data) { solver_name = tfqmr; } @@ -678,16 +683,16 @@ namespace TrilinosWrappers /* ---------------------- SolverDirect ------------------------ */ SolverDirect::AdditionalData::AdditionalData(const bool output_solver_details, - const std::string &solver_type) : - output_solver_details(output_solver_details), - solver_type(solver_type) + const std::string &solver_type) + : output_solver_details(output_solver_details) + , solver_type(solver_type) {} - SolverDirect::SolverDirect(SolverControl &cn, const AdditionalData &data) : - solver_control(cn), - additional_data(data.output_solver_details, data.solver_type) + SolverDirect::SolverDirect(SolverControl &cn, const AdditionalData &data) + : solver_control(cn) + , additional_data(data.output_solver_details, data.solver_type) {} @@ -724,13 +729,13 @@ namespace TrilinosWrappers // solver, if possible. Amesos Factory; - AssertThrow( - Factory.Query(additional_data.solver_type.c_str()), - ExcMessage(std::string("You tried to select the solver type <") + - additional_data.solver_type + - "> but this solver is not supported by Trilinos either " - "because it does not exist, or because Trilinos was not " - "configured for its use.")); + AssertThrow(Factory.Query(additional_data.solver_type.c_str()), + ExcMessage( + std::string("You tried to select the solver type <") + + additional_data.solver_type + + "> but this solver is not supported by Trilinos either " + "because it does not exist, or because Trilinos was not " + "configured for its use.")); solver.reset( Factory.Create(additional_data.solver_type.c_str(), *linear_problem)); @@ -778,8 +783,9 @@ namespace TrilinosWrappers dealii::LinearAlgebra::distributed::Vector & x, const dealii::LinearAlgebra::distributed::Vector &b) { - Epetra_Vector ep_x( - View, linear_problem->GetOperator()->OperatorDomainMap(), x.begin()); + Epetra_Vector ep_x(View, + linear_problem->GetOperator()->OperatorDomainMap(), + x.begin()); Epetra_Vector ep_b(View, linear_problem->GetOperator()->OperatorRangeMap(), const_cast(b.begin())); @@ -823,13 +829,13 @@ namespace TrilinosWrappers // solver, if possible. Amesos Factory; - AssertThrow( - Factory.Query(additional_data.solver_type.c_str()), - ExcMessage(std::string("You tried to select the solver type <") + - additional_data.solver_type + - "> but this solver is not supported by Trilinos either " - "because it does not exist, or because Trilinos was not " - "configured for its use.")); + AssertThrow(Factory.Query(additional_data.solver_type.c_str()), + ExcMessage( + std::string("You tried to select the solver type <") + + additional_data.solver_type + + "> but this solver is not supported by Trilinos either " + "because it does not exist, or because Trilinos was not " + "configured for its use.")); solver.reset( Factory.Create(additional_data.solver_type.c_str(), *linear_problem)); @@ -887,8 +893,9 @@ namespace TrilinosWrappers Assert(A.local_range().second == A.m(), ExcMessage("Can only work in serial when using deal.II vectors.")); Epetra_Vector ep_x(View, A.domain_partitioner(), x.begin()); - Epetra_Vector ep_b( - View, A.range_partitioner(), const_cast(b.begin())); + Epetra_Vector ep_b(View, + A.range_partitioner(), + const_cast(b.begin())); // We need an Epetra_LinearProblem object to let the Amesos solver know // about the matrix and vectors. @@ -906,15 +913,16 @@ namespace TrilinosWrappers dealii::LinearAlgebra::distributed::Vector & x, const dealii::LinearAlgebra::distributed::Vector &b) { - AssertDimension( - static_cast(x.local_size()), - A.domain_partitioner().NumMyElements()); - AssertDimension( - static_cast(b.local_size()), - A.range_partitioner().NumMyElements()); + AssertDimension(static_cast( + x.local_size()), + A.domain_partitioner().NumMyElements()); + AssertDimension(static_cast( + b.local_size()), + A.range_partitioner().NumMyElements()); Epetra_Vector ep_x(View, A.domain_partitioner(), x.begin()); - Epetra_Vector ep_b( - View, A.range_partitioner(), const_cast(b.begin())); + Epetra_Vector ep_b(View, + A.range_partitioner(), + const_cast(b.begin())); // We need an Epetra_LinearProblem object to let the Amesos solver know // about the matrix and vectors. diff --git a/source/lac/trilinos_sparse_matrix.cc b/source/lac/trilinos_sparse_matrix.cc index 3529b6e22f..6323282f6b 100644 --- a/source/lac/trilinos_sparse_matrix.cc +++ b/source/lac/trilinos_sparse_matrix.cc @@ -171,12 +171,12 @@ namespace TrilinosWrappers // thread on a configuration with // MPI will still get a parallel // interface. - SparseMatrix::SparseMatrix() : - column_space_map(new Epetra_Map(0, 0, Utilities::Trilinos::comm_self())), - matrix( - new Epetra_FECrsMatrix(View, *column_space_map, *column_space_map, 0)), - last_action(Zero), - compressed(true) + SparseMatrix::SparseMatrix() + : column_space_map(new Epetra_Map(0, 0, Utilities::Trilinos::comm_self())) + , matrix( + new Epetra_FECrsMatrix(View, *column_space_map, *column_space_map, 0)) + , last_action(Zero) + , compressed(true) { matrix->FillComplete(); } @@ -184,72 +184,71 @@ namespace TrilinosWrappers SparseMatrix::SparseMatrix(const Epetra_Map &input_map, - const size_type n_max_entries_per_row) : - column_space_map(new Epetra_Map(input_map)), - matrix(new Epetra_FECrsMatrix( - Copy, - *column_space_map, - TrilinosWrappers::types::int_type(n_max_entries_per_row), - false)), - last_action(Zero), - compressed(false) + const size_type n_max_entries_per_row) + : column_space_map(new Epetra_Map(input_map)) + , matrix(new Epetra_FECrsMatrix(Copy, + *column_space_map, + TrilinosWrappers::types::int_type( + n_max_entries_per_row), + false)) + , last_action(Zero) + , compressed(false) {} - SparseMatrix::SparseMatrix( - const Epetra_Map & input_map, - const std::vector &n_entries_per_row) : - column_space_map(new Epetra_Map(input_map)), - matrix(new Epetra_FECrsMatrix( - Copy, - *column_space_map, - (int *)const_cast(&(n_entries_per_row[0])), - false)), - last_action(Zero), - compressed(false) + SparseMatrix::SparseMatrix(const Epetra_Map & input_map, + const std::vector &n_entries_per_row) + : column_space_map(new Epetra_Map(input_map)) + , matrix(new Epetra_FECrsMatrix(Copy, + *column_space_map, + (int *)const_cast( + &(n_entries_per_row[0])), + false)) + , last_action(Zero) + , compressed(false) {} SparseMatrix::SparseMatrix(const Epetra_Map &input_row_map, const Epetra_Map &input_col_map, - const size_type n_max_entries_per_row) : - column_space_map(new Epetra_Map(input_col_map)), - matrix(new Epetra_FECrsMatrix( - Copy, - input_row_map, - TrilinosWrappers::types::int_type(n_max_entries_per_row), - false)), - last_action(Zero), - compressed(false) + const size_type n_max_entries_per_row) + : column_space_map(new Epetra_Map(input_col_map)) + , matrix(new Epetra_FECrsMatrix(Copy, + input_row_map, + TrilinosWrappers::types::int_type( + n_max_entries_per_row), + false)) + , last_action(Zero) + , compressed(false) {} - SparseMatrix::SparseMatrix( - const Epetra_Map & input_row_map, - const Epetra_Map & input_col_map, - const std::vector &n_entries_per_row) : - column_space_map(new Epetra_Map(input_col_map)), - matrix(new Epetra_FECrsMatrix( - Copy, - input_row_map, - (int *)const_cast(&(n_entries_per_row[0])), - false)), - last_action(Zero), - compressed(false) + SparseMatrix::SparseMatrix(const Epetra_Map & input_row_map, + const Epetra_Map & input_col_map, + const std::vector &n_entries_per_row) + : column_space_map(new Epetra_Map(input_col_map)) + , matrix(new Epetra_FECrsMatrix(Copy, + input_row_map, + (int *)const_cast( + &(n_entries_per_row[0])), + false)) + , last_action(Zero) + , compressed(false) {} SparseMatrix::SparseMatrix(const size_type m, const size_type n, - const unsigned int n_max_entries_per_row) : - column_space_map( - new Epetra_Map(static_cast(n), - 0, - Utilities::Trilinos::comm_self())), + const unsigned int n_max_entries_per_row) + : column_space_map( + new Epetra_Map(static_cast(n), + 0, + Utilities::Trilinos::comm_self())) + , // on one processor only, we know how the // columns of the matrix will be @@ -266,63 +265,61 @@ namespace TrilinosWrappers Utilities::Trilinos::comm_self()), *column_space_map, n_max_entries_per_row, - false)), - last_action(Zero), - compressed(false) + false)) + , last_action(Zero) + , compressed(false) {} - SparseMatrix::SparseMatrix( - const size_type m, - const size_type n, - const std::vector &n_entries_per_row) : - column_space_map( - new Epetra_Map(static_cast(n), - 0, - Utilities::Trilinos::comm_self())), - matrix(new Epetra_FECrsMatrix( - Copy, - Epetra_Map(static_cast(m), - 0, - Utilities::Trilinos::comm_self()), - *column_space_map, - (int *)const_cast(&(n_entries_per_row[0])), - false)), - last_action(Zero), - compressed(false) + SparseMatrix::SparseMatrix(const size_type m, + const size_type n, + const std::vector &n_entries_per_row) + : column_space_map( + new Epetra_Map(static_cast(n), + 0, + Utilities::Trilinos::comm_self())) + , matrix(new Epetra_FECrsMatrix( + Copy, + Epetra_Map(static_cast(m), + 0, + Utilities::Trilinos::comm_self()), + *column_space_map, + (int *)const_cast(&(n_entries_per_row[0])), + false)) + , last_action(Zero) + , compressed(false) {} SparseMatrix::SparseMatrix(const IndexSet & parallel_partitioning, const MPI_Comm & communicator, - const unsigned int n_max_entries_per_row) : - column_space_map(new Epetra_Map( - parallel_partitioning.make_trilinos_map(communicator, false))), - matrix(new Epetra_FECrsMatrix(Copy, - *column_space_map, - n_max_entries_per_row, - false)), - last_action(Zero), - compressed(false) + const unsigned int n_max_entries_per_row) + : column_space_map(new Epetra_Map( + parallel_partitioning.make_trilinos_map(communicator, false))) + , matrix(new Epetra_FECrsMatrix(Copy, + *column_space_map, + n_max_entries_per_row, + false)) + , last_action(Zero) + , compressed(false) {} - SparseMatrix::SparseMatrix( - const IndexSet & parallel_partitioning, - const MPI_Comm & communicator, - const std::vector &n_entries_per_row) : - column_space_map(new Epetra_Map( - parallel_partitioning.make_trilinos_map(communicator, false))), - matrix(new Epetra_FECrsMatrix( - Copy, - *column_space_map, - (int *)const_cast(&(n_entries_per_row[0])), - false)), - last_action(Zero), - compressed(false) + SparseMatrix::SparseMatrix(const IndexSet ¶llel_partitioning, + const MPI_Comm &communicator, + const std::vector &n_entries_per_row) + : column_space_map(new Epetra_Map( + parallel_partitioning.make_trilinos_map(communicator, false))) + , matrix(new Epetra_FECrsMatrix(Copy, + *column_space_map, + (int *)const_cast( + &(n_entries_per_row[0])), + false)) + , last_action(Zero) + , compressed(false) {} @@ -330,61 +327,61 @@ namespace TrilinosWrappers SparseMatrix::SparseMatrix(const IndexSet &row_parallel_partitioning, const IndexSet &col_parallel_partitioning, const MPI_Comm &communicator, - const size_type n_max_entries_per_row) : - column_space_map(new Epetra_Map( - col_parallel_partitioning.make_trilinos_map(communicator, false))), - matrix(new Epetra_FECrsMatrix( - Copy, - row_parallel_partitioning.make_trilinos_map(communicator, false), - n_max_entries_per_row, - false)), - last_action(Zero), - compressed(false) + const size_type n_max_entries_per_row) + : column_space_map(new Epetra_Map( + col_parallel_partitioning.make_trilinos_map(communicator, false))) + , matrix(new Epetra_FECrsMatrix( + Copy, + row_parallel_partitioning.make_trilinos_map(communicator, false), + n_max_entries_per_row, + false)) + , last_action(Zero) + , compressed(false) {} - SparseMatrix::SparseMatrix( - const IndexSet & row_parallel_partitioning, - const IndexSet & col_parallel_partitioning, - const MPI_Comm & communicator, - const std::vector &n_entries_per_row) : - column_space_map(new Epetra_Map( - col_parallel_partitioning.make_trilinos_map(communicator, false))), - matrix(new Epetra_FECrsMatrix( - Copy, - row_parallel_partitioning.make_trilinos_map(communicator, false), - (int *)const_cast(&(n_entries_per_row[0])), - false)), - last_action(Zero), - compressed(false) + SparseMatrix::SparseMatrix(const IndexSet &row_parallel_partitioning, + const IndexSet &col_parallel_partitioning, + const MPI_Comm &communicator, + const std::vector &n_entries_per_row) + : column_space_map(new Epetra_Map( + col_parallel_partitioning.make_trilinos_map(communicator, false))) + , matrix(new Epetra_FECrsMatrix( + Copy, + row_parallel_partitioning.make_trilinos_map(communicator, false), + (int *)const_cast(&(n_entries_per_row[0])), + false)) + , last_action(Zero) + , compressed(false) {} - SparseMatrix::SparseMatrix(const SparsityPattern &sparsity_pattern) : - column_space_map(new Epetra_Map(sparsity_pattern.domain_partitioner())), - matrix(new Epetra_FECrsMatrix(Copy, - sparsity_pattern.trilinos_sparsity_pattern(), - false)), - last_action(Zero), - compressed(true) + SparseMatrix::SparseMatrix(const SparsityPattern &sparsity_pattern) + : column_space_map(new Epetra_Map(sparsity_pattern.domain_partitioner())) + , matrix( + new Epetra_FECrsMatrix(Copy, + sparsity_pattern.trilinos_sparsity_pattern(), + false)) + , last_action(Zero) + , compressed(true) { - Assert( - sparsity_pattern.trilinos_sparsity_pattern().Filled() == true, - ExcMessage("The Trilinos sparsity pattern has not been compressed.")); + Assert(sparsity_pattern.trilinos_sparsity_pattern().Filled() == true, + ExcMessage( + "The Trilinos sparsity pattern has not been compressed.")); compress(VectorOperation::insert); } - SparseMatrix::SparseMatrix(SparseMatrix &&other) noexcept : - column_space_map(std::move(other.column_space_map)), - matrix(std::move(other.matrix)), - nonlocal_matrix(std::move(other.nonlocal_matrix)), - nonlocal_matrix_exporter(std::move(other.nonlocal_matrix_exporter)), - last_action(other.last_action), - compressed(other.compressed) + SparseMatrix::SparseMatrix(SparseMatrix &&other) noexcept + : column_space_map(std::move(other.column_space_map)) + , matrix(std::move(other.matrix)) + , nonlocal_matrix(std::move(other.nonlocal_matrix)) + , nonlocal_matrix_exporter(std::move(other.nonlocal_matrix_exporter)) + , last_action(other.last_action) + , compressed(other.compressed) { other.last_action = Zero; other.compressed = false; @@ -424,13 +421,17 @@ namespace TrilinosWrappers int n_entries, rhs_n_entries; TrilinosScalar *value_ptr, *rhs_value_ptr; int * index_ptr, *rhs_index_ptr; - int ierr = rhs.matrix->ExtractMyRowView( - row_local, rhs_n_entries, rhs_value_ptr, rhs_index_ptr); + int ierr = rhs.matrix->ExtractMyRowView(row_local, + rhs_n_entries, + rhs_value_ptr, + rhs_index_ptr); (void)ierr; Assert(ierr == 0, ExcTrilinosError(ierr)); - ierr = matrix->ExtractMyRowView( - row_local, n_entries, value_ptr, index_ptr); + ierr = matrix->ExtractMyRowView(row_local, + n_entries, + value_ptr, + index_ptr); Assert(ierr == 0, ExcTrilinosError(ierr)); if (n_entries != rhs_n_entries || @@ -459,8 +460,9 @@ namespace TrilinosWrappers } if (rhs.nonlocal_matrix.get() != nullptr) - nonlocal_matrix = std_cxx14::make_unique( - Copy, rhs.nonlocal_matrix->Graph()); + nonlocal_matrix = + std_cxx14::make_unique(Copy, + rhs.nonlocal_matrix->Graph()); } @@ -487,14 +489,14 @@ namespace TrilinosWrappers if (input_row_map.Comm().MyPID() == 0) { - AssertDimension( - sparsity_pattern.n_rows(), - static_cast( - TrilinosWrappers::n_global_elements(input_row_map))); - AssertDimension( - sparsity_pattern.n_cols(), - static_cast( - TrilinosWrappers::n_global_elements(input_col_map))); + AssertDimension(sparsity_pattern.n_rows(), + static_cast( + TrilinosWrappers::n_global_elements( + input_row_map))); + AssertDimension(sparsity_pattern.n_cols(), + static_cast( + TrilinosWrappers::n_global_elements( + input_col_map))); } column_space_map = std_cxx14::make_unique(input_col_map); @@ -506,8 +508,10 @@ namespace TrilinosWrappers if (exchange_data) { SparsityPattern trilinos_sparsity; - trilinos_sparsity.reinit( - input_row_map, input_col_map, sparsity_pattern, exchange_data); + trilinos_sparsity.reinit(input_row_map, + input_col_map, + sparsity_pattern, + exchange_data); matrix = std_cxx14::make_unique( Copy, trilinos_sparsity.trilinos_sparsity_pattern(), false); @@ -564,8 +568,9 @@ namespace TrilinosWrappers for (size_type col = 0; p != sparsity_pattern.end(row); ++p, ++col) row_indices[col] = p->column(); } - graph->Epetra_CrsGraph::InsertGlobalIndices( - row, row_length, row_indices.data()); + graph->Epetra_CrsGraph::InsertGlobalIndices(row, + row_length, + row_indices.data()); } // Eventually, optimize the graph structure (sort indices, make memory @@ -576,9 +581,9 @@ namespace TrilinosWrappers graph->OptimizeStorage(); // check whether we got the number of columns right. - AssertDimension( - sparsity_pattern.n_cols(), - static_cast(TrilinosWrappers::n_global_cols(*graph))); + AssertDimension(sparsity_pattern.n_cols(), + static_cast( + TrilinosWrappers::n_global_cols(*graph))); (void)n_global_cols; // And now finally generate the matrix. @@ -598,8 +603,8 @@ namespace TrilinosWrappers { public: Epetra_CrsGraphMod(const Epetra_Map &row_map, - const int * n_entries_per_row) : - Epetra_CrsGraph(Copy, row_map, n_entries_per_row, true){}; + const int * n_entries_per_row) + : Epetra_CrsGraph(Copy, row_map, n_entries_per_row, true){}; void SetIndicesAreGlobal() @@ -645,11 +650,11 @@ namespace TrilinosWrappers 0, TrilinosWrappers::n_global_elements(input_row_map)); } relevant_rows.compress(); - Assert( - relevant_rows.n_elements() >= - static_cast(input_row_map.NumMyElements()), - ExcMessage("Locally relevant rows of sparsity pattern must contain " - "all locally owned rows")); + Assert(relevant_rows.n_elements() >= + static_cast(input_row_map.NumMyElements()), + ExcMessage( + "Locally relevant rows of sparsity pattern must contain " + "all locally owned rows")); // check whether the relevant rows correspond to exactly the same map as // the owned rows. In that case, do not create the nonlocal graph and @@ -691,12 +696,13 @@ namespace TrilinosWrappers } } - Epetra_Map off_processor_map( - -1, - ghost_rows.size(), - (ghost_rows.size() > 0) ? (ghost_rows.data()) : nullptr, - 0, - input_row_map.Comm()); + Epetra_Map off_processor_map(-1, + ghost_rows.size(), + (ghost_rows.size() > 0) ? + (ghost_rows.data()) : + nullptr, + 0, + input_row_map.Comm()); std::unique_ptr graph; std::unique_ptr nonlocal_graph; @@ -736,13 +742,15 @@ namespace TrilinosWrappers row_indices[col] = sparsity_pattern.column_number(global_row, col); if (input_row_map.MyGID(global_row)) - graph->InsertGlobalIndices( - global_row, row_length, row_indices.data()); + graph->InsertGlobalIndices(global_row, + row_length, + row_indices.data()); else { Assert(nonlocal_graph.get() != nullptr, ExcInternalError()); - nonlocal_graph->InsertGlobalIndices( - global_row, row_length, row_indices.data()); + nonlocal_graph->InsertGlobalIndices(global_row, + row_length, + row_indices.data()); } } @@ -775,9 +783,9 @@ namespace TrilinosWrappers graph->FillComplete(input_col_map, input_row_map); graph->OptimizeStorage(); - AssertDimension( - sparsity_pattern.n_cols(), - static_cast(TrilinosWrappers::n_global_cols(*graph))); + AssertDimension(sparsity_pattern.n_cols(), + static_cast( + TrilinosWrappers::n_global_cols(*graph))); matrix = std_cxx14::make_unique(Copy, *graph, false); } @@ -789,14 +797,14 @@ namespace TrilinosWrappers void SparseMatrix::reinit(const SparsityPatternType &sparsity_pattern) { - const Epetra_Map rows( - static_cast(sparsity_pattern.n_rows()), - 0, - Utilities::Trilinos::comm_self()); - const Epetra_Map columns( - static_cast(sparsity_pattern.n_cols()), - 0, - Utilities::Trilinos::comm_self()); + const Epetra_Map rows(static_cast( + sparsity_pattern.n_rows()), + 0, + Utilities::Trilinos::comm_self()); + const Epetra_Map columns(static_cast( + sparsity_pattern.n_cols()), + 0, + Utilities::Trilinos::comm_self()); reinit_matrix(rows, columns, @@ -1166,8 +1174,9 @@ namespace TrilinosWrappers // processor must have set the correct entry nonlocal_matrix->FillComplete(*column_space_map, matrix->RowMap()); if (nonlocal_matrix_exporter.get() == nullptr) - nonlocal_matrix_exporter = std_cxx14::make_unique( - nonlocal_matrix->RowMap(), matrix->RowMap()); + nonlocal_matrix_exporter = + std_cxx14::make_unique(nonlocal_matrix->RowMap(), + matrix->RowMap()); ierr = matrix->Export(*nonlocal_matrix, *nonlocal_matrix_exporter, mode); AssertThrow(ierr == 0, ExcTrilinosError(ierr)); @@ -1196,8 +1205,10 @@ namespace TrilinosWrappers // When we clear the matrix, reset // the pointer and generate an // empty matrix. - column_space_map = std_cxx14::make_unique( - 0, 0, Utilities::Trilinos::comm_self()); + column_space_map = + std_cxx14::make_unique(0, + 0, + Utilities::Trilinos::comm_self()); matrix = std_cxx14::make_unique(View, *column_space_map, 0); nonlocal_matrix.reset(); @@ -1298,8 +1309,10 @@ namespace TrilinosWrappers // sure that we have not generated // an error. // TODO Check that col_indices are int and not long long - int ierr = matrix->ExtractMyRowView( - trilinos_i, nnz_extracted, values, col_indices); + int ierr = matrix->ExtractMyRowView(trilinos_i, + nnz_extracted, + values, + col_indices); (void)ierr; Assert(ierr == 0, ExcTrilinosError(ierr)); @@ -1373,8 +1386,10 @@ namespace TrilinosWrappers // Generate the view and make // sure that we have not generated // an error. - int ierr = matrix->ExtractMyRowView( - trilinos_i, nnz_extracted, values, col_indices); + int ierr = matrix->ExtractMyRowView(trilinos_i, + nnz_extracted, + values, + col_indices); (void)ierr; Assert(ierr == 0, ExcTrilinosError(ierr)); @@ -1582,8 +1597,10 @@ namespace TrilinosWrappers ierr = 0; } else - ierr = matrix->Epetra_CrsMatrix::ReplaceGlobalValues( - row, n_columns, col_value_ptr, col_index_ptr); + ierr = matrix->Epetra_CrsMatrix::ReplaceGlobalValues(row, + n_columns, + col_value_ptr, + col_index_ptr); } else { @@ -1766,8 +1783,10 @@ namespace TrilinosWrappers if (matrix->RowMap().MyGID( static_cast(row)) == true) { - ierr = matrix->Epetra_CrsMatrix::SumIntoGlobalValues( - row, n_columns, col_value_ptr, col_index_ptr); + ierr = matrix->Epetra_CrsMatrix::SumIntoGlobalValues(row, + n_columns, + col_value_ptr, + col_index_ptr); AssertThrow(ierr == 0, ExcTrilinosError(ierr)); } else if (nonlocal_matrix.get() != nullptr) @@ -1781,8 +1800,10 @@ namespace TrilinosWrappers ExcMessage("Attempted to write into off-processor matrix row " "that has not be specified as being writable upon " "initialization")); - ierr = nonlocal_matrix->SumIntoGlobalValues( - row, n_columns, col_value_ptr, col_index_ptr); + ierr = nonlocal_matrix->SumIntoGlobalValues(row, + n_columns, + col_value_ptr, + col_index_ptr); AssertThrow(ierr == 0, ExcTrilinosError(ierr)); } else @@ -1897,8 +1918,10 @@ namespace TrilinosWrappers int n_entries, rhs_n_entries; TrilinosScalar *value_ptr, *rhs_value_ptr; int * index_ptr, *rhs_index_ptr; - int ierr = rhs.matrix->ExtractMyRowView( - row_local, rhs_n_entries, rhs_value_ptr, rhs_index_ptr); + int ierr = rhs.matrix->ExtractMyRowView(row_local, + rhs_n_entries, + rhs_value_ptr, + rhs_index_ptr); (void)ierr; Assert(ierr == 0, ExcTrilinosError(ierr)); @@ -1930,15 +1953,16 @@ namespace TrilinosWrappers const TrilinosWrappers::types::int_type rhs_global_col = global_column_index(*rhs.matrix, rhs_index_ptr[i]); int local_col = matrix->ColMap().LID(rhs_global_col); - int *local_index = Utilities::lower_bound( - index_ptr, index_ptr + n_entries, local_col); - Assert( - local_index != index_ptr + n_entries && - *local_index == local_col, - ExcMessage("Adding the entries from the other matrix " - "failed, because the sparsity pattern " - "of that matrix includes more elements than the " - "calling matrix, which is not allowed.")); + int *local_index = Utilities::lower_bound(index_ptr, + index_ptr + n_entries, + local_col); + Assert(local_index != index_ptr + n_entries && + *local_index == local_col, + ExcMessage( + "Adding the entries from the other matrix " + "failed, because the sparsity pattern " + "of that matrix includes more elements than the " + "calling matrix, which is not allowed.")); value_ptr[local_index - index_ptr] += factor * rhs_value_ptr[i]; } } @@ -2042,9 +2066,9 @@ namespace TrilinosWrappers const TrilinosWrappers::MPI::Vector &in, const TrilinosWrappers::MPI::Vector &out) { - Assert( - in.vector_partitioner().SameAs(m.DomainMap()) == true, - ExcMessage("Column map of matrix does not fit with vector map!")); + Assert(in.vector_partitioner().SameAs(m.DomainMap()) == true, + ExcMessage( + "Column map of matrix does not fit with vector map!")); Assert(out.vector_partitioner().SameAs(m.RangeMap()) == true, ExcMessage("Row map of matrix does not fit with vector map!")); (void)m; @@ -2064,8 +2088,9 @@ namespace TrilinosWrappers (void)src; (void)dst; - internal::SparseMatrixImplementation::check_vector_map_equality( - *matrix, src, dst); + internal::SparseMatrixImplementation::check_vector_map_equality(*matrix, + src, + dst); const size_type dst_local_size = internal::end(dst) - internal::begin(dst); AssertDimension(dst_local_size, static_cast(matrix->RangeMap().NumMyPoints())); @@ -2075,12 +2100,12 @@ namespace TrilinosWrappers Epetra_MultiVector tril_dst( View, matrix->RangeMap(), internal::begin(dst), dst_local_size, 1); - Epetra_MultiVector tril_src( - View, - matrix->DomainMap(), - const_cast(internal::begin(src)), - src_local_size, - 1); + Epetra_MultiVector tril_src(View, + matrix->DomainMap(), + const_cast( + internal::begin(src)), + src_local_size, + 1); const int ierr = matrix->Multiply(false, tril_src, tril_dst); Assert(ierr == 0, ExcTrilinosError(ierr)); @@ -2096,8 +2121,9 @@ namespace TrilinosWrappers Assert(&src != &dst, ExcSourceEqualsDestination()); Assert(matrix->Filled(), ExcMatrixNotCompressed()); - internal::SparseMatrixImplementation::check_vector_map_equality( - *matrix, dst, src); + internal::SparseMatrixImplementation::check_vector_map_equality(*matrix, + dst, + src); const size_type dst_local_size = internal::end(dst) - internal::begin(dst); AssertDimension(dst_local_size, static_cast(matrix->DomainMap().NumMyPoints())); @@ -2238,9 +2264,9 @@ namespace TrilinosWrappers Teuchos::RCP mod_B; if (use_vector == false) { - mod_B = Teuchos::rcp( - const_cast(&inputright.trilinos_matrix()), - false); + mod_B = Teuchos::rcp(const_cast( + &inputright.trilinos_matrix()), + false); } else { @@ -2259,8 +2285,9 @@ namespace TrilinosWrappers int N_entries = -1; double *new_data, *B_data; mod_B->ExtractMyRowView(i, N_entries, new_data); - inputright.trilinos_matrix().ExtractMyRowView( - i, N_entries, B_data); + inputright.trilinos_matrix().ExtractMyRowView(i, + N_entries, + B_data); double value = V.trilinos_vector()[0][i]; for (TrilinosWrappers::types::int_type j = 0; j < N_entries; ++j) new_data[j] = value * B_data[j]; @@ -2288,10 +2315,10 @@ namespace TrilinosWrappers SparseMatrix transposed_mat; if (transpose_left == false) - ML_Operator_WrapEpetraCrsMatrix( - const_cast(&inputleft.trilinos_matrix()), - A_, - false); + ML_Operator_WrapEpetraCrsMatrix(const_cast( + &inputleft.trilinos_matrix()), + A_, + false); else { // create transposed matrix @@ -2327,8 +2354,10 @@ namespace TrilinosWrappers { int num_entries, *indices; double *values; - inputleft.trilinos_matrix().ExtractMyRowView( - i, num_entries, values, indices); + inputleft.trilinos_matrix().ExtractMyRowView(i, + num_entries, + values, + indices); Assert(num_entries >= 0, ExcInternalError()); const auto & trilinos_matrix = inputleft.trilinos_matrix(); @@ -2342,10 +2371,10 @@ namespace TrilinosWrappers values[j]); } transposed_mat.compress(VectorOperation::insert); - ML_Operator_WrapEpetraCrsMatrix( - const_cast(&transposed_mat.trilinos_matrix()), - A_, - false); + ML_Operator_WrapEpetraCrsMatrix(const_cast( + &transposed_mat.trilinos_matrix()), + A_, + false); } ML_Operator_WrapEpetraCrsMatrix(mod_B.get(), B_, false); @@ -2590,15 +2619,16 @@ namespace TrilinosWrappers namespace LinearOperatorImplementation { - TrilinosPayload::TrilinosPayload() : - use_transpose(false), + TrilinosPayload::TrilinosPayload() + : use_transpose(false) + , # ifdef DEAL_II_WITH_MPI - communicator(MPI_COMM_SELF), - domain_map(IndexSet().make_trilinos_map(communicator.Comm())), - range_map(IndexSet().make_trilinos_map(communicator.Comm())) + communicator(MPI_COMM_SELF) + , domain_map(IndexSet().make_trilinos_map(communicator.Comm())) + , range_map(IndexSet().make_trilinos_map(communicator.Comm())) # else - domain_map(internal::make_serial_Epetra_map(IndexSet())), - range_map(internal::make_serial_Epetra_map(IndexSet())) + domain_map(internal::make_serial_Epetra_map(IndexSet())) + , range_map(internal::make_serial_Epetra_map(IndexSet())) # endif { vmult = [](Range &, const Domain &) { @@ -2630,21 +2660,22 @@ namespace TrilinosWrappers TrilinosPayload::TrilinosPayload( const TrilinosWrappers::SparseMatrix &matrix_exemplar, - const TrilinosWrappers::SparseMatrix &matrix) : - use_transpose(matrix_exemplar.trilinos_matrix().UseTranspose()), + const TrilinosWrappers::SparseMatrix &matrix) + : use_transpose(matrix_exemplar.trilinos_matrix().UseTranspose()) + , # ifdef DEAL_II_WITH_MPI - communicator(matrix_exemplar.get_mpi_communicator()), - domain_map( - matrix_exemplar.locally_owned_domain_indices().make_trilinos_map( - communicator.Comm())), - range_map( - matrix_exemplar.locally_owned_range_indices().make_trilinos_map( - communicator.Comm())) + communicator(matrix_exemplar.get_mpi_communicator()) + , domain_map( + matrix_exemplar.locally_owned_domain_indices().make_trilinos_map( + communicator.Comm())) + , range_map( + matrix_exemplar.locally_owned_range_indices().make_trilinos_map( + communicator.Comm())) # else domain_map(internal::make_serial_Epetra_map( - matrix_exemplar.locally_owned_domain_indices())), - range_map(internal::make_serial_Epetra_map( - matrix_exemplar.locally_owned_range_indices())) + matrix_exemplar.locally_owned_domain_indices())) + , range_map(internal::make_serial_Epetra_map( + matrix_exemplar.locally_owned_range_indices())) # endif { vmult = [&matrix_exemplar, &matrix](Range & tril_dst, @@ -2714,21 +2745,22 @@ namespace TrilinosWrappers TrilinosPayload::TrilinosPayload( const TrilinosWrappers::SparseMatrix & matrix_exemplar, - const TrilinosWrappers::PreconditionBase &preconditioner) : - use_transpose(matrix_exemplar.trilinos_matrix().UseTranspose()), + const TrilinosWrappers::PreconditionBase &preconditioner) + : use_transpose(matrix_exemplar.trilinos_matrix().UseTranspose()) + , # ifdef DEAL_II_WITH_MPI - communicator(matrix_exemplar.get_mpi_communicator()), - domain_map( - matrix_exemplar.locally_owned_domain_indices().make_trilinos_map( - communicator.Comm())), - range_map( - matrix_exemplar.locally_owned_range_indices().make_trilinos_map( - communicator.Comm())) + communicator(matrix_exemplar.get_mpi_communicator()) + , domain_map( + matrix_exemplar.locally_owned_domain_indices().make_trilinos_map( + communicator.Comm())) + , range_map( + matrix_exemplar.locally_owned_range_indices().make_trilinos_map( + communicator.Comm())) # else domain_map(internal::make_serial_Epetra_map( - matrix_exemplar.locally_owned_domain_indices())), - range_map(internal::make_serial_Epetra_map( - matrix_exemplar.locally_owned_range_indices())) + matrix_exemplar.locally_owned_domain_indices())) + , range_map(internal::make_serial_Epetra_map( + matrix_exemplar.locally_owned_range_indices())) # endif { vmult = [&matrix_exemplar, &preconditioner](Range & tril_dst, @@ -2801,8 +2833,9 @@ namespace TrilinosWrappers AssertThrow(ierr == 0, ExcTrilinosError(ierr)); }; - inv_Tvmult = [&matrix_exemplar, &preconditioner]( - Range &tril_dst, const Domain &tril_src) { + inv_Tvmult = [&matrix_exemplar, + &preconditioner](Range & tril_dst, + const Domain &tril_src) { // Duplicated from TrilinosWrappers::PreconditionBase::vmult // as well as from TrilinosWrappers::SparseMatrix::Tvmult Assert(&tril_src != &tril_dst, @@ -2832,20 +2865,21 @@ namespace TrilinosWrappers TrilinosPayload::TrilinosPayload( const TrilinosWrappers::PreconditionBase &preconditioner_exemplar, - const TrilinosWrappers::PreconditionBase &preconditioner) : - use_transpose( - preconditioner_exemplar.trilinos_operator().UseTranspose()), + const TrilinosWrappers::PreconditionBase &preconditioner) + : use_transpose( + preconditioner_exemplar.trilinos_operator().UseTranspose()) + , # ifdef DEAL_II_WITH_MPI - communicator(preconditioner_exemplar.get_mpi_communicator()), - domain_map(preconditioner_exemplar.locally_owned_domain_indices() - .make_trilinos_map(communicator.Comm())), - range_map(preconditioner_exemplar.locally_owned_range_indices() - .make_trilinos_map(communicator.Comm())) + communicator(preconditioner_exemplar.get_mpi_communicator()) + , domain_map(preconditioner_exemplar.locally_owned_domain_indices() + .make_trilinos_map(communicator.Comm())) + , range_map(preconditioner_exemplar.locally_owned_range_indices() + .make_trilinos_map(communicator.Comm())) # else domain_map(internal::make_serial_Epetra_map( - preconditioner_exemplar.locally_owned_domain_indices())), - range_map(internal::make_serial_Epetra_map( - preconditioner_exemplar.locally_owned_range_indices())) + preconditioner_exemplar.locally_owned_domain_indices())) + , range_map(internal::make_serial_Epetra_map( + preconditioner_exemplar.locally_owned_range_indices())) # endif { vmult = [&preconditioner_exemplar, @@ -2918,8 +2952,9 @@ namespace TrilinosWrappers AssertThrow(ierr == 0, ExcTrilinosError(ierr)); }; - inv_Tvmult = [&preconditioner_exemplar, &preconditioner]( - Range &tril_dst, const Domain &tril_src) { + inv_Tvmult = [&preconditioner_exemplar, + &preconditioner](Range & tril_dst, + const Domain &tril_src) { // Duplicated from TrilinosWrappers::PreconditionBase::vmult // as well as from TrilinosWrappers::SparseMatrix::Tvmult Assert(&tril_src != &tril_dst, @@ -2947,15 +2982,15 @@ namespace TrilinosWrappers - TrilinosPayload::TrilinosPayload(const TrilinosPayload &payload) : - vmult(payload.vmult), - Tvmult(payload.Tvmult), - inv_vmult(payload.inv_vmult), - inv_Tvmult(payload.inv_Tvmult), - use_transpose(payload.use_transpose), - communicator(payload.communicator), - domain_map(payload.domain_map), - range_map(payload.range_map) + TrilinosPayload::TrilinosPayload(const TrilinosPayload &payload) + : vmult(payload.vmult) + , Tvmult(payload.Tvmult) + , inv_vmult(payload.inv_vmult) + , inv_Tvmult(payload.inv_Tvmult) + , use_transpose(payload.use_transpose) + , communicator(payload.communicator) + , domain_map(payload.domain_map) + , range_map(payload.range_map) {} @@ -2963,12 +2998,13 @@ namespace TrilinosWrappers // Composite copy constructor // This is required for PackagedOperations TrilinosPayload::TrilinosPayload(const TrilinosPayload &first_op, - const TrilinosPayload &second_op) : - use_transpose(false), // The combination of operators provides the exact - // definition of the operation - communicator(first_op.communicator), - domain_map(second_op.domain_map), - range_map(first_op.range_map) + const TrilinosPayload &second_op) + : use_transpose(false) + , // The combination of operators provides the exact + // definition of the operation + communicator(first_op.communicator) + , domain_map(second_op.domain_map) + , range_map(first_op.range_map) {} @@ -3188,14 +3224,14 @@ namespace TrilinosWrappers typedef typename TrilinosPayload::VectorType Intermediate; typedef TrilinosWrappers::MPI::Vector GVMVectorType; - Assert( - first_op.locally_owned_domain_indices() == - second_op.locally_owned_domain_indices(), - ExcMessage("Operators are set to work on incompatible IndexSets.")); - Assert( - first_op.locally_owned_range_indices() == - second_op.locally_owned_range_indices(), - ExcMessage("Operators are set to work on incompatible IndexSets.")); + Assert(first_op.locally_owned_domain_indices() == + second_op.locally_owned_domain_indices(), + ExcMessage( + "Operators are set to work on incompatible IndexSets.")); + Assert(first_op.locally_owned_range_indices() == + second_op.locally_owned_range_indices(), + ExcMessage( + "Operators are set to work on incompatible IndexSets.")); TrilinosPayload return_op(first_op, second_op); @@ -3215,13 +3251,13 @@ namespace TrilinosWrappers // Duplicated from TrilinosWrappers::SparseMatrix::vmult const size_type i_local_size = i->end() - i->begin(); - AssertDimension( - i_local_size, - static_cast(first_op_init_map.NumMyPoints())); + AssertDimension(i_local_size, + static_cast( + first_op_init_map.NumMyPoints())); const Epetra_Map &second_op_init_map = second_op.OperatorDomainMap(); - AssertDimension( - i_local_size, - static_cast(second_op_init_map.NumMyPoints())); + AssertDimension(i_local_size, + static_cast( + second_op_init_map.NumMyPoints())); (void)second_op_init_map; Intermediate tril_int(View, first_op_init_map, @@ -3259,13 +3295,13 @@ namespace TrilinosWrappers // Duplicated from TrilinosWrappers::SparseMatrix::vmult const size_type i_local_size = i->end() - i->begin(); - AssertDimension( - i_local_size, - static_cast(first_op_init_map.NumMyPoints())); + AssertDimension(i_local_size, + static_cast( + first_op_init_map.NumMyPoints())); const Epetra_Map &second_op_init_map = second_op.OperatorRangeMap(); - AssertDimension( - i_local_size, - static_cast(second_op_init_map.NumMyPoints())); + AssertDimension(i_local_size, + static_cast( + second_op_init_map.NumMyPoints())); (void)second_op_init_map; Intermediate tril_int(View, first_op_init_map, @@ -3300,13 +3336,13 @@ namespace TrilinosWrappers // Duplicated from TrilinosWrappers::SparseMatrix::vmult const size_type i_local_size = i->end() - i->begin(); - AssertDimension( - i_local_size, - static_cast(first_op_init_map.NumMyPoints())); + AssertDimension(i_local_size, + static_cast( + first_op_init_map.NumMyPoints())); const Epetra_Map &second_op_init_map = second_op.OperatorRangeMap(); - AssertDimension( - i_local_size, - static_cast(second_op_init_map.NumMyPoints())); + AssertDimension(i_local_size, + static_cast( + second_op_init_map.NumMyPoints())); (void)second_op_init_map; Intermediate tril_int(View, first_op_init_map, @@ -3344,13 +3380,13 @@ namespace TrilinosWrappers // Duplicated from TrilinosWrappers::SparseMatrix::vmult const size_type i_local_size = i->end() - i->begin(); - AssertDimension( - i_local_size, - static_cast(first_op_init_map.NumMyPoints())); + AssertDimension(i_local_size, + static_cast( + first_op_init_map.NumMyPoints())); const Epetra_Map &second_op_init_map = second_op.OperatorDomainMap(); - AssertDimension( - i_local_size, - static_cast(second_op_init_map.NumMyPoints())); + AssertDimension(i_local_size, + static_cast( + second_op_init_map.NumMyPoints())); (void)second_op_init_map; Intermediate tril_int(View, first_op_init_map, @@ -3383,10 +3419,10 @@ namespace TrilinosWrappers typedef typename TrilinosPayload::VectorType Intermediate; typedef TrilinosWrappers::MPI::Vector GVMVectorType; - AssertThrow( - first_op.locally_owned_domain_indices() == - second_op.locally_owned_range_indices(), - ExcMessage("Operators are set to work on incompatible IndexSets.")); + AssertThrow(first_op.locally_owned_domain_indices() == + second_op.locally_owned_range_indices(), + ExcMessage( + "Operators are set to work on incompatible IndexSets.")); TrilinosPayload return_op(first_op, second_op); @@ -3406,13 +3442,13 @@ namespace TrilinosWrappers // Duplicated from TrilinosWrappers::SparseMatrix::vmult const size_type i_local_size = i->end() - i->begin(); - AssertDimension( - i_local_size, - static_cast(first_op_init_map.NumMyPoints())); + AssertDimension(i_local_size, + static_cast( + first_op_init_map.NumMyPoints())); const Epetra_Map &second_op_init_map = second_op.OperatorRangeMap(); - AssertDimension( - i_local_size, - static_cast(second_op_init_map.NumMyPoints())); + AssertDimension(i_local_size, + static_cast( + second_op_init_map.NumMyPoints())); (void)second_op_init_map; Intermediate tril_int(View, first_op_init_map, @@ -3448,13 +3484,13 @@ namespace TrilinosWrappers // Duplicated from TrilinosWrappers::SparseMatrix::vmult const size_type i_local_size = i->end() - i->begin(); - AssertDimension( - i_local_size, - static_cast(first_op_init_map.NumMyPoints())); + AssertDimension(i_local_size, + static_cast( + first_op_init_map.NumMyPoints())); const Epetra_Map &second_op_init_map = second_op.OperatorDomainMap(); - AssertDimension( - i_local_size, - static_cast(second_op_init_map.NumMyPoints())); + AssertDimension(i_local_size, + static_cast( + second_op_init_map.NumMyPoints())); (void)second_op_init_map; Intermediate tril_int(View, first_op_init_map, @@ -3486,13 +3522,13 @@ namespace TrilinosWrappers // Duplicated from TrilinosWrappers::SparseMatrix::vmult const size_type i_local_size = i->end() - i->begin(); - AssertDimension( - i_local_size, - static_cast(first_op_init_map.NumMyPoints())); + AssertDimension(i_local_size, + static_cast( + first_op_init_map.NumMyPoints())); const Epetra_Map &second_op_init_map = second_op.OperatorDomainMap(); - AssertDimension( - i_local_size, - static_cast(second_op_init_map.NumMyPoints())); + AssertDimension(i_local_size, + static_cast( + second_op_init_map.NumMyPoints())); (void)second_op_init_map; Intermediate tril_int(View, first_op_init_map, @@ -3528,13 +3564,13 @@ namespace TrilinosWrappers // Duplicated from TrilinosWrappers::SparseMatrix::vmult const size_type i_local_size = i->end() - i->begin(); - AssertDimension( - i_local_size, - static_cast(first_op_init_map.NumMyPoints())); + AssertDimension(i_local_size, + static_cast( + first_op_init_map.NumMyPoints())); const Epetra_Map &second_op_init_map = second_op.OperatorRangeMap(); - AssertDimension( - i_local_size, - static_cast(second_op_init_map.NumMyPoints())); + AssertDimension(i_local_size, + static_cast( + second_op_init_map.NumMyPoints())); (void)second_op_init_map; Intermediate tril_int(View, first_op_init_map, diff --git a/source/lac/trilinos_sparsity_pattern.cc b/source/lac/trilinos_sparsity_pattern.cc index bfcb2cf4a9..45a5c62ddb 100644 --- a/source/lac/trilinos_sparsity_pattern.cc +++ b/source/lac/trilinos_sparsity_pattern.cc @@ -86,8 +86,10 @@ namespace TrilinosWrappers std_cxx14::make_unique(TrilinosWrappers::types::int_type(0), TrilinosWrappers::types::int_type(0), Utilities::Trilinos::comm_self()); - graph = std_cxx14::make_unique( - View, *column_space_map, *column_space_map, 0); + graph = std_cxx14::make_unique(View, + *column_space_map, + *column_space_map, + 0); graph->FillComplete(); } @@ -147,27 +149,28 @@ namespace TrilinosWrappers - SparsityPattern::SparsityPattern(SparsityPattern &&other) noexcept : - Subscriptor(std::move(other)), - column_space_map(std::move(other.column_space_map)), - graph(std::move(other.graph)), - nonlocal_graph(std::move(other.nonlocal_graph)) + SparsityPattern::SparsityPattern(SparsityPattern &&other) noexcept + : Subscriptor(std::move(other)) + , column_space_map(std::move(other.column_space_map)) + , graph(std::move(other.graph)) + , nonlocal_graph(std::move(other.nonlocal_graph)) {} // Copy function only works if the // sparsity pattern is empty. - SparsityPattern::SparsityPattern(const SparsityPattern &input_sparsity) : - Subscriptor(), - column_space_map(new Epetra_Map(TrilinosWrappers::types::int_type(0), - TrilinosWrappers::types::int_type(0), - Utilities::Trilinos::comm_self())), - graph(new Epetra_FECrsGraph(View, *column_space_map, *column_space_map, 0)) + SparsityPattern::SparsityPattern(const SparsityPattern &input_sparsity) + : Subscriptor() + , column_space_map(new Epetra_Map(TrilinosWrappers::types::int_type(0), + TrilinosWrappers::types::int_type(0), + Utilities::Trilinos::comm_self())) + , graph( + new Epetra_FECrsGraph(View, *column_space_map, *column_space_map, 0)) { (void)input_sparsity; - Assert( - input_sparsity.n_rows() == 0, - ExcMessage("Copy constructor only works for empty sparsity patterns.")); + Assert(input_sparsity.n_rows() == 0, + ExcMessage( + "Copy constructor only works for empty sparsity patterns.")); } @@ -330,9 +333,9 @@ namespace TrilinosWrappers // release memory before reallocation nonlocal_graph.reset(); graph.reset(); - AssertDimension( - n_entries_per_row.size(), - static_cast(TrilinosWrappers::n_global_elements(row_map))); + AssertDimension(n_entries_per_row.size(), + static_cast( + TrilinosWrappers::n_global_elements(row_map))); column_space_map = std_cxx14::make_unique(col_map); std::vector local_entries_per_row( @@ -371,18 +374,18 @@ namespace TrilinosWrappers nonlocal_graph.reset(); graph.reset(); - AssertDimension( - sp.n_rows(), - static_cast(TrilinosWrappers::n_global_elements(row_map))); - AssertDimension( - sp.n_cols(), - static_cast(TrilinosWrappers::n_global_elements(col_map))); + AssertDimension(sp.n_rows(), + static_cast( + TrilinosWrappers::n_global_elements(row_map))); + AssertDimension(sp.n_cols(), + static_cast( + TrilinosWrappers::n_global_elements(col_map))); column_space_map = std_cxx14::make_unique(col_map); - Assert( - row_map.LinearMap() == true, - ExcMessage("This function only works if the row map is contiguous.")); + Assert(row_map.LinearMap() == true, + ExcMessage( + "This function only works if the row map is contiguous.")); const size_type first_row = TrilinosWrappers::min_my_gid(row_map), last_row = TrilinosWrappers::max_my_gid(row_map) + 1; @@ -428,8 +431,9 @@ namespace TrilinosWrappers ++p; } } - graph->Epetra_CrsGraph::InsertGlobalIndices( - row, row_length, row_indices.data()); + graph->Epetra_CrsGraph::InsertGlobalIndices(row, + row_length, + row_indices.data()); } else for (size_type row = 0; row < sp.n_rows(); ++row) @@ -458,10 +462,10 @@ namespace TrilinosWrappers row_indices.data()); } - int ierr = graph->GlobalAssemble( - *column_space_map, - static_cast(graph->RangeMap()), - true); + int ierr = graph->GlobalAssemble(*column_space_map, + static_cast( + graph->RangeMap()), + true); AssertThrow(ierr == 0, ExcTrilinosError(ierr)); ierr = graph->OptimizeStorage(); @@ -618,10 +622,10 @@ namespace TrilinosWrappers # ifdef DEBUG { IndexSet tmp = writable_rows & row_parallel_partitioning; - Assert( - tmp == row_parallel_partitioning, - ExcMessage("The set of writable rows passed to this method does not " - "contain the locally owned rows, which is not allowed.")); + Assert(tmp == row_parallel_partitioning, + ExcMessage( + "The set of writable rows passed to this method does not " + "contain the locally owned rows, which is not allowed.")); } # endif nonlocal_partitioner.subtract_set(row_parallel_partitioning); @@ -771,8 +775,10 @@ namespace TrilinosWrappers std_cxx14::make_unique(TrilinosWrappers::types::int_type(0), TrilinosWrappers::types::int_type(0), Utilities::Trilinos::comm_self()); - graph = std_cxx14::make_unique( - View, *column_space_map, *column_space_map, 0); + graph = std_cxx14::make_unique(View, + *column_space_map, + *column_space_map, + 0); graph->FillComplete(); nonlocal_graph.reset(); @@ -799,22 +805,22 @@ namespace TrilinosWrappers Assert(nonlocal_graph->RowMap().NumMyElements() == 0 || nonlocal_graph->IndicesAreGlobal() == true, ExcInternalError()); - nonlocal_graph->FillComplete( - *column_space_map, - static_cast(graph->RangeMap())); + nonlocal_graph->FillComplete(*column_space_map, + static_cast( + graph->RangeMap())); nonlocal_graph->OptimizeStorage(); Epetra_Export exporter(nonlocal_graph->RowMap(), graph->RowMap()); ierr = graph->Export(*nonlocal_graph, exporter, Add); AssertThrow(ierr == 0, ExcTrilinosError(ierr)); - ierr = graph->FillComplete( - *column_space_map, - static_cast(graph->RangeMap())); + ierr = graph->FillComplete(*column_space_map, + static_cast( + graph->RangeMap())); } else - ierr = graph->GlobalAssemble( - *column_space_map, - static_cast(graph->RangeMap()), - true); + ierr = graph->GlobalAssemble(*column_space_map, + static_cast( + graph->RangeMap()), + true); AssertThrow(ierr == 0, ExcTrilinosError(ierr)); @@ -936,8 +942,9 @@ namespace TrilinosWrappers static_cast(i - indices[j])); } } - graph->Comm().MaxAll( - (TrilinosWrappers::types::int_type *)&local_b, &global_b, 1); + graph->Comm().MaxAll((TrilinosWrappers::types::int_type *)&local_b, + &global_b, + 1); return static_cast(global_b); } diff --git a/source/lac/trilinos_vector.cc b/source/lac/trilinos_vector.cc index d2eeb73c5d..3ad0b5472f 100644 --- a/source/lac/trilinos_vector.cc +++ b/source/lac/trilinos_vector.cc @@ -64,27 +64,28 @@ namespace TrilinosWrappers namespace MPI { - Vector::Vector() : - Subscriptor(), - last_action(Zero), - compressed(true), - has_ghosts(false), - vector(new Epetra_FEVector( - Epetra_Map(0, 0, 0, Utilities::Trilinos::comm_self()))) + Vector::Vector() + : Subscriptor() + , last_action(Zero) + , compressed(true) + , has_ghosts(false) + , vector(new Epetra_FEVector( + Epetra_Map(0, 0, 0, Utilities::Trilinos::comm_self()))) {} Vector::Vector(const IndexSet ¶llel_partitioning, - const MPI_Comm &communicator) : - Vector() + const MPI_Comm &communicator) + : Vector() { reinit(parallel_partitioning, communicator); } - Vector::Vector(const Vector &v) : Vector() + Vector::Vector(const Vector &v) + : Vector() { has_ghosts = v.has_ghosts; vector = std_cxx14::make_unique(*v.vector); @@ -93,7 +94,8 @@ namespace TrilinosWrappers - Vector::Vector(Vector &&v) noexcept : Vector() + Vector::Vector(Vector &&v) noexcept + : Vector() { // initialize a minimal, valid object and swap swap(v); @@ -103,15 +105,15 @@ namespace TrilinosWrappers Vector::Vector(const IndexSet ¶llel_partitioner, const Vector & v, - const MPI_Comm &communicator) : - Vector() + const MPI_Comm &communicator) + : Vector() { AssertThrow(parallel_partitioner.size() == static_cast( TrilinosWrappers::n_global_elements(v.vector->Map())), - ExcDimensionMismatch( - parallel_partitioner.size(), - TrilinosWrappers::n_global_elements(v.vector->Map()))); + ExcDimensionMismatch(parallel_partitioner.size(), + TrilinosWrappers::n_global_elements( + v.vector->Map()))); vector = std_cxx14::make_unique( parallel_partitioner.make_trilinos_map(communicator, true)); @@ -122,8 +124,8 @@ namespace TrilinosWrappers Vector::Vector(const IndexSet &local, const IndexSet &ghost, - const MPI_Comm &communicator) : - Vector() + const MPI_Comm &communicator) + : Vector() { reinit(local, ghost, communicator, false); } @@ -320,11 +322,11 @@ namespace TrilinosWrappers if (import_data == true) { - AssertThrow( - static_cast( - TrilinosWrappers::global_length(*actual_vec)) == v.size(), - ExcDimensionMismatch(TrilinosWrappers::global_length(*actual_vec), - v.size())); + AssertThrow(static_cast(TrilinosWrappers::global_length( + *actual_vec)) == v.size(), + ExcDimensionMismatch(TrilinosWrappers::global_length( + *actual_vec), + v.size())); Epetra_Import data_exchange(vector->Map(), actual_vec->Map()); @@ -477,8 +479,9 @@ namespace TrilinosWrappers } if (v.nonlocal_vector.get() != nullptr) - nonlocal_vector = std_cxx14::make_unique( - v.nonlocal_vector->Map(), 1); + nonlocal_vector = + std_cxx14::make_unique(v.nonlocal_vector->Map(), + 1); return *this; } @@ -578,11 +581,11 @@ namespace TrilinosWrappers Assert(comm_ptr != nullptr, ExcInternalError()); Utilities::MPI::MinMaxAvg result = Utilities::MPI::min_max_avg(double_mode, comm_ptr->GetMpiComm()); - Assert( - result.max - result.min < 1e-5, - ExcMessage("Not all processors agree whether the last operation on " - "this vector was an addition or a set operation. This will " - "prevent the compress() operation from succeeding.")); + Assert(result.max - result.min < 1e-5, + ExcMessage( + "Not all processors agree whether the last operation on " + "this vector was an addition or a set operation. This will " + "prevent the compress() operation from succeeding.")); # endif # endif diff --git a/source/matrix_free/matrix_free.inst.in b/source/matrix_free/matrix_free.inst.in index 942891ded8..c257a879da 100644 --- a/source/matrix_free/matrix_free.inst.in +++ b/source/matrix_free/matrix_free.inst.in @@ -34,23 +34,21 @@ for (deal_II_dimension : DIMENSIONS) template void MatrixFree:: print_memory_consumption(ConditionalOStream &) const; - template void - MatrixFree::internal_reinit( - const Mapping &, - const std::vector *> &, - const std::vector *> &, - const std::vector &, - const std::vector> &, - const AdditionalData &); - - template void - MatrixFree::internal_reinit( - const Mapping &, - const std::vector *> &, - const std::vector *> &, - const std::vector &, - const std::vector> &, - const AdditionalData &); + template void MatrixFree::internal_reinit< + double>(const Mapping &, + const std::vector *> &, + const std::vector *> &, + const std::vector &, + const std::vector> &, + const AdditionalData &); + + template void MatrixFree::internal_reinit< + double>(const Mapping &, + const std::vector *> &, + const std::vector *> &, + const std::vector &, + const std::vector> &, + const AdditionalData &); template void MatrixFree::internal_reinit( const Mapping &, diff --git a/source/matrix_free/task_info.cc b/source/matrix_free/task_info.cc index a5bdbf79c2..36275e2c3c 100644 --- a/source/matrix_free/task_info.cc +++ b/source/matrix_free/task_info.cc @@ -55,20 +55,20 @@ namespace internal public: ActualCellWork(MFWorkerInterface **worker_pointer, const unsigned int partition, - const TaskInfo & task_info) : - worker(nullptr), - worker_pointer(worker_pointer), - partition(partition), - task_info(task_info) + const TaskInfo & task_info) + : worker(nullptr) + , worker_pointer(worker_pointer) + , partition(partition) + , task_info(task_info) {} ActualCellWork(MFWorkerInterface &worker, const unsigned int partition, - const TaskInfo & task_info) : - worker(&worker), - worker_pointer(nullptr), - partition(partition), - task_info(task_info) + const TaskInfo & task_info) + : worker(&worker) + , worker_pointer(nullptr) + , partition(partition) + , task_info(task_info) {} void @@ -106,10 +106,10 @@ namespace internal CellWork(MFWorkerInterface &worker, const unsigned int partition, const TaskInfo & task_info, - const bool is_blocked) : - dummy(nullptr), - work(worker, partition, task_info), - is_blocked(is_blocked) + const bool is_blocked) + : dummy(nullptr) + , work(worker, partition, task_info) + , is_blocked(is_blocked) {} tbb::task * @@ -137,12 +137,12 @@ namespace internal PartitionWork(MFWorkerInterface &function_in, const unsigned int partition_in, const TaskInfo & task_info_in, - const bool is_blocked_in = false) : - dummy(nullptr), - function(function_in), - partition(partition_in), - task_info(task_info_in), - is_blocked(is_blocked_in) + const bool is_blocked_in = false) + : dummy(nullptr) + , function(function_in) + , partition(partition_in) + , task_info(task_info_in) + , is_blocked(is_blocked_in) {} tbb::task * @@ -233,10 +233,10 @@ namespace internal public: CellWork(MFWorkerInterface &worker_in, const TaskInfo & task_info_in, - const unsigned int partition_in) : - worker(worker_in), - task_info(task_info_in), - partition(partition_in) + const unsigned int partition_in) + : worker(worker_in) + , task_info(task_info_in) + , partition(partition_in) {} void @@ -270,12 +270,12 @@ namespace internal PartitionWork(MFWorkerInterface &worker_in, const unsigned int partition_in, const TaskInfo & task_info_in, - const bool is_blocked_in) : - dummy(nullptr), - worker(worker_in), - partition(partition_in), - task_info(task_info_in), - is_blocked(is_blocked_in) + const bool is_blocked_in) + : dummy(nullptr) + , worker(worker_in) + , partition(partition_in) + , task_info(task_info_in) + , is_blocked(is_blocked_in) {} tbb::task * @@ -309,9 +309,9 @@ namespace internal class MPICommunication : public tbb::task { public: - MPICommunication(MFWorkerInterface &worker_in, const bool do_compress) : - worker(worker_in), - do_compress(do_compress) + MPICommunication(MFWorkerInterface &worker_in, const bool do_compress) + : worker(worker_in) + , do_compress(do_compress) {} tbb::task * @@ -388,8 +388,10 @@ namespace internal if (odds == evens) { worker[evens] = new (worker[j]->allocate_child()) - partition::PartitionWork( - funct, 2 * j + 1, *this, false); + partition::PartitionWork(funct, + 2 * j + 1, + *this, + false); worker[j]->spawn(*worker[evens]); } else @@ -434,12 +436,16 @@ namespace internal if (part == 0) worker[worker_index] = new (worker_compr->allocate_child()) - color::PartitionWork( - funct, slice_index, *this, false); + color::PartitionWork(funct, + slice_index, + *this, + false); else - worker[worker_index] = - new (root->allocate_child()) color::PartitionWork( - funct, slice_index, *this, false); + worker[worker_index] = new (root->allocate_child()) + color::PartitionWork(funct, + slice_index, + *this, + false); slice_index++; for (; slice_index < partition_row_index[part + 1]; slice_index++) @@ -448,8 +454,10 @@ namespace internal worker_index++; worker[worker_index] = new (worker[worker_index - 1]->allocate_child()) - color::PartitionWork( - funct, slice_index, *this, false); + color::PartitionWork(funct, + slice_index, + *this, + false); } worker[worker_index]->set_ref_count(2); if (part > 0) @@ -486,16 +494,20 @@ namespace internal { blocked_worker[part / 2] = new (worker[worker_index - 1]->allocate_child()) - color::PartitionWork( - funct, slice_index, *this, true); + color::PartitionWork(funct, + slice_index, + *this, + true); slice_index++; if (slice_index < partition_row_index[part + 1]) { blocked_worker[part / 2]->set_ref_count(1); worker[worker_index] = new ( blocked_worker[part / 2]->allocate_child()) - color::PartitionWork( - funct, slice_index, *this, false); + color::PartitionWork(funct, + slice_index, + *this, + false); slice_index++; } else @@ -514,8 +526,10 @@ namespace internal } worker[worker_index] = new (worker[worker_index - 1]->allocate_child()) - color::PartitionWork( - funct, slice_index, *this, false); + color::PartitionWork(funct, + slice_index, + *this, + false); } spawn_index_child = worker_index; worker_index++; @@ -1061,8 +1075,9 @@ namespace internal // Create connectivity graph for blocks based on connectivity graph for // cells. DynamicSparsityPattern connectivity(n_blocks, n_blocks); - make_connectivity_cells_to_blocks( - irregular_cells, connectivity_large, connectivity); + make_connectivity_cells_to_blocks(irregular_cells, + connectivity_large, + connectivity); // Create cell-block partitioning. @@ -1206,8 +1221,9 @@ namespace internal // if we want to block before partitioning, create connectivity graph // for blocks based on connectivity graph for cells. DynamicSparsityPattern connectivity_blocks(n_blocks, n_blocks); - make_connectivity_cells_to_blocks( - irregular_cells, connectivity, connectivity_blocks); + make_connectivity_cells_to_blocks(irregular_cells, + connectivity, + connectivity_blocks); unsigned int n_blocks = 0; if (scheme == partition_color || diff --git a/source/meshworker/mesh_worker.cc b/source/meshworker/mesh_worker.cc index ad7594ed4a..33cef92a37 100644 --- a/source/meshworker/mesh_worker.cc +++ b/source/meshworker/mesh_worker.cc @@ -58,20 +58,20 @@ namespace MeshWorker template class LocalResults; template - LocalIntegrator::LocalIntegrator() : - use_cell(true), - use_boundary(true), - use_face(true) + LocalIntegrator::LocalIntegrator() + : use_cell(true) + , use_boundary(true) + , use_face(true) {} template LocalIntegrator::LocalIntegrator(bool c, bool b, - bool f) : - use_cell(c), - use_boundary(b), - use_face(f) + bool f) + : use_cell(c) + , use_boundary(b) + , use_face(f) {} diff --git a/source/multigrid/mg_level_global_transfer.cc b/source/multigrid/mg_level_global_transfer.cc index 721bf4a83a..30052c40d3 100644 --- a/source/multigrid/mg_level_global_transfer.cc +++ b/source/multigrid/mg_level_global_transfer.cc @@ -206,8 +206,9 @@ namespace IndexSet index_set(mg_dof.locally_owned_dofs().size()); std::vector accessed_indices; - ghosted_level_vector.resize( - 0, mg_dof.get_triangulation().n_global_levels() - 1); + ghosted_level_vector.resize(0, + mg_dof.get_triangulation().n_global_levels() - + 1); std::vector level_index_set( mg_dof.get_triangulation().n_global_levels()); for (unsigned int l = 0; l < mg_dof.get_triangulation().n_global_levels(); @@ -231,8 +232,9 @@ namespace std::sort(accessed_indices.begin(), accessed_indices.end()); index_set.add_indices(accessed_indices.begin(), accessed_indices.end()); index_set.compress(); - ghosted_global_vector.reinit( - mg_dof.locally_owned_dofs(), index_set, mpi_communicator); + ghosted_global_vector.reinit(mg_dof.locally_owned_dofs(), + index_set, + mpi_communicator); // localize the copy indices for faster access. Since all access will be // through the ghosted vector in 'data', we can use this (much faster) @@ -344,10 +346,12 @@ MGLevelGlobalTransfer>:: // now do a global reduction over all processors to see what operation // they can agree upon - perform_plain_copy = Utilities::MPI::min( - static_cast(my_perform_plain_copy), mpi_communicator); - perform_renumbered_plain_copy = Utilities::MPI::min( - static_cast(my_perform_renumbered_plain_copy), mpi_communicator); + perform_plain_copy = + Utilities::MPI::min(static_cast(my_perform_plain_copy), + mpi_communicator); + perform_renumbered_plain_copy = + Utilities::MPI::min(static_cast(my_perform_renumbered_plain_copy), + mpi_communicator); // if we do a plain copy, no need to hold additional ghosted vectors if (perform_renumbered_plain_copy) diff --git a/source/multigrid/mg_tools.cc b/source/multigrid/mg_tools.cc index e8703c6635..e686c79c6d 100644 --- a/source/multigrid/mg_tools.cc +++ b/source/multigrid/mg_tools.cc @@ -341,12 +341,12 @@ namespace MGTools ExcDimensionMismatch(couplings.n_rows(), fe.n_components())); Assert(couplings.n_cols() == fe.n_components(), ExcDimensionMismatch(couplings.n_cols(), fe.n_components())); - Assert( - flux_couplings.n_rows() == fe.n_components(), - ExcDimensionMismatch(flux_couplings.n_rows(), fe.n_components())); - Assert( - flux_couplings.n_cols() == fe.n_components(), - ExcDimensionMismatch(flux_couplings.n_cols(), fe.n_components())); + Assert(flux_couplings.n_rows() == fe.n_components(), + ExcDimensionMismatch(flux_couplings.n_rows(), + fe.n_components())); + Assert(flux_couplings.n_cols() == fe.n_components(), + ExcDimensionMismatch(flux_couplings.n_cols(), + fe.n_components())); cell_indices.resize(fe.dofs_per_cell); cell->get_mg_dof_indices(cell_indices); @@ -1241,8 +1241,10 @@ namespace MGTools // next count what we got for (unsigned int block = 0; block < fe.n_blocks(); ++block) - dofs_per_block[l][target_block[block]] += std::count( - dofs_in_block[block].begin(), dofs_in_block[block].end(), true); + dofs_per_block[l][target_block[block]] += + std::count(dofs_in_block[block].begin(), + dofs_in_block[block].end(), + true); } } @@ -1485,8 +1487,9 @@ namespace MGTools continue; std::fill(cell_dofs.begin(), cell_dofs.end(), false); - std::fill( - cell_dofs_interface.begin(), cell_dofs_interface.end(), false); + std::fill(cell_dofs_interface.begin(), + cell_dofs_interface.end(), + false); for (unsigned int face_nr = 0; face_nr < GeometryInfo::faces_per_cell; diff --git a/source/multigrid/mg_transfer_block.inst.in b/source/multigrid/mg_transfer_block.inst.in index 1bd6145c58..9dad5779ed 100644 --- a/source/multigrid/mg_transfer_block.inst.in +++ b/source/multigrid/mg_transfer_block.inst.in @@ -27,17 +27,15 @@ for (deal_II_dimension : DIMENSIONS) const DoFHandler &, const std::vector &); - template void - MGTransferBlockSelect::build_matrices( - const DoFHandler &, - const DoFHandler &, - const unsigned int); + template void MGTransferBlockSelect::build_matrices< + deal_II_dimension>(const DoFHandler &, + const DoFHandler &, + const unsigned int); - template void - MGTransferBlockSelect::build_matrices( - const DoFHandler &, - const DoFHandler &, - const unsigned int); + template void MGTransferBlockSelect::build_matrices< + deal_II_dimension>(const DoFHandler &, + const DoFHandler &, + const unsigned int); template void MGTransferBlock::copy_to_mg( const DoFHandler &, diff --git a/source/multigrid/mg_transfer_component.cc b/source/multigrid/mg_transfer_component.cc index d45b9ee51a..015355c836 100644 --- a/source/multigrid/mg_transfer_component.cc +++ b/source/multigrid/mg_transfer_component.cc @@ -508,8 +508,9 @@ MGTransferComponentBase::build_matrices(const DoFHandler &, mg_dof.get_triangulation().n_levels(), std::vector(n_components)); - MGTools::count_dofs_per_block( - mg_dof, dofs_per_component, mg_target_component); + MGTools::count_dofs_per_block(mg_dof, + dofs_per_component, + mg_target_component); for (unsigned int level = 0; level < n_levels - 1; ++level) { if (boundary_indices[level].size() == 0) diff --git a/source/multigrid/mg_transfer_internal.cc b/source/multigrid/mg_transfer_internal.cc index df9ad617ae..6388af60ae 100644 --- a/source/multigrid/mg_transfer_internal.cc +++ b/source/multigrid/mg_transfer_internal.cc @@ -41,16 +41,16 @@ namespace internal DoFPair(const unsigned int level, const types::global_dof_index global_dof_index, - const types::global_dof_index level_dof_index) : - level(level), - global_dof_index(global_dof_index), - level_dof_index(level_dof_index) + const types::global_dof_index level_dof_index) + : level(level) + , global_dof_index(global_dof_index) + , level_dof_index(level_dof_index) {} - DoFPair() : - level(numbers::invalid_unsigned_int), - global_dof_index(numbers::invalid_dof_index), - level_dof_index(numbers::invalid_dof_index) + DoFPair() + : level(numbers::invalid_unsigned_int) + , global_dof_index(numbers::invalid_dof_index) + , level_dof_index(numbers::invalid_dof_index) {} }; @@ -157,8 +157,9 @@ namespace internal global_dof_indices[i], level_dof_indices[i]); // send this to the owner of the level_dof: - send_data_temp.emplace_back( - level, global_dof_indices[i], level_dof_indices[i]); + send_data_temp.emplace_back(level, + global_dof_indices[i], + level_dof_indices[i]); } else { @@ -262,8 +263,10 @@ namespace internal { MPI_Status status; int len; - int ierr = MPI_Probe( - MPI_ANY_SOURCE, 71, tria->get_communicator(), &status); + int ierr = MPI_Probe(MPI_ANY_SOURCE, + 71, + tria->get_communicator(), + &status); AssertThrowMPI(ierr); ierr = MPI_Get_count(&status, MPI_BYTE, &len); AssertThrowMPI(ierr); @@ -308,8 +311,9 @@ namespace internal // * wait for all MPI_Isend to complete if (requests.size() > 0) { - const int ierr = MPI_Waitall( - requests.size(), requests.data(), MPI_STATUSES_IGNORE); + const int ierr = MPI_Waitall(requests.size(), + requests.data(), + MPI_STATUSES_IGNORE); AssertThrowMPI(ierr); requests.clear(); } @@ -329,8 +333,9 @@ namespace internal std::less> compare; for (unsigned int level = 0; level < copy_indices.size(); ++level) - std::sort( - copy_indices[level].begin(), copy_indices[level].end(), compare); + std::sort(copy_indices[level].begin(), + copy_indices[level].end(), + compare); for (unsigned int level = 0; level < copy_indices_level_mine.size(); ++level) std::sort(copy_indices_level_mine[level].begin(), @@ -359,9 +364,9 @@ namespace internal { std::sort(ghosted_level_dofs.begin(), ghosted_level_dofs.end()); IndexSet ghosted_dofs(locally_owned.size()); - ghosted_dofs.add_indices( - ghosted_level_dofs.begin(), - std::unique(ghosted_level_dofs.begin(), ghosted_level_dofs.end())); + ghosted_dofs.add_indices(ghosted_level_dofs.begin(), + std::unique(ghosted_level_dofs.begin(), + ghosted_level_dofs.end())); ghosted_dofs.compress(); // Add possible ghosts from the previous content in the vector diff --git a/source/multigrid/mg_transfer_matrix_free.cc b/source/multigrid/mg_transfer_matrix_free.cc index 0e1a04ba11..ff573648ca 100644 --- a/source/multigrid/mg_transfer_matrix_free.cc +++ b/source/multigrid/mg_transfer_matrix_free.cc @@ -40,22 +40,22 @@ DEAL_II_NAMESPACE_OPEN template -MGTransferMatrixFree::MGTransferMatrixFree() : - fe_degree(0), - element_is_continuous(false), - n_components(0), - n_child_cell_dofs(0) +MGTransferMatrixFree::MGTransferMatrixFree() + : fe_degree(0) + , element_is_continuous(false) + , n_components(0) + , n_child_cell_dofs(0) {} template MGTransferMatrixFree::MGTransferMatrixFree( - const MGConstrainedDoFs &mg_c) : - fe_degree(0), - element_is_continuous(false), - n_components(0), - n_child_cell_dofs(0) + const MGConstrainedDoFs &mg_c) + : fe_degree(0) + , element_is_continuous(false) + , n_components(0) + , n_child_cell_dofs(0) { this->mg_constrained_dofs = &mg_c; } @@ -599,8 +599,8 @@ MGTransferMatrixFree::memory_consumption() const template MGTransferBlockMatrixFree::MGTransferBlockMatrixFree( - const MGConstrainedDoFs &mg_c) : - same_for_all(true) + const MGConstrainedDoFs &mg_c) + : same_for_all(true) { matrix_free_transfer_vector.emplace_back(mg_c); } @@ -609,8 +609,8 @@ MGTransferBlockMatrixFree::MGTransferBlockMatrixFree( template MGTransferBlockMatrixFree::MGTransferBlockMatrixFree( - const std::vector &mg_c) : - same_for_all(false) + const std::vector &mg_c) + : same_for_all(false) { for (unsigned int i = 0; i < mg_c.size(); ++i) matrix_free_transfer_vector.emplace_back(mg_c[i]); @@ -700,8 +700,9 @@ MGTransferBlockMatrixFree::prolongate( for (unsigned int b = 0; b < n_blocks; ++b) { const unsigned int data_block = same_for_all ? 0 : b; - matrix_free_transfer_vector[data_block].prolongate( - to_level, dst.block(b), src.block(b)); + matrix_free_transfer_vector[data_block].prolongate(to_level, + dst.block(b), + src.block(b)); } } @@ -723,8 +724,9 @@ MGTransferBlockMatrixFree::restrict_and_add( for (unsigned int b = 0; b < n_blocks; ++b) { const unsigned int data_block = same_for_all ? 0 : b; - matrix_free_transfer_vector[data_block].restrict_and_add( - from_level, dst.block(b), src.block(b)); + matrix_free_transfer_vector[data_block].restrict_and_add(from_level, + dst.block(b), + src.block(b)); } } diff --git a/source/multigrid/mg_transfer_prebuilt.cc b/source/multigrid/mg_transfer_prebuilt.cc index 70060ee393..7a56e84a47 100644 --- a/source/multigrid/mg_transfer_prebuilt.cc +++ b/source/multigrid/mg_transfer_prebuilt.cc @@ -213,10 +213,12 @@ MGTransferPrebuilt::build_matrices( // increment dofs_per_cell since a useless diagonal element will be // stored IndexSet level_p1_relevant_dofs; - DoFTools::extract_locally_relevant_level_dofs( - mg_dof, level + 1, level_p1_relevant_dofs); - DynamicSparsityPattern dsp( - this->sizes[level + 1], this->sizes[level], level_p1_relevant_dofs); + DoFTools::extract_locally_relevant_level_dofs(mg_dof, + level + 1, + level_p1_relevant_dofs); + DynamicSparsityPattern dsp(this->sizes[level + 1], + this->sizes[level], + level_p1_relevant_dofs); typename DoFHandler::cell_iterator cell, endc = mg_dof.end(level); for (cell = mg_dof.begin(level); cell != endc; ++cell) if (cell->has_children() && @@ -243,8 +245,9 @@ MGTransferPrebuilt::build_matrices( cell->child(child)->get_mg_dof_indices(dof_indices_child); - replace( - this->mg_constrained_dofs, level + 1, dof_indices_child); + replace(this->mg_constrained_dofs, + level + 1, + dof_indices_child); // now tag the entries in the // matrix which will be used @@ -255,8 +258,9 @@ MGTransferPrebuilt::build_matrices( for (unsigned int j = 0; j < dofs_per_cell; ++j) if (prolongation(i, j) != 0) entries.push_back(dof_indices_parent[j]); - dsp.add_entries( - dof_indices_child[i], entries.begin(), entries.end()); + dsp.add_entries(dof_indices_child[i], + entries.begin(), + entries.end()); } } } @@ -352,8 +356,9 @@ MGTransferPrebuilt::build_matrices( cell->child(child)->get_mg_dof_indices(dof_indices_child); - replace( - this->mg_constrained_dofs, level + 1, dof_indices_child); + replace(this->mg_constrained_dofs, + level + 1, + dof_indices_child); // now set the entries in the matrix for (unsigned int i = 0; i < dofs_per_cell; ++i) diff --git a/source/multigrid/multigrid.cc b/source/multigrid/multigrid.cc index 92c5d06433..e98d0da437 100644 --- a/source/multigrid/multigrid.cc +++ b/source/multigrid/multigrid.cc @@ -36,29 +36,30 @@ DEAL_II_NAMESPACE_OPEN -MGTransferBlockBase::MGTransferBlockBase() : n_mg_blocks(0) +MGTransferBlockBase::MGTransferBlockBase() + : n_mg_blocks(0) {} -MGTransferBlockBase::MGTransferBlockBase(const MGConstrainedDoFs &mg_c) : - n_mg_blocks(0), - mg_constrained_dofs(&mg_c) +MGTransferBlockBase::MGTransferBlockBase(const MGConstrainedDoFs &mg_c) + : n_mg_blocks(0) + , mg_constrained_dofs(&mg_c) {} MGTransferBlockBase::MGTransferBlockBase( const AffineConstraints & /*c*/, - const MGConstrainedDoFs &mg_c) : - n_mg_blocks(0), - mg_constrained_dofs(&mg_c) + const MGConstrainedDoFs &mg_c) + : n_mg_blocks(0) + , mg_constrained_dofs(&mg_c) {} template -MGTransferBlock::MGTransferBlock() : - memory(nullptr, typeid(*this).name()) +MGTransferBlock::MGTransferBlock() + : memory(nullptr, typeid(*this).name()) {} @@ -194,17 +195,17 @@ MGTransferBlockBase::memory_consumption() const //----------------------------------------------------------------------// template -MGTransferSelect::MGTransferSelect() : - selected_component(0), - mg_selected_component(0) +MGTransferSelect::MGTransferSelect() + : selected_component(0) + , mg_selected_component(0) {} template -MGTransferSelect::MGTransferSelect(const AffineConstraints &c) : - selected_component(0), - mg_selected_component(0), - constraints(&c) +MGTransferSelect::MGTransferSelect(const AffineConstraints &c) + : selected_component(0) + , mg_selected_component(0) + , constraints(&c) {} @@ -245,16 +246,17 @@ MGTransferSelect::restrict_and_add(const unsigned int from_level, //----------------------------------------------------------------------// template -MGTransferBlockSelect::MGTransferBlockSelect() : selected_block(0) +MGTransferBlockSelect::MGTransferBlockSelect() + : selected_block(0) {} template MGTransferBlockSelect::MGTransferBlockSelect( - const MGConstrainedDoFs &mg_c) : - MGTransferBlockBase(mg_c), - selected_block(0) + const MGConstrainedDoFs &mg_c) + : MGTransferBlockBase(mg_c) + , selected_block(0) {} @@ -262,9 +264,9 @@ MGTransferBlockSelect::MGTransferBlockSelect( template MGTransferBlockSelect::MGTransferBlockSelect( const AffineConstraints & /*c*/, - const MGConstrainedDoFs &mg_c) : - MGTransferBlockBase(mg_c), - selected_block(0) + const MGConstrainedDoFs &mg_c) + : MGTransferBlockBase(mg_c) + , selected_block(0) {} diff --git a/source/non_matching/coupling.cc b/source/non_matching/coupling.cc index 4d5be8085e..23f520c464 100644 --- a/source/non_matching/coupling.cc +++ b/source/non_matching/coupling.cc @@ -110,8 +110,10 @@ namespace NonMatching std::vector dofs(immersed_fe.dofs_per_cell); std::vector odofs(space_fe.dofs_per_cell); - FEValues fe_v( - immersed_mapping, immersed_fe, quad, update_quadrature_points); + FEValues fe_v(immersed_mapping, + immersed_fe, + quad, + update_quadrature_points); // Take care of components const ComponentMask space_c = @@ -315,8 +317,10 @@ namespace NonMatching const std::vector> & qps = qpoints[c]; const std::vector &ids = maps[c]; - FEValues o_fe_v( - cache.get_mapping(), space_dh.get_fe(), qps, update_values); + FEValues o_fe_v(cache.get_mapping(), + space_dh.get_fe(), + qps, + update_values); o_fe_v.reinit(ocell); ocell->get_dof_indices(odofs); @@ -352,8 +356,10 @@ namespace NonMatching } // Now assemble the matrices - constraints.distribute_local_to_global( - cell_matrix, odofs, dofs, matrix); + constraints.distribute_local_to_global(cell_matrix, + odofs, + dofs, + matrix); } } } diff --git a/source/non_matching/immersed_surface_quadrature.cc b/source/non_matching/immersed_surface_quadrature.cc index c1b363fc61..99ec807ef4 100644 --- a/source/non_matching/immersed_surface_quadrature.cc +++ b/source/non_matching/immersed_surface_quadrature.cc @@ -22,9 +22,9 @@ namespace NonMatching ImmersedSurfaceQuadrature::ImmersedSurfaceQuadrature( const std::vector> & points, const std::vector & weights, - const std::vector> &normals) : - Quadrature(points, weights), - normals(normals) + const std::vector> &normals) + : Quadrature(points, weights) + , normals(normals) { AssertDimension(weights.size(), points.size()); AssertDimension(normals.size(), points.size()); diff --git a/source/numerics/data_out.cc b/source/numerics/data_out.cc index 3ac3ed186d..03fe3202bf 100644 --- a/source/numerics/data_out.cc +++ b/source/numerics/data_out.cc @@ -50,15 +50,15 @@ namespace internal std::shared_ptr>> & finite_elements, const UpdateFlags update_flags, - const std::vector> &cell_to_patch_index_map) : - ParallelDataBase(n_datasets, - n_subdivisions, - n_postprocessor_outputs, - mapping, - finite_elements, - update_flags, - false), - cell_to_patch_index_map(&cell_to_patch_index_map) + const std::vector> &cell_to_patch_index_map) + : ParallelDataBase(n_datasets, + n_subdivisions, + n_postprocessor_outputs, + mapping, + finite_elements, + update_flags, + false) + , cell_to_patch_index_map(&cell_to_patch_index_map) {} } // namespace DataOutImplementation } // namespace internal @@ -127,8 +127,9 @@ DataOut::build_one_patch( const std::vector> &q_points = fe_patch_values.get_quadrature_points(); - patch.data.reinit( - scratch_data.n_datasets + DoFHandlerType::space_dimension, n_q_points); + patch.data.reinit(scratch_data.n_datasets + + DoFHandlerType::space_dimension, + n_q_points); for (unsigned int i = 0; i < DoFHandlerType::space_dimension; ++i) for (unsigned int q = 0; q < n_q_points; ++q) patch.data(patch.data.size(0) - DoFHandlerType::space_dimension + i, diff --git a/source/numerics/data_out_faces.cc b/source/numerics/data_out_faces.cc index dec9e06639..89d173bc78 100644 --- a/source/numerics/data_out_faces.cc +++ b/source/numerics/data_out_faces.cc @@ -49,15 +49,15 @@ namespace internal const std::vector< std::shared_ptr>> & finite_elements, - const UpdateFlags update_flags) : - internal::DataOutImplementation::ParallelDataBase( - n_datasets, - n_subdivisions, - n_postprocessor_outputs, - mapping, - finite_elements, - update_flags, - true) + const UpdateFlags update_flags) + : internal::DataOutImplementation::ParallelDataBase( + n_datasets, + n_subdivisions, + n_postprocessor_outputs, + mapping, + finite_elements, + update_flags, + true) {} @@ -81,8 +81,8 @@ namespace internal template -DataOutFaces::DataOutFaces(const bool so) : - surface_only(so) +DataOutFaces::DataOutFaces(const bool so) + : surface_only(so) { Assert(dim == DoFHandlerType::dimension, ExcNotImplemented()); } @@ -119,8 +119,9 @@ DataOutFaces::build_one_patch( if (data.n_datasets > 0) { - data.reinit_all_fe_values( - this->dof_data, cell_and_face->first, cell_and_face->second); + data.reinit_all_fe_values(this->dof_data, + cell_and_face->first, + cell_and_face->second); const FEValuesBase &fe_patch_values = data.get_present_fe_values(0); diff --git a/source/numerics/data_out_rotation.cc b/source/numerics/data_out_rotation.cc index 89f246ebb5..fc8815f3ee 100644 --- a/source/numerics/data_out_rotation.cc +++ b/source/numerics/data_out_rotation.cc @@ -63,16 +63,16 @@ namespace internal const std::vector< std::shared_ptr>> & finite_elements, - const UpdateFlags update_flags) : - internal::DataOutImplementation::ParallelDataBase( - n_datasets, - n_subdivisions, - n_postprocessor_outputs, - mapping, - finite_elements, - update_flags, - false), - n_patches_per_circle(n_patches_per_circle) + const UpdateFlags update_flags) + : internal::DataOutImplementation::ParallelDataBase( + n_datasets, + n_subdivisions, + n_postprocessor_outputs, + mapping, + finite_elements, + update_flags, + false) + , n_patches_per_circle(n_patches_per_circle) {} @@ -389,12 +389,13 @@ DataOutRotation::build_one_patch( 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) - my_patches[angle].data( - offset + component, - x * n_points * n_points + y * n_points + - z) = data.patch_values_system - .solution_values[x * n_points + z]( - component); + my_patches[angle].data(offset + component, + x * n_points * + n_points + + y * n_points + z) = + data.patch_values_system + .solution_values[x * n_points + z]( + component); break; default: diff --git a/source/numerics/data_out_stack.cc b/source/numerics/data_out_stack.cc index 6f75bd1748..2f56b7fa3f 100644 --- a/source/numerics/data_out_stack.cc +++ b/source/numerics/data_out_stack.cc @@ -305,8 +305,9 @@ DataOutStack::build_patches( const hp::QCollection q_collection(patch_points); const hp::FECollection &fe_collection = dof_handler->get_fe_collection(); - hp::FEValues x_fe_patch_values( - fe_collection, q_collection, update_values); + hp::FEValues x_fe_patch_values(fe_collection, + q_collection, + update_values); const unsigned int n_q_points = patch_points.size(); std::vector patch_values(n_q_points); diff --git a/source/numerics/data_postprocessor.cc b/source/numerics/data_postprocessor.cc index fcd5e9e6ed..2ea9842ff1 100644 --- a/source/numerics/data_postprocessor.cc +++ b/source/numerics/data_postprocessor.cc @@ -59,9 +59,9 @@ DataPostprocessor::get_data_component_interpretation() const template DataPostprocessorScalar::DataPostprocessorScalar( const std::string &name, - const UpdateFlags update_flags) : - name(name), - update_flags(update_flags) + const UpdateFlags update_flags) + : name(name) + , update_flags(update_flags) {} @@ -98,9 +98,9 @@ DataPostprocessorScalar::get_needed_update_flags() const template DataPostprocessorVector::DataPostprocessorVector( const std::string &name, - const UpdateFlags update_flags) : - name(name), - update_flags(update_flags) + const UpdateFlags update_flags) + : name(name) + , update_flags(update_flags) {} @@ -137,9 +137,9 @@ DataPostprocessorVector::get_needed_update_flags() const template DataPostprocessorTensor::DataPostprocessorTensor( const std::string &name, - const UpdateFlags update_flags) : - name(name), - update_flags(update_flags) + const UpdateFlags update_flags) + : name(name) + , update_flags(update_flags) {} diff --git a/source/numerics/derivative_approximation.cc b/source/numerics/derivative_approximation.cc index 0cfb9a4295..a65f52d7d3 100644 --- a/source/numerics/derivative_approximation.cc +++ b/source/numerics/derivative_approximation.cc @@ -800,8 +800,10 @@ namespace DerivativeApproximation // ...and get the value of the // projected derivative... const typename DerivativeDescription::ProjectedDerivative - this_midpoint_value = DerivativeDescription::get_projected_derivative( - fe_midpoint_value, solution, component); + this_midpoint_value = + DerivativeDescription::get_projected_derivative(fe_midpoint_value, + solution, + component); // ...and the place where it lives const Point this_center = fe_midpoint_value.quadrature_point(0); diff --git a/source/numerics/error_estimator_1d.cc b/source/numerics/error_estimator_1d.cc index eafc53b772..fdf20c7ef0 100644 --- a/source/numerics/error_estimator_1d.cc +++ b/source/numerics/error_estimator_1d.cc @@ -308,15 +308,16 @@ KellyErrorEstimator<1, spacedim>::estimate( #ifdef DEAL_II_WITH_P4EST if (dynamic_cast *>( &dof_handler.get_triangulation()) != nullptr) - Assert( - (subdomain_id_ == numbers::invalid_subdomain_id) || - (subdomain_id_ == - dynamic_cast - &>(dof_handler.get_triangulation()) - .locally_owned_subdomain()), - ExcMessage("For parallel distributed triangulations, the only " - "valid subdomain_id that can be passed here is the " - "one that corresponds to the locally owned subdomain id.")); + Assert((subdomain_id_ == numbers::invalid_subdomain_id) || + (subdomain_id_ == + dynamic_cast< + const parallel::distributed::Triangulation<1, spacedim> &>( + dof_handler.get_triangulation()) + .locally_owned_subdomain()), + ExcMessage( + "For parallel distributed triangulations, the only " + "valid subdomain_id that can be passed here is the " + "one that corresponds to the locally owned subdomain id.")); const types::subdomain_id subdomain_id = ((dynamic_cast *>( @@ -344,8 +345,9 @@ KellyErrorEstimator<1, spacedim>::estimate( i != neumann_bc.end(); ++i) Assert(i->second->n_components == n_components, - ExcInvalidBoundaryFunction( - i->first, i->second->n_components, n_components)); + ExcInvalidBoundaryFunction(i->first, + i->second->n_components, + n_components)); Assert(component_mask.represents_n_components(n_components), ExcInvalidComponentMask()); @@ -374,8 +376,9 @@ KellyErrorEstimator<1, spacedim>::estimate( i != neumann_bc.end(); ++i) Assert(i->second->n_components == n_components, - ExcInvalidBoundaryFunction( - i->first, i->second->n_components, n_components)); + ExcInvalidBoundaryFunction(i->first, + i->second->n_components, + n_components)); // reserve one slot for each cell and set it to zero for (unsigned int n = 0; n < n_solution_vectors; ++n) @@ -386,16 +389,16 @@ KellyErrorEstimator<1, spacedim>::estimate( // for the neighbor gradient, we need several auxiliary fields, depending on // the way we get it (see below) std::vector>>> - gradients_here( - n_solution_vectors, - std::vector>>( - 2, std::vector>(n_components))); + gradients_here(n_solution_vectors, + std::vector>>( + 2, + std::vector>(n_components))); std::vector>>> gradients_neighbor(gradients_here); std::vector::type>> - grad_dot_n_neighbor( - n_solution_vectors, - Vector::type>(n_components)); + grad_dot_n_neighbor(n_solution_vectors, + Vector::type>( + n_components)); // reserve some space for coefficient values at one point. if there is no // coefficient, then we fill it by unity once and for all and don't set it @@ -415,8 +418,10 @@ KellyErrorEstimator<1, spacedim>::estimate( hp::MappingCollection<1, spacedim> mapping_collection; mapping_collection.push_back(mapping); - hp::FEValues<1, spacedim> fe_values( - mapping_collection, fe, q_collection, update_gradients); + hp::FEValues<1, spacedim> fe_values(mapping_collection, + fe, + q_collection, + update_gradients); hp::FEFaceValues<1, spacedim> fe_face_values( /*mapping_collection,*/ fe, q_face_collection, update_normal_vectors); diff --git a/source/numerics/histogram.cc b/source/numerics/histogram.cc index f42421f802..d543657f39 100644 --- a/source/numerics/histogram.cc +++ b/source/numerics/histogram.cc @@ -35,11 +35,10 @@ Histogram::logarithmic_less(const number n1, const number n2) -Histogram::Interval::Interval(const double left_point, - const double right_point) : - left_point(left_point), - right_point(right_point), - content(0) +Histogram::Interval::Interval(const double left_point, const double right_point) + : left_point(left_point) + , right_point(right_point) + , content(0) {} @@ -59,9 +58,9 @@ Histogram::evaluate(const std::vector> &values, const unsigned int n_intervals, const IntervalSpacing interval_spacing) { - Assert( - values.size() > 0, - ExcMessage("Your input data needs to contain at least one input vector.")); + Assert(values.size() > 0, + ExcMessage( + "Your input data needs to contain at least one input vector.")); Assert(n_intervals > 0, ExcMessage("The number of intervals needs to be at least one.")); for (unsigned int i = 0; i < values.size(); ++i) @@ -101,11 +100,13 @@ Histogram::evaluate(const std::vector> &values, const comparator logarithmic_less_function = &Histogram::template logarithmic_less; - min_value = *std::min_element( - values[0].begin(), values[0].end(), logarithmic_less_function); + min_value = *std::min_element(values[0].begin(), + values[0].end(), + logarithmic_less_function); - max_value = *std::max_element( - values[0].begin(), values[0].end(), logarithmic_less_function); + max_value = *std::max_element(values[0].begin(), + values[0].end(), + logarithmic_less_function); for (unsigned int i = 1; i < values.size(); ++i) { @@ -167,9 +168,9 @@ Histogram::evaluate(const std::vector> &values, (std::log(max_value) - std::log(min_value)) / n_intervals; for (unsigned int n = 0; n < n_intervals; ++n) - intervals[0].emplace_back( - std::exp(std::log(min_value) + n * delta), - std::exp(std::log(min_value) + (n + 1) * delta)); + intervals[0].emplace_back(std::exp(std::log(min_value) + n * delta), + std::exp(std::log(min_value) + + (n + 1) * delta)); break; }; @@ -213,8 +214,10 @@ Histogram::evaluate(const Vector &values, const IntervalSpacing interval_spacing) { std::vector> values_list(1, values); - evaluate( - values_list, std::vector(1, 0.), n_intervals, interval_spacing); + evaluate(values_list, + std::vector(1, 0.), + n_intervals, + interval_spacing); } diff --git a/source/numerics/kdtree.cc b/source/numerics/kdtree.cc index b9401cfb49..45b23a4fd6 100644 --- a/source/numerics/kdtree.cc +++ b/source/numerics/kdtree.cc @@ -9,8 +9,8 @@ DEAL_II_NAMESPACE_OPEN template KDTree::KDTree(const unsigned int & max_leaf_size, - const std::vector> &pts) : - max_leaf_size(max_leaf_size) + const std::vector> &pts) + : max_leaf_size(max_leaf_size) { if (pts.size() > 0) set_points(pts); diff --git a/source/numerics/matrix_tools.cc b/source/numerics/matrix_tools.cc index 8059aa8c94..556d6825b8 100644 --- a/source/numerics/matrix_tools.cc +++ b/source/numerics/matrix_tools.cc @@ -199,8 +199,10 @@ namespace MatrixTools const unsigned int column) = &column_less_than::iterator>; const typename SparseMatrix::iterator p = - Utilities::lower_bound( - matrix.begin(row) + 1, matrix.end(row), dof_number, comp); + Utilities::lower_bound(matrix.begin(row) + 1, + matrix.end(row), + dof_number, + comp); // check whether this line has an entry in the // regarding column (check for ==dof_number and != diff --git a/source/numerics/point_value_history.cc b/source/numerics/point_value_history.cc index 60fdd8fae5..2c2cd70a1b 100644 --- a/source/numerics/point_value_history.cc +++ b/source/numerics/point_value_history.cc @@ -56,8 +56,8 @@ namespace internal template PointValueHistory::PointValueHistory( - const unsigned int n_independent_variables) : - n_indep(n_independent_variables) + const unsigned int n_independent_variables) + : n_indep(n_independent_variables) { closed = false; cleared = false; @@ -78,9 +78,9 @@ PointValueHistory::PointValueHistory( template PointValueHistory::PointValueHistory( const DoFHandler &dof_handler, - const unsigned int n_independent_variables) : - dof_handler(&dof_handler), - n_indep(n_independent_variables) + const unsigned int n_independent_variables) + : dof_handler(&dof_handler) + , n_indep(n_independent_variables) { closed = false; cleared = false; @@ -127,8 +127,9 @@ PointValueHistory::PointValueHistory( if (have_dof_handler) { tria_listener = - dof_handler->get_triangulation().signals.any_change.connect(std::bind( - &PointValueHistory::tria_change_listener, std::ref(*this))); + dof_handler->get_triangulation().signals.any_change.connect( + std::bind(&PointValueHistory::tria_change_listener, + std::ref(*this))); } } @@ -160,8 +161,9 @@ PointValueHistory::operator=(const PointValueHistory &point_value_history) if (have_dof_handler) { tria_listener = - dof_handler->get_triangulation().signals.any_change.connect(std::bind( - &PointValueHistory::tria_change_listener, std::ref(*this))); + dof_handler->get_triangulation().signals.any_change.connect( + std::bind(&PointValueHistory::tria_change_listener, + std::ref(*this))); } return *this; @@ -202,9 +204,10 @@ PointValueHistory::add_point(const Point &location) // FE. Quadrature support_point_quadrature( dof_handler->get_fe().get_unit_support_points()); - FEValues fe_values( - dof_handler->get_fe(), support_point_quadrature, update_quadrature_points); - unsigned int n_support_points = + FEValues fe_values(dof_handler->get_fe(), + support_point_quadrature, + update_quadrature_points); + unsigned int n_support_points = dof_handler->get_fe().get_unit_support_points().size(); unsigned int n_components = dof_handler->get_fe(0).n_components(); @@ -346,9 +349,10 @@ PointValueHistory::add_points(const std::vector> &locations) // FE. Quadrature support_point_quadrature( dof_handler->get_fe().get_unit_support_points()); - FEValues fe_values( - dof_handler->get_fe(), support_point_quadrature, update_quadrature_points); - unsigned int n_support_points = + FEValues fe_values(dof_handler->get_fe(), + support_point_quadrature, + update_quadrature_points); + unsigned int n_support_points = dof_handler->get_fe().get_unit_support_points().size(); unsigned int n_components = dof_handler->get_fe(0).n_components(); @@ -436,8 +440,9 @@ PointValueHistory::add_points(const std::vector> &locations) } internal::PointValueHistoryImplementation::PointGeometryData - new_point_geometry_data( - locations[point], current_points[point], new_solution_indices); + new_point_geometry_data(locations[point], + current_points[point], + new_solution_indices); point_geometry_data.push_back(new_point_geometry_data); @@ -636,8 +641,9 @@ PointValueHistory::evaluate_field(const std::string &vector_name, unsigned int solution_index = point->solution_indices[comp]; data_store_field ->second[data_store_index * n_stored + store_index] - .push_back(internal::ElementAccess::get( - solution, solution_index)); + .push_back( + internal::ElementAccess::get(solution, + solution_index)); store_index++; } } @@ -717,8 +723,9 @@ PointValueHistory::evaluate_field( // we now have a point to query, need to know what cell it is in const Point requested_location = point->requested_location; const typename DoFHandler::active_cell_iterator cell = - GridTools::find_active_cell_around_point( - StaticMappingQ1::mapping, *dof_handler, requested_location) + GridTools::find_active_cell_around_point(StaticMappingQ1::mapping, + *dof_handler, + requested_location) .first; @@ -936,8 +943,10 @@ PointValueHistory::evaluate_field_at_requested_location( // Make a Vector for the value // at the point. It will have as many // components as there are in the fe. - VectorTools::point_value( - *dof_handler, solution, point->requested_location, value); + VectorTools::point_value(*dof_handler, + solution, + point->requested_location, + value); // Look up the component_mask and add // in components according to that mask @@ -1276,8 +1285,9 @@ PointValueHistory::get_postprocessor_locations( locations = std::vector>(); - FEValues fe_values( - dof_handler->get_fe(), quadrature, update_quadrature_points); + FEValues fe_values(dof_handler->get_fe(), + quadrature, + update_quadrature_points); unsigned int n_quadrature_points = quadrature.size(); std::vector> evaluation_points; @@ -1292,8 +1302,9 @@ PointValueHistory::get_postprocessor_locations( // need to know what cell it is in Point requested_location = point->requested_location; typename DoFHandler::active_cell_iterator cell = - GridTools::find_active_cell_around_point( - StaticMappingQ1::mapping, *dof_handler, requested_location) + GridTools::find_active_cell_around_point(StaticMappingQ1::mapping, + *dof_handler, + requested_location) .first; fe_values.reinit(cell); diff --git a/source/numerics/solution_transfer.cc b/source/numerics/solution_transfer.cc index bb267dc34c..4acd75edb0 100644 --- a/source/numerics/solution_transfer.cc +++ b/source/numerics/solution_transfer.cc @@ -43,10 +43,10 @@ DEAL_II_NAMESPACE_OPEN template SolutionTransfer::SolutionTransfer( - const DoFHandlerType &dof) : - dof_handler(&dof, typeid(*this).name()), - n_dofs_old(0), - prepared_for(none) + const DoFHandlerType &dof) + : dof_handler(&dof, typeid(*this).name()) + , n_dofs_old(0) + , prepared_for(none) { Assert((dynamic_cast::refine_interpolate( for (unsigned int i = 0; i < dofs_per_cell; ++i) local_values(i) = internal::ElementAccess::get( in, (*pointerstruct->second.indices_ptr)[i]); - cell->set_dof_values_by_interpolation( - local_values, out, this_fe_index); + cell->set_dof_values_by_interpolation(local_values, + out, + this_fe_index); } } } @@ -405,8 +406,9 @@ SolutionTransfer:: // cell->get_interpolated_dof_values already does all of the // interpolations between spaces for (unsigned int j = 0; j < in_size; ++j) - cell->get_interpolated_dof_values( - all_in[j], dof_values_on_cell[n_cf][j], target_fe_index); + cell->get_interpolated_dof_values(all_in[j], + dof_values_on_cell[n_cf][j], + target_fe_index); cell_map[std::make_pair(cell->level(), cell->index())] = Pointerstruct(&dof_values_on_cell[n_cf], target_fe_index); ++n_cf; @@ -496,11 +498,13 @@ SolutionTransfer::interpolate( { tmp.reinit(in_size, true); for (unsigned int i = 0; i < in_size; ++i) - tmp(i) = internal::ElementAccess::get( - all_in[j], (*indexptr)[i]); + tmp(i) = + internal::ElementAccess::get(all_in[j], + (*indexptr)[i]); - cell->set_dof_values_by_interpolation( - tmp, all_out[j], old_fe_index); + cell->set_dof_values_by_interpolation(tmp, + all_out[j], + old_fe_index); } } else if (valuesptr) @@ -553,8 +557,9 @@ SolutionTransfer::interpolate( for (unsigned int i = 0; i < dofs_per_cell; ++i) - internal::ElementAccess::set( - (*data)(i), dofs[i], all_out[j]); + internal::ElementAccess::set((*data)(i), + dofs[i], + all_out[j]); } } // undefined status diff --git a/source/numerics/time_dependent.cc b/source/numerics/time_dependent.cc index 960786333d..ad5f8fecd4 100644 --- a/source/numerics/time_dependent.cc +++ b/source/numerics/time_dependent.cc @@ -33,21 +33,20 @@ DEAL_II_NAMESPACE_OPEN -TimeDependent::TimeSteppingData::TimeSteppingData( - const unsigned int look_ahead, - const unsigned int look_back) : - look_ahead(look_ahead), - look_back(look_back) +TimeDependent::TimeSteppingData::TimeSteppingData(const unsigned int look_ahead, + const unsigned int look_back) + : look_ahead(look_ahead) + , look_back(look_back) {} TimeDependent::TimeDependent(const TimeSteppingData &data_primal, const TimeSteppingData &data_dual, - const TimeSteppingData &data_postprocess) : - sweep_no(numbers::invalid_unsigned_int), - timestepping_data_primal(data_primal), - timestepping_data_dual(data_dual), - timestepping_data_postprocess(data_postprocess) + const TimeSteppingData &data_postprocess) + : sweep_no(numbers::invalid_unsigned_int) + , timestepping_data_primal(data_primal) + , timestepping_data_dual(data_dual) + , timestepping_data_postprocess(data_postprocess) {} @@ -170,33 +169,33 @@ TimeDependent::delete_timestep(const unsigned int position) void TimeDependent::solve_primal_problem() { - do_loop( - std::bind(&TimeStepBase::init_for_primal_problem, std::placeholders::_1), - std::bind(&TimeStepBase::solve_primal_problem, std::placeholders::_1), - timestepping_data_primal, - forward); + do_loop(std::bind(&TimeStepBase::init_for_primal_problem, + std::placeholders::_1), + std::bind(&TimeStepBase::solve_primal_problem, std::placeholders::_1), + timestepping_data_primal, + forward); } void TimeDependent::solve_dual_problem() { - do_loop( - std::bind(&TimeStepBase::init_for_dual_problem, std::placeholders::_1), - std::bind(&TimeStepBase::solve_dual_problem, std::placeholders::_1), - timestepping_data_dual, - backward); + do_loop(std::bind(&TimeStepBase::init_for_dual_problem, + std::placeholders::_1), + std::bind(&TimeStepBase::solve_dual_problem, std::placeholders::_1), + timestepping_data_dual, + backward); } void TimeDependent::postprocess() { - do_loop( - std::bind(&TimeStepBase::init_for_postprocessing, std::placeholders::_1), - std::bind(&TimeStepBase::postprocess_timestep, std::placeholders::_1), - timestepping_data_postprocess, - forward); + do_loop(std::bind(&TimeStepBase::init_for_postprocessing, + std::placeholders::_1), + std::bind(&TimeStepBase::postprocess_timestep, std::placeholders::_1), + timestepping_data_postprocess, + forward); } @@ -267,13 +266,13 @@ TimeDependent::memory_consumption() const /* --------------------------------------------------------------------- */ -TimeStepBase::TimeStepBase(const double time) : - previous_timestep(nullptr), - next_timestep(nullptr), - sweep_no(numbers::invalid_unsigned_int), - timestep_no(numbers::invalid_unsigned_int), - time(time), - next_action(numbers::invalid_unsigned_int) +TimeStepBase::TimeStepBase(const double time) + : previous_timestep(nullptr) + , next_timestep(nullptr) + , sweep_no(numbers::invalid_unsigned_int) + , timestep_no(numbers::invalid_unsigned_int) + , time(time) + , next_action(numbers::invalid_unsigned_int) {} @@ -422,12 +421,12 @@ TimeStepBase::memory_consumption() const template -TimeStepBase_Tria::TimeStepBase_Tria() : - TimeStepBase(0), - tria(nullptr, typeid(*this).name()), - coarse_grid(nullptr, typeid(*this).name()), - flags(), - refinement_flags(0) +TimeStepBase_Tria::TimeStepBase_Tria() + : TimeStepBase(0) + , tria(nullptr, typeid(*this).name()) + , coarse_grid(nullptr, typeid(*this).name()) + , flags() + , refinement_flags(0) { Assert(false, ExcPureFunctionCalled()); } @@ -439,12 +438,12 @@ TimeStepBase_Tria::TimeStepBase_Tria( const double time, const Triangulation &coarse_grid, const Flags & flags, - const RefinementFlags & refinement_flags) : - TimeStepBase(time), - tria(nullptr, typeid(*this).name()), - coarse_grid(&coarse_grid, typeid(*this).name()), - flags(flags), - refinement_flags(refinement_flags) + const RefinementFlags & refinement_flags) + : TimeStepBase(time) + , tria(nullptr, typeid(*this).name()) + , coarse_grid(&coarse_grid, typeid(*this).name()) + , flags(flags) + , refinement_flags(refinement_flags) {} @@ -1161,10 +1160,10 @@ TimeStepBase_Tria::memory_consumption() const template -TimeStepBase_Tria_Flags::Flags::Flags() : - delete_and_rebuild_tria(false), - wakeup_level_to_build_grid(0), - sleep_level_to_delete_grid(0) +TimeStepBase_Tria_Flags::Flags::Flags() + : delete_and_rebuild_tria(false) + , wakeup_level_to_build_grid(0) + , sleep_level_to_delete_grid(0) { Assert(false, ExcInternalError()); } @@ -1175,10 +1174,10 @@ template TimeStepBase_Tria_Flags::Flags::Flags( const bool delete_and_rebuild_tria, const unsigned int wakeup_level_to_build_grid, - const unsigned int sleep_level_to_delete_grid) : - delete_and_rebuild_tria(delete_and_rebuild_tria), - wakeup_level_to_build_grid(wakeup_level_to_build_grid), - sleep_level_to_delete_grid(sleep_level_to_delete_grid) + const unsigned int sleep_level_to_delete_grid) + : delete_and_rebuild_tria(delete_and_rebuild_tria) + , wakeup_level_to_build_grid(wakeup_level_to_build_grid) + , sleep_level_to_delete_grid(sleep_level_to_delete_grid) { // Assert (!delete_and_rebuild_tria || (wakeup_level_to_build_grid>=1), // ExcInvalidParameter(wakeup_level_to_build_grid)); @@ -1207,18 +1206,18 @@ TimeStepBase_Tria_Flags::RefinementFlags::RefinementFlags( const CorrectionRelaxations &correction_relaxations, const unsigned int cell_number_correction_steps, const bool mirror_flags_to_previous_grid, - const bool adapt_grids) : - max_refinement_level(max_refinement_level), - first_sweep_with_correction(first_sweep_with_correction), - min_cells_for_correction(min_cells_for_correction), - cell_number_corridor_top(cell_number_corridor_top), - cell_number_corridor_bottom(cell_number_corridor_bottom), - correction_relaxations(correction_relaxations.size() != 0 ? - correction_relaxations : - default_correction_relaxations), - cell_number_correction_steps(cell_number_correction_steps), - mirror_flags_to_previous_grid(mirror_flags_to_previous_grid), - adapt_grids(adapt_grids) + const bool adapt_grids) + : max_refinement_level(max_refinement_level) + , first_sweep_with_correction(first_sweep_with_correction) + , min_cells_for_correction(min_cells_for_correction) + , cell_number_corridor_top(cell_number_corridor_top) + , cell_number_corridor_bottom(cell_number_corridor_bottom) + , correction_relaxations(correction_relaxations.size() != 0 ? + correction_relaxations : + default_correction_relaxations) + , cell_number_correction_steps(cell_number_correction_steps) + , mirror_flags_to_previous_grid(mirror_flags_to_previous_grid) + , adapt_grids(adapt_grids) { Assert(cell_number_corridor_top >= 0, ExcInvalidValue(cell_number_corridor_top)); @@ -1232,8 +1231,9 @@ TimeStepBase_Tria_Flags::RefinementFlags::RefinementFlags( template TimeStepBase_Tria_Flags::RefinementData::RefinementData( const double _refinement_threshold, - const double _coarsening_threshold) : - refinement_threshold(_refinement_threshold), + const double _coarsening_threshold) + : refinement_threshold(_refinement_threshold) + , // in some rare cases it may happen that // both thresholds are the same (e.g. if // there are many cells with the same diff --git a/source/opencascade/boundary_lib.cc b/source/opencascade/boundary_lib.cc index 220469f68e..d18e92bead 100644 --- a/source/opencascade/boundary_lib.cc +++ b/source/opencascade/boundary_lib.cc @@ -37,8 +37,9 @@ namespace OpenCASCADE DirectionalProjectionBoundary::clone() const { return std::unique_ptr>( - new DirectionalProjectionBoundary( - this->sh, this->direction, this->tolerance)); + new DirectionalProjectionBoundary(this->sh, + this->direction, + this->tolerance)); } diff --git a/source/opencascade/manifold_lib.cc b/source/opencascade/manifold_lib.cc index a209d54285..c872b0d2fc 100644 --- a/source/opencascade/manifold_lib.cc +++ b/source/opencascade/manifold_lib.cc @@ -80,9 +80,9 @@ namespace OpenCASCADE template NormalProjectionManifold::NormalProjectionManifold( const TopoDS_Shape &sh, - const double tolerance) : - sh(sh), - tolerance(tolerance) + const double tolerance) + : sh(sh) + , tolerance(tolerance) { Assert(spacedim == 3, ExcNotImplemented()); } @@ -123,10 +123,10 @@ namespace OpenCASCADE DirectionalProjectionManifold::DirectionalProjectionManifold( const TopoDS_Shape & sh, const Tensor<1, spacedim> &direction, - const double tolerance) : - sh(sh), - direction(direction), - tolerance(tolerance) + const double tolerance) + : sh(sh) + , direction(direction) + , tolerance(tolerance) { Assert(spacedim == 3, ExcNotImplemented()); } @@ -167,9 +167,9 @@ namespace OpenCASCADE template NormalToMeshProjectionManifold::NormalToMeshProjectionManifold( const TopoDS_Shape &sh, - const double tolerance) : - sh(sh), - tolerance(tolerance) + const double tolerance) + : sh(sh) + , tolerance(tolerance) { Assert(spacedim == 3, ExcNotImplemented()); Assert( @@ -212,8 +212,10 @@ namespace OpenCASCADE for (unsigned int i = 0; i < surrounding_points.size(); ++i) { std::tuple, Tensor<1, 3>, double, double> - p_and_diff_forms = closest_point_and_differential_forms( - sh, surrounding_points[i], tolerance); + p_and_diff_forms = + closest_point_and_differential_forms(sh, + surrounding_points[i], + tolerance); average_normal += std::get<1>(p_and_diff_forms); } @@ -314,14 +316,15 @@ namespace OpenCASCADE template ArclengthProjectionLineManifold:: ArclengthProjectionLineManifold(const TopoDS_Shape &sh, - const double tolerance) : + const double tolerance) + : ChartManifold(sh.Closed() ? Point<1>(shape_length(sh)) : - Point<1>()), - sh(sh), - curve(curve_adaptor(sh)), - tolerance(tolerance), - length(shape_length(sh)) + Point<1>()) + , sh(sh) + , curve(curve_adaptor(sh)) + , tolerance(tolerance) + , length(shape_length(sh)) { Assert(spacedim >= 2, ExcImpossibleInDimSpacedim(dim, spacedim)); } @@ -362,18 +365,18 @@ namespace OpenCASCADE ArclengthProjectionLineManifold::push_forward( const Point<1> &chart_point) const { - GCPnts_AbscissaPoint AP( - curve->GetCurve(), chart_point[0], curve->GetCurve().FirstParameter()); - gp_Pnt P = curve->GetCurve().Value(AP.Parameter()); + GCPnts_AbscissaPoint AP(curve->GetCurve(), + chart_point[0], + curve->GetCurve().FirstParameter()); + gp_Pnt P = curve->GetCurve().Value(AP.Parameter()); return point(P); } template - NURBSPatchManifold::NURBSPatchManifold( - const TopoDS_Face &face, - const double tolerance) : - face(face), - tolerance(tolerance) + NURBSPatchManifold::NURBSPatchManifold(const TopoDS_Face &face, + const double tolerance) + : face(face) + , tolerance(tolerance) {} @@ -409,8 +412,9 @@ namespace OpenCASCADE NURBSPatchManifold::push_forward( const Point<2> &chart_point) const { - return ::dealii::OpenCASCADE::push_forward( - face, chart_point[0], chart_point[1]); + return ::dealii::OpenCASCADE::push_forward(face, + chart_point[0], + chart_point[1]); } template @@ -430,17 +434,17 @@ namespace OpenCASCADE if (spacedim > 2) DX[2][0] = Du.Z(); else - Assert( - std::abs(Du.Z()) < tolerance, - ExcMessage("Expecting derivative along Z to be zero! Bailing out.")); + Assert(std::abs(Du.Z()) < tolerance, + ExcMessage( + "Expecting derivative along Z to be zero! Bailing out.")); DX[0][1] = Dv.X(); DX[1][1] = Dv.Y(); if (spacedim > 2) DX[2][1] = Dv.Z(); else - Assert( - std::abs(Dv.Z()) < tolerance, - ExcMessage("Expecting derivative along Z to be zero! Bailing out.")); + Assert(std::abs(Dv.Z()) < tolerance, + ExcMessage( + "Expecting derivative along Z to be zero! Bailing out.")); return DX; } diff --git a/source/opencascade/utilities.cc b/source/opencascade/utilities.cc index 0d605778c2..086fc5d87e 100644 --- a/source/opencascade/utilities.cc +++ b/source/opencascade/utilities.cc @@ -90,8 +90,9 @@ namespace OpenCASCADE for (exp.Init(shape, TopAbs_VERTEX); exp.More(); exp.Next(), ++n_vertices) { } - return std::tuple( - n_faces, n_edges, n_vertices); + return std::tuple(n_faces, + n_edges, + n_vertices); } void @@ -476,8 +477,10 @@ namespace OpenCASCADE std::sort(curve_points.begin(), curve_points.end(), [&](const Point &p1, const Point &p2) { - return OpenCASCADE::point_compare( - p1, p2, direction, tolerance); + return OpenCASCADE::point_compare(p1, + p2, + direction, + tolerance); }); } @@ -785,8 +788,10 @@ namespace OpenCASCADE Max_Curvature *= -1; } - return std::tuple, Tensor<1, 3>, double, double>( - point<3>(Value), normal, Min_Curvature, Max_Curvature); + return std::tuple, Tensor<1, 3>, double, double>(point<3>(Value), + normal, + Min_Curvature, + Max_Curvature); } diff --git a/source/opencascade/utilities.inst.in b/source/opencascade/utilities.inst.in index da79fea4f5..f57451593e 100644 --- a/source/opencascade/utilities.inst.in +++ b/source/opencascade/utilities.inst.in @@ -37,8 +37,9 @@ for (deal_II_dimension : DIMENSIONS) const bool closed, const double tolerance); - template Point push_forward( - const TopoDS_Shape &in_shape, const double u, const double v); + template Point push_forward(const TopoDS_Shape &in_shape, + const double u, + const double v); template Point line_intersection( const TopoDS_Shape & in_shape, diff --git a/source/particles/particle.cc b/source/particles/particle.cc index 1748f1f198..b5dea11fa8 100644 --- a/source/particles/particle.cc +++ b/source/particles/particle.cc @@ -20,12 +20,12 @@ DEAL_II_NAMESPACE_OPEN namespace Particles { template - Particle::Particle() : - location(), - reference_location(), - id(0), - property_pool(nullptr), - properties(PropertyPool::invalid_handle) + Particle::Particle() + : location() + , reference_location() + , id(0) + , property_pool(nullptr) + , properties(PropertyPool::invalid_handle) {} @@ -33,25 +33,25 @@ namespace Particles template Particle::Particle(const Point &location, const Point & reference_location, - const types::particle_index id) : - location(location), - reference_location(reference_location), - id(id), - property_pool(nullptr), - properties(PropertyPool::invalid_handle) + const types::particle_index id) + : location(location) + , reference_location(reference_location) + , id(id) + , property_pool(nullptr) + , properties(PropertyPool::invalid_handle) {} template - Particle::Particle(const Particle &particle) : - location(particle.get_location()), - reference_location(particle.get_reference_location()), - id(particle.get_id()), - property_pool(particle.property_pool), - properties((particle.has_properties()) ? - property_pool->allocate_properties_array() : - PropertyPool::invalid_handle) + Particle::Particle(const Particle &particle) + : location(particle.get_location()) + , reference_location(particle.get_reference_location()) + , id(particle.get_id()) + , property_pool(particle.property_pool) + , properties((particle.has_properties()) ? + property_pool->allocate_properties_array() : + PropertyPool::invalid_handle) { if (particle.has_properties()) { @@ -105,13 +105,12 @@ namespace Particles template - Particle::Particle( - Particle &&particle) noexcept : - location(std::move(particle.location)), - reference_location(std::move(particle.reference_location)), - id(std::move(particle.id)), - property_pool(std::move(particle.property_pool)), - properties(std::move(particle.properties)) + Particle::Particle(Particle &&particle) noexcept + : location(std::move(particle.location)) + , reference_location(std::move(particle.reference_location)) + , id(std::move(particle.id)) + , property_pool(std::move(particle.property_pool)) + , properties(std::move(particle.properties)) { particle.properties = PropertyPool::invalid_handle; } @@ -303,8 +302,9 @@ namespace Particles "This is not allowed.")); if (old_properties.size() > 0) - std::copy( - new_properties.begin(), new_properties.end(), old_properties.begin()); + std::copy(new_properties.begin(), + new_properties.end(), + old_properties.begin()); } diff --git a/source/particles/particle_accessor.cc b/source/particles/particle_accessor.cc index e885f1320c..2f861c3424 100644 --- a/source/particles/particle_accessor.cc +++ b/source/particles/particle_accessor.cc @@ -20,7 +20,9 @@ DEAL_II_NAMESPACE_OPEN namespace Particles { template - ParticleAccessor::ParticleAccessor() : map(nullptr), particle() + ParticleAccessor::ParticleAccessor() + : map(nullptr) + , particle() {} @@ -29,11 +31,10 @@ namespace Particles ParticleAccessor::ParticleAccessor( const std::multimap> &map, const typename std::multimap>::iterator &particle) : - map( - const_cast> *>( - &map)), - particle(particle) + Particle>::iterator & particle) + : map(const_cast< + std::multimap> *>(&map)) + , particle(particle) {} diff --git a/source/particles/particle_handler.cc b/source/particles/particle_handler.cc index 6df47ad662..618e349901 100644 --- a/source/particles/particle_handler.cc +++ b/source/particles/particle_handler.cc @@ -29,18 +29,18 @@ DEAL_II_NAMESPACE_OPEN namespace Particles { template - ParticleHandler::ParticleHandler() : - triangulation(), - particles(), - ghost_particles(), - global_number_of_particles(0), - global_max_particles_per_cell(0), - next_free_particle_index(0), - property_pool(new PropertyPool(0)), - size_callback(), - store_callback(), - load_callback(), - handle(numbers::invalid_unsigned_int) + ParticleHandler::ParticleHandler() + : triangulation() + , particles() + , ghost_particles() + , global_number_of_particles(0) + , global_max_particles_per_cell(0) + , next_free_particle_index(0) + , property_pool(new PropertyPool(0)) + , size_callback() + , store_callback() + , load_callback() + , handle(numbers::invalid_unsigned_int) {} @@ -49,19 +49,19 @@ namespace Particles ParticleHandler::ParticleHandler( const parallel::distributed::Triangulation &triangulation, const Mapping & mapping, - const unsigned int n_properties) : - triangulation(&triangulation, typeid(*this).name()), - mapping(&mapping, typeid(*this).name()), - particles(), - ghost_particles(), - global_number_of_particles(0), - global_max_particles_per_cell(0), - next_free_particle_index(0), - property_pool(new PropertyPool(n_properties)), - size_callback(), - store_callback(), - load_callback(), - handle(numbers::invalid_unsigned_int) + const unsigned int n_properties) + : triangulation(&triangulation, typeid(*this).name()) + , mapping(&mapping, typeid(*this).name()) + , particles() + , ghost_particles() + , global_number_of_particles(0) + , global_max_particles_per_cell(0) + , next_free_particle_index(0) + , property_pool(new PropertyPool(n_properties)) + , size_callback() + , store_callback() + , load_callback() + , handle(numbers::invalid_unsigned_int) {} @@ -135,14 +135,16 @@ namespace Particles std::max(local_max_particles_per_cell, current_particles_per_cell); } - global_number_of_particles = dealii::Utilities::MPI::sum( - particles.size(), triangulation->get_communicator()); + global_number_of_particles = + dealii::Utilities::MPI::sum(particles.size(), + triangulation->get_communicator()); next_free_particle_index = dealii::Utilities::MPI::max(locally_highest_index, triangulation->get_communicator()) + 1; - global_max_particles_per_cell = dealii::Utilities::MPI::max( - local_max_particles_per_cell, triangulation->get_communicator()); + global_max_particles_per_cell = + dealii::Utilities::MPI::max(local_max_particles_per_cell, + triangulation->get_communicator()); } @@ -273,8 +275,9 @@ namespace Particles { typename std::multimap>::iterator it = - particles.insert(std::make_pair( - internal::LevelInd(cell->level(), cell->index()), particle)); + particles.insert( + std::make_pair(internal::LevelInd(cell->level(), cell->index()), + particle)); particle_iterator particle_it(particles, it); particle_it->set_property_pool(*property_pool); @@ -356,11 +359,11 @@ namespace Particles { hint = particles.insert( hint, - std::make_pair( - current_cell, - Particle(positions[index_map[i][p]], - local_positions[i][p], - local_start_index + index_map[i][p]))); + std::make_pair(current_cell, + Particle(positions[index_map[i][p]], + local_positions[i][p], + local_start_index + + index_map[i][p]))); } } @@ -563,8 +566,9 @@ namespace Particles // Create a corresponding map of vectors from vertex to cell center const std::vector>> - vertex_to_cell_centers(GridTools::vertex_to_cell_centers_directions( - *triangulation, vertex_to_cells)); + vertex_to_cell_centers( + GridTools::vertex_to_cell_centers_directions(*triangulation, + vertex_to_cells)); std::vector neighbor_permutation; @@ -600,14 +604,14 @@ namespace Particles for (unsigned int i = 0; i < n_neighbor_cells; ++i) neighbor_permutation[i] = i; - std::sort( - neighbor_permutation.begin(), - neighbor_permutation.end(), - std::bind(&compare_particle_association, - std::placeholders::_1, - std::placeholders::_2, - std::cref(vertex_to_particle), - std::cref(vertex_to_cell_centers[closest_vertex_index]))); + std::sort(neighbor_permutation.begin(), + neighbor_permutation.end(), + std::bind(&compare_particle_association, + std::placeholders::_1, + std::placeholders::_2, + std::cref(vertex_to_particle), + std::cref( + vertex_to_cell_centers[closest_vertex_index]))); // Search all of the cells adjacent to the closest vertex of the // previous cell Most likely we will find the particle in them. @@ -989,14 +993,15 @@ namespace Particles Particle(recv_data_it, property_pool.get()))); if (load_callback) - recv_data_it = load_callback( - particle_iterator(received_particles, recv_particle), recv_data_it); + recv_data_it = + load_callback(particle_iterator(received_particles, recv_particle), + recv_data_it); } - AssertThrow( - recv_data_it == recv_data.data() + recv_data.size(), - ExcMessage("The amount of data that was read into new particles " - "does not match the amount of data sent around.")); + AssertThrow(recv_data_it == recv_data.data() + recv_data.size(), + ExcMessage( + "The amount of data that was read into new particles " + "does not match the amount of data sent around.")); } # endif @@ -1033,10 +1038,10 @@ namespace Particles if (global_max_particles_per_cell > 0) { - const std::function::cell_iterator &, - const typename Triangulation::CellStatus, - void *)> + const std::function< + void(const typename Triangulation::cell_iterator &, + const typename Triangulation::CellStatus, + void *)> callback_function = std::bind(&ParticleHandler::store_particles, std::cref(*this), @@ -1063,8 +1068,9 @@ namespace Particles (size_per_particle * global_max_particles_per_cell) * (serialization ? 1 : std::pow(2, dim)); - handle = non_const_triangulation->register_data_attach( - transfer_size_per_cell, callback_function); + handle = + non_const_triangulation->register_data_attach(transfer_size_per_cell, + callback_function); } } @@ -1090,10 +1096,10 @@ namespace Particles // data correctly. Only do this if something was actually stored. if (serialization && (global_max_particles_per_cell > 0)) { - const std::function::cell_iterator &, - const typename Triangulation::CellStatus, - void *)> + const std::function< + void(const typename Triangulation::cell_iterator &, + const typename Triangulation::CellStatus, + void *)> callback_function = std::bind(&ParticleHandler::store_particles, std::cref(*this), @@ -1116,17 +1122,18 @@ namespace Particles const std::size_t transfer_size_per_cell = sizeof(unsigned int) + (size_per_particle * global_max_particles_per_cell); - handle = non_const_triangulation->register_data_attach( - transfer_size_per_cell, callback_function); + handle = + non_const_triangulation->register_data_attach(transfer_size_per_cell, + callback_function); } // Check if something was stored and load it if (handle != numbers::invalid_unsigned_int) { - const std::function::cell_iterator &, - const typename Triangulation::CellStatus, - const void *)> + const std::function< + void(const typename Triangulation::cell_iterator &, + const typename Triangulation::CellStatus, + const void *)> callback_function = std::bind(&ParticleHandler::load_particles, std::ref(*this), @@ -1255,9 +1262,9 @@ namespace Particles # else position_hint = particles.insert( position_hint, - std::make_pair( - std::make_pair(cell->level(), cell->index()), - Particle(pdata, property_pool.get()))); + std::make_pair(std::make_pair(cell->level(), cell->index()), + Particle(pdata, + property_pool.get()))); # endif ++position_hint; } @@ -1283,9 +1290,9 @@ namespace Particles # else position_hint = particles.insert( position_hint, - std::make_pair( - std::make_pair(cell->level(), cell->index()), - Particle(pdata, property_pool.get()))); + std::make_pair(std::make_pair(cell->level(), cell->index()), + Particle(pdata, + property_pool.get()))); # endif const Point p_unit = mapping->transform_real_to_unit_cell( cell, position_hint->second.get_location()); @@ -1333,10 +1340,11 @@ namespace Particles // compilers that report a -std=c++11 (like gcc 4.6) // implement it, so require C++14 instead. # ifdef DEAL_II_WITH_CXX14 - position_hints[child_index] = particles.emplace_hint( - position_hints[child_index], - std::make_pair(child->level(), child->index()), - std::move(p)); + position_hints[child_index] = + particles.emplace_hint(position_hints[child_index], + std::make_pair(child->level(), + child->index()), + std::move(p)); # else position_hints[child_index] = particles.insert( position_hints[child_index], diff --git a/source/particles/particle_iterator.cc b/source/particles/particle_iterator.cc index 2513465a65..9b5345ee6d 100644 --- a/source/particles/particle_iterator.cc +++ b/source/particles/particle_iterator.cc @@ -23,8 +23,8 @@ namespace Particles ParticleIterator::ParticleIterator( const std::multimap> &map, const typename std::multimap>::iterator &particle) : - accessor(map, particle) + Particle>::iterator & particle) + : accessor(map, particle) {} diff --git a/source/particles/property_pool.cc b/source/particles/property_pool.cc index 1b5b58a425..8e72e6510c 100644 --- a/source/particles/property_pool.cc +++ b/source/particles/property_pool.cc @@ -23,8 +23,8 @@ namespace Particles const PropertyPool::Handle PropertyPool::invalid_handle = nullptr; - PropertyPool::PropertyPool(const unsigned int n_properties_per_slot) : - n_properties(n_properties_per_slot) + PropertyPool::PropertyPool(const unsigned int n_properties_per_slot) + : n_properties(n_properties_per_slot) {} diff --git a/source/sundials/arkode.cc b/source/sundials/arkode.cc index 4cca4567c8..6a1b6547ee 100644 --- a/source/sundials/arkode.cc +++ b/source/sundials/arkode.cc @@ -231,14 +231,14 @@ namespace SUNDIALS template ARKode::ARKode(const AdditionalData &data, - const MPI_Comm mpi_comm) : - data(data), - arkode_mem(nullptr), - yy(nullptr), - abs_tolls(nullptr), - communicator(is_serial_vector::value ? - MPI_COMM_SELF : - Utilities::MPI::duplicate_communicator(mpi_comm)) + const MPI_Comm mpi_comm) + : data(data) + , arkode_mem(nullptr) + , yy(nullptr) + , abs_tolls(nullptr) + , communicator(is_serial_vector::value ? + MPI_COMM_SELF : + Utilities::MPI::duplicate_communicator(mpi_comm)) { set_functions_to_trigger_an_assert(); } @@ -415,8 +415,9 @@ namespace SUNDIALS } else { - status = ARKodeSStolerances( - arkode_mem, data.relative_tolerance, data.absolute_tolerance); + status = ARKodeSStolerances(arkode_mem, + data.relative_tolerance, + data.absolute_tolerance); AssertARKode(status); } diff --git a/source/sundials/ida.cc b/source/sundials/ida.cc index 4da0b8c1c6..4c6902c044 100644 --- a/source/sundials/ida.cc +++ b/source/sundials/ida.cc @@ -111,8 +111,10 @@ namespace SUNDIALS copy(*src_yy, yy); copy(*src_yp, yp); - int err = solver.setup_jacobian( - IDA_mem->ida_tn, *src_yy, *src_yp, IDA_mem->ida_cj); + int err = solver.setup_jacobian(IDA_mem->ida_tn, + *src_yy, + *src_yp, + IDA_mem->ida_cj); return err; } @@ -152,16 +154,16 @@ namespace SUNDIALS } // namespace template - IDA::IDA(const AdditionalData &data, const MPI_Comm mpi_comm) : - data(data), - ida_mem(nullptr), - yy(nullptr), - yp(nullptr), - abs_tolls(nullptr), - diff_id(nullptr), - communicator(is_serial_vector::value ? - MPI_COMM_SELF : - Utilities::MPI::duplicate_communicator(mpi_comm)) + IDA::IDA(const AdditionalData &data, const MPI_Comm mpi_comm) + : data(data) + , ida_mem(nullptr) + , yy(nullptr) + , yp(nullptr) + , abs_tolls(nullptr) + , diff_id(nullptr) + , communicator(is_serial_vector::value ? + MPI_COMM_SELF : + Utilities::MPI::duplicate_communicator(mpi_comm)) { set_functions_to_trigger_an_assert(); } @@ -351,8 +353,9 @@ namespace SUNDIALS } else { - status = IDASStolerances( - ida_mem, data.relative_tolerance, data.absolute_tolerance); + status = IDASStolerances(ida_mem, + data.relative_tolerance, + data.absolute_tolerance); AssertIDA(status); } diff --git a/source/sundials/kinsol.cc b/source/sundials/kinsol.cc index c5cf473c3f..cc0c1a6646 100644 --- a/source/sundials/kinsol.cc +++ b/source/sundials/kinsol.cc @@ -152,15 +152,15 @@ namespace SUNDIALS template KINSOL::KINSOL(const AdditionalData &data, - const MPI_Comm mpi_comm) : - data(data), - kinsol_mem(nullptr), - solution(nullptr), - u_scale(nullptr), - f_scale(nullptr), - communicator(is_serial_vector::value ? - MPI_COMM_SELF : - Utilities::MPI::duplicate_communicator(mpi_comm)) + const MPI_Comm mpi_comm) + : data(data) + , kinsol_mem(nullptr) + , solution(nullptr) + , u_scale(nullptr) + , f_scale(nullptr) + , communicator(is_serial_vector::value ? + MPI_COMM_SELF : + Utilities::MPI::duplicate_communicator(mpi_comm)) { set_functions_to_trigger_an_assert(); } diff --git a/tests/algorithms/newton_01.cc b/tests/algorithms/newton_01.cc index 4185d85f6b..0efb7e8687 100644 --- a/tests/algorithms/newton_01.cc +++ b/tests/algorithms/newton_01.cc @@ -42,7 +42,8 @@ class SquareRootResidual : public Algorithms::OperatorBase SmartPointer discretization; public: - SquareRootResidual(SquareRoot &problem) : discretization(&problem) + SquareRootResidual(SquareRoot &problem) + : discretization(&problem) {} virtual void @@ -57,7 +58,8 @@ class SquareRootSolver : public Algorithms::OperatorBase SmartPointer solver; public: - SquareRootSolver(SquareRoot &problem) : solver(&problem) + SquareRootSolver(SquareRoot &problem) + : solver(&problem) {} virtual void diff --git a/tests/algorithms/theta_01.cc b/tests/algorithms/theta_01.cc index 785ece2bd1..aaea07a461 100644 --- a/tests/algorithms/theta_01.cc +++ b/tests/algorithms/theta_01.cc @@ -91,7 +91,8 @@ main() } -Explicit::Explicit(const FullMatrix &M) : matrix(&M) +Explicit::Explicit(const FullMatrix &M) + : matrix(&M) { m.reinit(M.m(), M.n()); } @@ -115,7 +116,8 @@ Explicit::operator()(AnyData &out, const AnyData &in) } -Implicit::Implicit(const FullMatrix &M) : matrix(&M) +Implicit::Implicit(const FullMatrix &M) + : matrix(&M) { m.reinit(M.m(), M.n()); } diff --git a/tests/aniso/solution_transfer.cc b/tests/aniso/solution_transfer.cc index 0c704c6473..3064501e53 100644 --- a/tests/aniso/solution_transfer.cc +++ b/tests/aniso/solution_transfer.cc @@ -46,7 +46,8 @@ template class MyFunction : public Function { public: - MyFunction() : Function(){}; + MyFunction() + : Function(){}; virtual double value(const Point &p, const unsigned int) const diff --git a/tests/arpack/arpack_advection_diffusion.cc b/tests/arpack/arpack_advection_diffusion.cc index a0a1c08278..6a554640e0 100644 --- a/tests/arpack/arpack_advection_diffusion.cc +++ b/tests/arpack/arpack_advection_diffusion.cc @@ -107,10 +107,10 @@ private: template -EigenvalueProblem::EigenvalueProblem(unsigned int n_eigenvalues) : - fe(1), - dof_handler(triangulation), - n_eigenvalues(n_eigenvalues) +EigenvalueProblem::EigenvalueProblem(unsigned int n_eigenvalues) + : fe(1) + , dof_handler(triangulation) + , n_eigenvalues(n_eigenvalues) {} @@ -200,10 +200,12 @@ EigenvalueProblem::assemble_system() cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_stiffness_matrix, local_dof_indices, stiffness_matrix); - constraints.distribute_local_to_global( - cell_mass_matrix, local_dof_indices, mass_matrix); + constraints.distribute_local_to_global(cell_stiffness_matrix, + local_dof_indices, + stiffness_matrix); + constraints.distribute_local_to_global(cell_mass_matrix, + local_dof_indices, + mass_matrix); } stiffness_matrix.compress(VectorOperation::add); diff --git a/tests/arpack/parpack_advection_diffusion_petsc.cc b/tests/arpack/parpack_advection_diffusion_petsc.cc index fbfd5beb65..e2b0c25a32 100644 --- a/tests/arpack/parpack_advection_diffusion_petsc.cc +++ b/tests/arpack/parpack_advection_diffusion_petsc.cc @@ -114,10 +114,10 @@ class PETScInverse public: PETScInverse(const dealii::PETScWrappers::MatrixBase &A, dealii::SolverControl & cn, - const MPI_Comm &mpi_communicator = PETSC_COMM_SELF) : - solver(cn, mpi_communicator), - matrix(A), - preconditioner(matrix) + const MPI_Comm &mpi_communicator = PETSC_COMM_SELF) + : solver(cn, mpi_communicator) + , matrix(A) + , preconditioner(matrix) {} void @@ -211,15 +211,21 @@ test() for (unsigned int i = 0; i < n_mpi_processes; i++) n_locally_owned_dofs[i] = locally_owned_dofs_per_processor[i].n_elements(); - dealii::SparsityTools::distribute_sparsity_pattern( - csp, n_locally_owned_dofs, mpi_communicator, locally_relevant_dofs); + dealii::SparsityTools::distribute_sparsity_pattern(csp, + n_locally_owned_dofs, + mpi_communicator, + locally_relevant_dofs); // Initialise the stiffness and mass matrices - stiffness_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + stiffness_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); - mass_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + mass_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); eigenvalues.resize(number_of_eigenvalues); @@ -239,11 +245,12 @@ test() mass_matrix = 0; dealii::QGauss quadrature_formula(2); - dealii::FEValues fe_values( - fe, - quadrature_formula, - dealii::update_values | dealii::update_gradients | - dealii::update_quadrature_points | dealii::update_JxW_values); + dealii::FEValues fe_values(fe, + quadrature_formula, + dealii::update_values | + dealii::update_gradients | + dealii::update_quadrature_points | + dealii::update_JxW_values); const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); @@ -288,10 +295,12 @@ test() cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_stiffness_matrix, local_dof_indices, stiffness_matrix); - constraints.distribute_local_to_global( - cell_mass_matrix, local_dof_indices, mass_matrix); + constraints.distribute_local_to_global(cell_stiffness_matrix, + local_dof_indices, + stiffness_matrix); + constraints.distribute_local_to_global(cell_mass_matrix, + local_dof_indices, + mass_matrix); } } @@ -405,8 +414,9 @@ main(int argc, char **argv) try { - dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, 1); + dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, + argv, + 1); { test(); } diff --git a/tests/arpack/parpack_advection_diffusion_trilinos.cc b/tests/arpack/parpack_advection_diffusion_trilinos.cc index f01f31229c..5b9b448bfd 100644 --- a/tests/arpack/parpack_advection_diffusion_trilinos.cc +++ b/tests/arpack/parpack_advection_diffusion_trilinos.cc @@ -170,8 +170,10 @@ test() constraints.clear(); constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); DynamicSparsityPattern csp(locally_relevant_dofs); @@ -184,15 +186,21 @@ test() for (unsigned int i = 0; i < n_mpi_processes; i++) n_locally_owned_dofs[i] = locally_owned_dofs_per_processor[i].n_elements(); - SparsityTools::distribute_sparsity_pattern( - csp, n_locally_owned_dofs, mpi_communicator, locally_relevant_dofs); + SparsityTools::distribute_sparsity_pattern(csp, + n_locally_owned_dofs, + mpi_communicator, + locally_relevant_dofs); // Initialise the stiffness and mass matrices - stiffness_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + stiffness_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); - mass_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + mass_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); eigenvalues.resize(number_of_eigenvalues); @@ -258,10 +266,12 @@ test() cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_stiffness_matrix, local_dof_indices, stiffness_matrix); - constraints.distribute_local_to_global( - cell_mass_matrix, local_dof_indices, mass_matrix); + constraints.distribute_local_to_global(cell_stiffness_matrix, + local_dof_indices, + stiffness_matrix); + constraints.distribute_local_to_global(cell_mass_matrix, + local_dof_indices, + mass_matrix); } } @@ -300,11 +310,14 @@ test() PArpackSolver::largest_real_part, false); - SolverControl solver_control( - dof_handler.n_dofs(), 1e-9, /*log_history*/ false, /*log_results*/ false); + SolverControl solver_control(dof_handler.n_dofs(), + 1e-9, + /*log_history*/ false, + /*log_results*/ false); - PArpackSolver eigensolver( - solver_control, mpi_communicator, additional_data); + PArpackSolver eigensolver(solver_control, + mpi_communicator, + additional_data); eigensolver.reinit(locally_owned_dofs); eigensolver.set_shift(shift); arpack_vectors[0] = 1.; diff --git a/tests/arpack/step-36_ar.cc b/tests/arpack/step-36_ar.cc index d215e91c0c..e6de73ad02 100644 --- a/tests/arpack/step-36_ar.cc +++ b/tests/arpack/step-36_ar.cc @@ -98,9 +98,9 @@ namespace Step36 template - EigenvalueProblem::EigenvalueProblem(const std::string &prm_file) : - fe(1), - dof_handler(triangulation) + EigenvalueProblem::EigenvalueProblem(const std::string &prm_file) + : fe(1) + , dof_handler(triangulation) {} @@ -189,10 +189,12 @@ namespace Step36 cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_stiffness_matrix, local_dof_indices, stiffness_matrix); - constraints.distribute_local_to_global( - cell_mass_matrix, local_dof_indices, mass_matrix); + constraints.distribute_local_to_global(cell_stiffness_matrix, + local_dof_indices, + stiffness_matrix); + constraints.distribute_local_to_global(cell_mass_matrix, + local_dof_indices, + mass_matrix); } stiffness_matrix.compress(VectorOperation::add); diff --git a/tests/arpack/step-36_ar_shift.cc b/tests/arpack/step-36_ar_shift.cc index 7d2fd856ae..c055645a3f 100644 --- a/tests/arpack/step-36_ar_shift.cc +++ b/tests/arpack/step-36_ar_shift.cc @@ -91,9 +91,9 @@ namespace Step36 template - EigenvalueProblem::EigenvalueProblem(const std::string &prm_file) : - fe(1), - dof_handler(triangulation) + EigenvalueProblem::EigenvalueProblem(const std::string &prm_file) + : fe(1) + , dof_handler(triangulation) {} @@ -182,10 +182,12 @@ namespace Step36 cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_stiffness_matrix, local_dof_indices, stiffness_matrix); - constraints.distribute_local_to_global( - cell_mass_matrix, local_dof_indices, mass_matrix); + constraints.distribute_local_to_global(cell_stiffness_matrix, + local_dof_indices, + stiffness_matrix); + constraints.distribute_local_to_global(cell_mass_matrix, + local_dof_indices, + mass_matrix); } stiffness_matrix.compress(VectorOperation::add); diff --git a/tests/arpack/step-36_parpack.cc b/tests/arpack/step-36_parpack.cc index 67533ad417..62fbd6b9d7 100644 --- a/tests/arpack/step-36_parpack.cc +++ b/tests/arpack/step-36_parpack.cc @@ -117,10 +117,10 @@ class PETScInverse public: PETScInverse(const dealii::PETScWrappers::MatrixBase &A, dealii::SolverControl & cn, - const MPI_Comm &mpi_communicator = PETSC_COMM_SELF) : - solver(cn, mpi_communicator), - matrix(A), - preconditioner(matrix) + const MPI_Comm &mpi_communicator = PETSC_COMM_SELF) + : solver(cn, mpi_communicator) + , matrix(A) + , preconditioner(matrix) {} void @@ -213,15 +213,21 @@ test() for (unsigned int i = 0; i < n_mpi_processes; i++) n_locally_owned_dofs[i] = locally_owned_dofs_per_processor[i].n_elements(); - dealii::SparsityTools::distribute_sparsity_pattern( - csp, n_locally_owned_dofs, mpi_communicator, locally_relevant_dofs); + dealii::SparsityTools::distribute_sparsity_pattern(csp, + n_locally_owned_dofs, + mpi_communicator, + locally_relevant_dofs); // Initialise the stiffness and mass matrices - stiffness_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + stiffness_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); - mass_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + mass_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); eigenfunctions.resize(5); for (unsigned int i = 0; i < eigenfunctions.size(); ++i) @@ -236,11 +242,12 @@ test() mass_matrix = 0; dealii::QGauss quadrature_formula(2); - dealii::FEValues fe_values( - fe, - quadrature_formula, - dealii::update_values | dealii::update_gradients | - dealii::update_quadrature_points | dealii::update_JxW_values); + dealii::FEValues fe_values(fe, + quadrature_formula, + dealii::update_values | + dealii::update_gradients | + dealii::update_quadrature_points | + dealii::update_JxW_values); const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); @@ -277,10 +284,12 @@ test() cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_stiffness_matrix, local_dof_indices, stiffness_matrix); - constraints.distribute_local_to_global( - cell_mass_matrix, local_dof_indices, mass_matrix); + constraints.distribute_local_to_global(cell_stiffness_matrix, + local_dof_indices, + stiffness_matrix); + constraints.distribute_local_to_global(cell_mass_matrix, + local_dof_indices, + mass_matrix); } stiffness_matrix.compress(dealii::VectorOperation::add); @@ -293,8 +302,10 @@ test() for (unsigned int i = 0; i < eigenvalues.size(); i++) eigenfunctions[i] = PetscScalar(); - dealii::SolverControl solver_control( - dof_handler.n_dofs(), 1e-9, /*log_history*/ false, /*log_results*/ false); + dealii::SolverControl solver_control(dof_handler.n_dofs(), + 1e-9, + /*log_history*/ false, + /*log_results*/ false); PETScInverse inverse(stiffness_matrix, solver_control, mpi_communicator); const unsigned int num_arnoldi_vectors = 2 * eigenvalues.size() + 2; @@ -360,8 +371,9 @@ main(int argc, char **argv) try { - dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, 1); + dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, + argv, + 1); { test(); } diff --git a/tests/arpack/step-36_parpack_mf.cc b/tests/arpack/step-36_parpack_mf.cc index 59667ec097..f6ffb8aece 100644 --- a/tests/arpack/step-36_parpack_mf.cc +++ b/tests/arpack/step-36_parpack_mf.cc @@ -90,8 +90,10 @@ test() ConstraintMatrix constraints; constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); std::shared_ptr> mf_data( @@ -140,19 +142,22 @@ test() typedef LinearAlgebra::distributed::Vector VectorType; SolverCG solver_c(inner_control_c); PreconditionIdentity preconditioner; - const auto shift_and_invert = inverse_operator( - linear_operator(laplace), solver_c, preconditioner); + const auto shift_and_invert = + inverse_operator(linear_operator(laplace), + solver_c, + preconditioner); const unsigned int num_arnoldi_vectors = 2 * eigenvalues.size() + 2; PArpackSolver>::AdditionalData - additional_data( - num_arnoldi_vectors, - PArpackSolver< - LinearAlgebra::distributed::Vector>::largest_magnitude, - true); - - SolverControl solver_control( - dof_handler.n_dofs(), 1e-9, /*log_history*/ false, /*log_results*/ false); + additional_data(num_arnoldi_vectors, + PArpackSolver>:: + largest_magnitude, + true); + + SolverControl solver_control(dof_handler.n_dofs(), + 1e-9, + /*log_history*/ false, + /*log_results*/ false); PArpackSolver> eigensolver( solver_control, mpi_communicator, additional_data); diff --git a/tests/arpack/step-36_parpack_mf_02.cc b/tests/arpack/step-36_parpack_mf_02.cc index 763b384a17..55bb6257a8 100644 --- a/tests/arpack/step-36_parpack_mf_02.cc +++ b/tests/arpack/step-36_parpack_mf_02.cc @@ -89,8 +89,10 @@ test() ConstraintMatrix constraints; constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); std::shared_ptr> mf_data( @@ -138,17 +140,17 @@ test() typedef LinearAlgebra::distributed::Vector VectorType; SolverCG solver_c(inner_control_c); PreconditionIdentity preconditioner; - const auto invert = inverse_operator( - linear_operator(mass), solver_c, preconditioner); + const auto invert = inverse_operator(linear_operator(mass), + solver_c, + preconditioner); const unsigned int num_arnoldi_vectors = 2 * eigenvalues.size() + 40; PArpackSolver>::AdditionalData - additional_data( - num_arnoldi_vectors, - PArpackSolver< - LinearAlgebra::distributed::Vector>::largest_magnitude, - true, - 2); + additional_data(num_arnoldi_vectors, + PArpackSolver>:: + largest_magnitude, + true, + 2); SolverControl solver_control(dof_handler.n_dofs(), 1e-10, @@ -195,11 +197,11 @@ test() for (unsigned int j = 0; j < eigenfunctions.size(); j++) { const double err = std::abs(eigenfunctions[j] * Bx - (i == j)); - Assert( - err < precision, - ExcMessage("Eigenvectors " + Utilities::int_to_string(i) + - " and " + Utilities::int_to_string(j) + - " are not orthonormal: " + std::to_string(err))); + Assert(err < precision, + ExcMessage( + "Eigenvectors " + Utilities::int_to_string(i) + " and " + + Utilities::int_to_string(j) + + " are not orthonormal: " + std::to_string(err))); } laplace.vmult(Ax, eigenfunctions[i]); diff --git a/tests/arpack/step-36_parpack_mf_03.cc b/tests/arpack/step-36_parpack_mf_03.cc index 63a165d71b..293f273dca 100644 --- a/tests/arpack/step-36_parpack_mf_03.cc +++ b/tests/arpack/step-36_parpack_mf_03.cc @@ -90,8 +90,10 @@ test() ConstraintMatrix constraints; constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); std::shared_ptr> mf_data( @@ -139,20 +141,22 @@ test() typedef LinearAlgebra::distributed::Vector VectorType; SolverCG solver_c(inner_control_c); PreconditionIdentity preconditioner; - const auto invert = inverse_operator( - linear_operator(mass), solver_c, preconditioner); + const auto invert = inverse_operator(linear_operator(mass), + solver_c, + preconditioner); const unsigned int num_arnoldi_vectors = 2 * eigenvalues.size() + 10; PArpackSolver>::AdditionalData - additional_data( - num_arnoldi_vectors, - PArpackSolver< - LinearAlgebra::distributed::Vector>::largest_magnitude, - true, - 1); + additional_data(num_arnoldi_vectors, + PArpackSolver>:: + largest_magnitude, + true, + 1); - SolverControl solver_control( - dof_handler.n_dofs(), 1e-9, /*log_history*/ false, /*log_results*/ false); + SolverControl solver_control(dof_handler.n_dofs(), + 1e-9, + /*log_history*/ false, + /*log_results*/ false); PArpackSolver> eigensolver( solver_control, mpi_communicator, additional_data); @@ -192,11 +196,11 @@ test() { const double err = std::abs(eigenfunctions[j] * eigenfunctions[i] - (i == j)); - Assert( - err < precision, - ExcMessage("Eigenvectors " + Utilities::int_to_string(i) + - " and " + Utilities::int_to_string(j) + - " are not orthonormal: " + std::to_string(err))); + Assert(err < precision, + ExcMessage( + "Eigenvectors " + Utilities::int_to_string(i) + " and " + + Utilities::int_to_string(j) + + " are not orthonormal: " + std::to_string(err))); } laplace.vmult(Ax, eigenfunctions[i]); diff --git a/tests/arpack/step-36_parpack_trilinos.cc b/tests/arpack/step-36_parpack_trilinos.cc index e9ab096a38..b222df74f5 100644 --- a/tests/arpack/step-36_parpack_trilinos.cc +++ b/tests/arpack/step-36_parpack_trilinos.cc @@ -172,8 +172,10 @@ test() constraints.clear(); constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); DynamicSparsityPattern csp(locally_relevant_dofs); @@ -186,15 +188,21 @@ test() for (unsigned int i = 0; i < n_mpi_processes; i++) n_locally_owned_dofs[i] = locally_owned_dofs_per_processor[i].n_elements(); - SparsityTools::distribute_sparsity_pattern( - csp, n_locally_owned_dofs, mpi_communicator, locally_relevant_dofs); + SparsityTools::distribute_sparsity_pattern(csp, + n_locally_owned_dofs, + mpi_communicator, + locally_relevant_dofs); // Initialise the stiffness and mass matrices - stiffness_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + stiffness_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); - mass_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + mass_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); eigenfunctions.resize(5); for (unsigned int i = 0; i < eigenfunctions.size(); ++i) @@ -248,10 +256,12 @@ test() cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_stiffness_matrix, local_dof_indices, stiffness_matrix); - constraints.distribute_local_to_global( - cell_mass_matrix, local_dof_indices, mass_matrix); + constraints.distribute_local_to_global(cell_stiffness_matrix, + local_dof_indices, + stiffness_matrix); + constraints.distribute_local_to_global(cell_mass_matrix, + local_dof_indices, + mass_matrix); } stiffness_matrix.compress(VectorOperation::add); @@ -288,11 +298,14 @@ test() PArpackSolver::largest_magnitude, true); - SolverControl solver_control( - dof_handler.n_dofs(), 1e-9, /*log_history*/ false, /*log_results*/ false); + SolverControl solver_control(dof_handler.n_dofs(), + 1e-9, + /*log_history*/ false, + /*log_results*/ false); - PArpackSolver eigensolver( - solver_control, mpi_communicator, additional_data); + PArpackSolver eigensolver(solver_control, + mpi_communicator, + additional_data); eigensolver.reinit(locally_owned_dofs); eigensolver.set_shift(shift); eigenfunctions[0] = 1.; diff --git a/tests/base/aligned_vector_04.cc b/tests/base/aligned_vector_04.cc index 972c694bb3..a5b56c4417 100644 --- a/tests/base/aligned_vector_04.cc +++ b/tests/base/aligned_vector_04.cc @@ -41,12 +41,15 @@ public: class Function : public FunctionBase { public: - Function() : size_(2) + Function() + : size_(2) { deallog << "Construct object" << std::endl; } - Function(const Function &f) : size_(f.size_), vec(f.vec) + Function(const Function &f) + : size_(f.size_) + , vec(f.vec) { deallog << "Copy construct object" << std::endl; } diff --git a/tests/base/aligned_vector_05.cc b/tests/base/aligned_vector_05.cc index f1835286c7..86145e953d 100644 --- a/tests/base/aligned_vector_05.cc +++ b/tests/base/aligned_vector_05.cc @@ -24,9 +24,11 @@ class foo { public: - foo(const unsigned int a) : vec(1, a) + foo(const unsigned int a) + : vec(1, a) {} - foo(const foo &bar) : vec(bar.vec) + foo(const foo &bar) + : vec(bar.vec) {} foo & operator=(const foo &bar) diff --git a/tests/base/auto_derivative_function.cc b/tests/base/auto_derivative_function.cc index 45e0d888f2..cdd66b68e0 100644 --- a/tests/base/auto_derivative_function.cc +++ b/tests/base/auto_derivative_function.cc @@ -52,7 +52,8 @@ public: template -AutoSinExp::AutoSinExp() : AutoDerivativeFunction(1e-6, 2) +AutoSinExp::AutoSinExp() + : AutoDerivativeFunction(1e-6, 2) {} diff --git a/tests/base/cell_data_storage_01.cc b/tests/base/cell_data_storage_01.cc index 1a9e062443..0dc4012760 100644 --- a/tests/base/cell_data_storage_01.cc +++ b/tests/base/cell_data_storage_01.cc @@ -43,7 +43,8 @@ template class MyFunction : public Function { public: - MyFunction() : Function(1) + MyFunction() + : Function(1) {} double diff --git a/tests/base/cell_data_storage_02.cc b/tests/base/cell_data_storage_02.cc index 940c51b87e..b3bcbae303 100644 --- a/tests/base/cell_data_storage_02.cc +++ b/tests/base/cell_data_storage_02.cc @@ -40,7 +40,8 @@ template class MyFunction : public Function { public: - MyFunction() : Function(1) + MyFunction() + : Function(1) {} double @@ -58,7 +59,8 @@ const double default_value = 0.; class MyQData { public: - MyQData() : value(default_value){}; + MyQData() + : value(default_value){}; virtual ~MyQData(){}; double value; diff --git a/tests/base/convergence_table_01.cc b/tests/base/convergence_table_01.cc index a9ddc7f975..901d1b7c21 100644 --- a/tests/base/convergence_table_01.cc +++ b/tests/base/convergence_table_01.cc @@ -42,10 +42,12 @@ main() 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); + table.evaluate_convergence_rates("error", + "key", + ConvergenceTable::reduction_rate); + table_2.evaluate_convergence_rates("error", + "key", + ConvergenceTable::reduction_rate_log2); // output table.write_text(deallog.get_file_stream()); diff --git a/tests/base/convergence_table_04.cc b/tests/base/convergence_table_04.cc index c5dd6169c5..b64f3b5395 100644 --- a/tests/base/convergence_table_04.cc +++ b/tests/base/convergence_table_04.cc @@ -55,10 +55,13 @@ main() table_1.add_value("n_cells", 128); 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); + table_1.evaluate_convergence_rates("error", + "n_cells", + ConvergenceTable::reduction_rate); + table_1.evaluate_convergence_rates("error", + "n_cells", + ConvergenceTable::reduction_rate_log2, + 1); table_1.write_text(deallog.get_file_stream()); deallog << std::endl << "Testing 2d data" << std::endl; @@ -77,10 +80,13 @@ main() table_2.add_value("n_cells", 4096); table_2.add_value("error", 1.587e-05); table_2.set_scientific("error", true); - table_2.evaluate_convergence_rates( - "error", "n_cells", ConvergenceTable::reduction_rate); - table_2.evaluate_convergence_rates( - "error", "n_cells", ConvergenceTable::reduction_rate_log2, 2); + table_2.evaluate_convergence_rates("error", + "n_cells", + ConvergenceTable::reduction_rate); + table_2.evaluate_convergence_rates("error", + "n_cells", + ConvergenceTable::reduction_rate_log2, + 2); table_2.write_text(deallog.get_file_stream()); deallog << std::endl << "Testing 3d data" << std::endl; @@ -99,9 +105,12 @@ main() table_3.add_value("n_cells", 262144); table_3.add_value("error", 9.275e-04); table_3.set_scientific("error", true); - table_3.evaluate_convergence_rates( - "error", "n_cells", ConvergenceTable::reduction_rate); - table_3.evaluate_convergence_rates( - "error", "n_cells", ConvergenceTable::reduction_rate_log2, 3); + table_3.evaluate_convergence_rates("error", + "n_cells", + ConvergenceTable::reduction_rate); + table_3.evaluate_convergence_rates("error", + "n_cells", + ConvergenceTable::reduction_rate_log2, + 3); table_3.write_text(deallog.get_file_stream()); } diff --git a/tests/base/convergence_table_05.cc b/tests/base/convergence_table_05.cc index 7ed900e41c..27408bc9ef 100644 --- a/tests/base/convergence_table_05.cc +++ b/tests/base/convergence_table_05.cc @@ -39,7 +39,9 @@ main() t.add_value("error", 0.1); t.add_value("cells", t2); t.add_value("error", 0.025); - t.evaluate_convergence_rates( - "error", "cells", ConvergenceTable::reduction_rate_log2, 2); + t.evaluate_convergence_rates("error", + "cells", + ConvergenceTable::reduction_rate_log2, + 2); t.write_text(deallog.get_file_stream()); } diff --git a/tests/base/full_tensor_02.cc b/tests/base/full_tensor_02.cc index 6b10530c67..e0344df82c 100644 --- a/tests/base/full_tensor_02.cc +++ b/tests/base/full_tensor_02.cc @@ -45,10 +45,10 @@ main() AssertThrow(t == transpose(t), ExcInternalError()); // check norm of tensor - AssertThrow( - std::fabs(t.norm() - std::sqrt(1. * 1 + 2 * 2 + 3 * 3 + 2 * 4 * 4 + - 2 * 5 * 5 + 2 * 6 * 6)) < 1e-14, - ExcInternalError()); + AssertThrow(std::fabs(t.norm() - + std::sqrt(1. * 1 + 2 * 2 + 3 * 3 + 2 * 4 * 4 + + 2 * 5 * 5 + 2 * 6 * 6)) < 1e-14, + ExcInternalError()); deallog << "OK" << std::endl; } diff --git a/tests/base/function_parser_02.cc b/tests/base/function_parser_02.cc index 1ba2b3821a..baf1b860c5 100644 --- a/tests/base/function_parser_02.cc +++ b/tests/base/function_parser_02.cc @@ -49,8 +49,9 @@ main() // initialized with units FunctionParser<2> fp; function[0] = "x * cm + y * m + PI"; - fp.initialize( - FunctionParser<2>::default_variable_names(), function, constants); + fp.initialize(FunctionParser<2>::default_variable_names(), + function, + constants); deallog << "Function " << "[" << function[0] << "]" @@ -63,8 +64,9 @@ main() // that's a string, not vector of // strings FunctionParser<2> fp4; - fp4.initialize( - FunctionParser<2>::default_variable_names(), function[0], constants); + fp4.initialize(FunctionParser<2>::default_variable_names(), + function[0], + constants); deallog << "Function " << "[" << function[0] << "]" @@ -78,8 +80,9 @@ main() // compatibility FunctionParser<2> fp2; function[0] = "x + y + PI"; - fp2.initialize( - FunctionParser<2>::default_variable_names(), function, constants); + fp2.initialize(FunctionParser<2>::default_variable_names(), + function, + constants); deallog << "Function " << "[" << function[0] << "]" << " @point " @@ -92,8 +95,9 @@ main() // 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); + fp3.initialize(FunctionParser<2>::default_variable_names(), + function[0], + constants); deallog << "Function " << "[" << function[0] << "]" diff --git a/tests/base/function_parser_04.cc b/tests/base/function_parser_04.cc index f30471b33b..47ca540f0b 100644 --- a/tests/base/function_parser_04.cc +++ b/tests/base/function_parser_04.cc @@ -37,7 +37,8 @@ struct scratch_data struct copy_data { int value; - copy_data() : value(0) + copy_data() + : value(0) {} }; diff --git a/tests/base/functions.h b/tests/base/functions.h index fad55f2508..b6081779cb 100644 --- a/tests/base/functions.h +++ b/tests/base/functions.h @@ -125,9 +125,9 @@ private: template DerivativeTestFunction::DerivativeTestFunction(const Function &f, - const double h) : - AutoDerivativeFunction(h, f.n_components), - func(f) + const double h) + : AutoDerivativeFunction(h, f.n_components) + , func(f) { this->set_formula(AutoDerivativeFunction::FourthOrder); } diff --git a/tests/base/functions_08.cc b/tests/base/functions_08.cc index 1ce3af323d..3dcd8c1155 100644 --- a/tests/base/functions_08.cc +++ b/tests/base/functions_08.cc @@ -62,8 +62,9 @@ check1() object.vector_value(p, v); for (unsigned int c = 0; c < dim + 2; ++c) if (c == 0 || c == dim + 1) - AssertThrow(v(c) == 0, ExcInternalError()) else AssertThrow( - v(c) == p[c - 1], ExcInternalError()); + AssertThrow(v(c) == 0, + ExcInternalError()) else AssertThrow(v(c) == p[c - 1], + ExcInternalError()); } deallog << "OK" << std::endl; diff --git a/tests/base/functions_10.cc b/tests/base/functions_10.cc index 1dce72f1c0..68561a37cf 100644 --- a/tests/base/functions_10.cc +++ b/tests/base/functions_10.cc @@ -45,8 +45,9 @@ fill(const std::array, 2> &coordinates) Table<3, double> fill(const std::array, 3> &coordinates) { - Table<3, double> data( - coordinates[0].size(), coordinates[1].size(), coordinates[2].size()); + Table<3, double> data(coordinates[0].size(), + coordinates[1].size(), + coordinates[2].size()); for (unsigned int i = 0; i < coordinates[0].size(); ++i) for (unsigned int j = 0; j < coordinates[1].size(); ++j) for (unsigned int k = 0; k < coordinates[2].size(); ++k) diff --git a/tests/base/functions_11.cc b/tests/base/functions_11.cc index 5cc4efbe04..e03cab4361 100644 --- a/tests/base/functions_11.cc +++ b/tests/base/functions_11.cc @@ -45,8 +45,9 @@ fill(const std::array, 2> &coordinates) Table<3, double> fill(const std::array, 3> &coordinates) { - Table<3, double> data( - coordinates[0].size(), coordinates[1].size(), coordinates[2].size()); + Table<3, double> data(coordinates[0].size(), + coordinates[1].size(), + coordinates[2].size()); for (unsigned int i = 0; i < coordinates[0].size(); ++i) for (unsigned int j = 0; j < coordinates[1].size(); ++j) for (unsigned int k = 0; k < coordinates[2].size(); ++k) @@ -83,8 +84,9 @@ check() const Table data = fill(coordinates); - Functions::InterpolatedUniformGridData f( - intervals, n_subintervals, data); + Functions::InterpolatedUniformGridData f(intervals, + n_subintervals, + data); // now choose a number of randomly chosen points inside the box and // verify that the functions returned are correct diff --git a/tests/base/functions_constant_function_00.cc b/tests/base/functions_constant_function_00.cc index 3d788511ff..3a5643924e 100644 --- a/tests/base/functions_constant_function_00.cc +++ b/tests/base/functions_constant_function_00.cc @@ -127,8 +127,9 @@ test_constructor(const unsigned int n_component, TESTEE constant_vector_function( component_data[2 /*of MAX_N_COMPONENT*/], n_component); - test_one_object( - constant_vector_function, n_points, n_component); + test_one_object(constant_vector_function, + n_points, + n_component); } // Construct with std::vector<> @@ -144,8 +145,9 @@ test_constructor(const unsigned int n_component, // Close file to let Test use it. TESTEE constant_vector_function(v); - test_one_object( - constant_vector_function, n_points, n_component); + test_one_object(constant_vector_function, + n_points, + n_component); } // Construct with Vector @@ -161,8 +163,9 @@ test_constructor(const unsigned int n_component, // Close file to let Test use it. TESTEE constant_vector_function(v); - test_one_object( - constant_vector_function, n_points, n_component); + test_one_object(constant_vector_function, + n_points, + n_component); } // Construct with pointer and offset @@ -174,8 +177,9 @@ test_constructor(const unsigned int n_component, // Close file to let Test use it. TESTEE constant_vector_function(&component_data[0], n_component); - test_one_object( - constant_vector_function, n_points, n_component); + test_one_object(constant_vector_function, + n_points, + n_component); } return; diff --git a/tests/base/functions_spherical_01.cc b/tests/base/functions_spherical_01.cc index 92cd35a64e..1163a2cc8f 100644 --- a/tests/base/functions_spherical_01.cc +++ b/tests/base/functions_spherical_01.cc @@ -28,10 +28,10 @@ template class ExpFunc : public Function { public: - ExpFunc(const Point &origin, const double &Z) : - Function(1), - origin(origin), - Z(Z) + ExpFunc(const Point &origin, const double &Z) + : Function(1) + , origin(origin) + , Z(Z) {} virtual double @@ -79,9 +79,9 @@ template class ExpFunc2 : public Functions::Spherical { public: - ExpFunc2(const Point &origin, const double &Z) : - Functions::Spherical(origin), - Z(Z) + ExpFunc2(const Point &origin, const double &Z) + : Functions::Spherical(origin) + , Z(Z) {} private: diff --git a/tests/base/functions_spherical_02.cc b/tests/base/functions_spherical_02.cc index 49b90192ac..08dcc056f0 100644 --- a/tests/base/functions_spherical_02.cc +++ b/tests/base/functions_spherical_02.cc @@ -50,9 +50,9 @@ template class RefFunc : public Function { public: - RefFunc(const Point origin = Point()) : - Function(1), - origin(origin) + RefFunc(const Point origin = Point()) + : Function(1) + , origin(origin) {} virtual double @@ -123,8 +123,8 @@ template class SphFunc : public Functions::Spherical { public: - SphFunc(const Point origin = Point()) : - Functions::Spherical(origin) + SphFunc(const Point origin = Point()) + : Functions::Spherical(origin) {} private: diff --git a/tests/base/index_set_20_offset.cc b/tests/base/index_set_20_offset.cc index d58743d61f..f13d012fd2 100644 --- a/tests/base/index_set_20_offset.cc +++ b/tests/base/index_set_20_offset.cc @@ -41,10 +41,10 @@ testor(IndexSet &a, IndexSet &other, unsigned int offset, bool verbose) 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()); + Assert(merged.is_element(i) == + (a.is_element(i) || + (i >= offset && other.is_element(i - offset))), + ExcInternalError()); } } diff --git a/tests/base/index_set_28.cc b/tests/base/index_set_28.cc index 0e78ddeb23..8b088c213f 100644 --- a/tests/base/index_set_28.cc +++ b/tests/base/index_set_28.cc @@ -43,9 +43,9 @@ test() { deallog << index_set.nth_index_in_set(i) << std::endl; - AssertThrow( - index_set.index_within_set(index_set.nth_index_in_set(i) == i), - ExcInternalError()); + AssertThrow(index_set.index_within_set(index_set.nth_index_in_set(i) == + i), + ExcInternalError()); } deallog << "OK" << std::endl; diff --git a/tests/base/index_set_29.cc b/tests/base/index_set_29.cc index 7746a25c23..05fe0f8121 100644 --- a/tests/base/index_set_29.cc +++ b/tests/base/index_set_29.cc @@ -43,9 +43,9 @@ test() { deallog << index_set.nth_index_in_set(i) << std::endl; - AssertThrow( - index_set.index_within_set(index_set.nth_index_in_set(i) == i), - ExcInternalError()); + AssertThrow(index_set.index_within_set(index_set.nth_index_in_set(i) == + i), + ExcInternalError()); } deallog << "OK" << std::endl; diff --git a/tests/base/is_finite_complex.cc b/tests/base/is_finite_complex.cc index f4e6e5568a..9b48fdcab2 100644 --- a/tests/base/is_finite_complex.cc +++ b/tests/base/is_finite_complex.cc @@ -113,11 +113,13 @@ check() deallog << static_cast::real_type>(1) << " --> "; - deallog << is_finite(T( - static_cast::real_type>(1), 0)) + deallog << is_finite( + T(static_cast::real_type>(1), + 0)) << ' '; - deallog << is_finite(T( - 0, static_cast::real_type>(1))) + deallog << is_finite( + T(0, + static_cast::real_type>(1))) << std::endl; deallog << static_cast::real_type>(-1) diff --git a/tests/base/parallel_transform_03.cc b/tests/base/parallel_transform_03.cc index fd5b63d60f..741f3eac81 100644 --- a/tests/base/parallel_transform_03.cc +++ b/tests/base/parallel_transform_03.cc @@ -43,14 +43,14 @@ main() // 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); + parallel::transform(x.begin(), + x.end(), + y.begin(), + z.begin(), + a.begin(), + (boost::lambda::_1 + boost::lambda::_2 - + boost::lambda::_3), + 10); AssertThrow(a.l2_norm() == 0, ExcInternalError()); diff --git a/tests/base/polynomial_jacobi_roots.cc b/tests/base/polynomial_jacobi_roots.cc index 775075e486..15e4baeb6a 100644 --- a/tests/base/polynomial_jacobi_roots.cc +++ b/tests/base/polynomial_jacobi_roots.cc @@ -64,8 +64,10 @@ main() << " ) " << std::setw(22) << std::setprecision(16) << 0.5 + 0.5 * roots_reference[i] << " (fval = " << std::setw(9) << std::setprecision(3) - << jacobi_polynomial_value( - degree, alpha, beta, 0.5 + 0.5 * roots_reference[i]) + << jacobi_polynomial_value(degree, + alpha, + beta, + 0.5 + 0.5 * roots_reference[i]) << " )" << std::endl; deallog << std::endl; } diff --git a/tests/base/polynomial_jacobi_roots_ld.cc b/tests/base/polynomial_jacobi_roots_ld.cc index f4703bca94..a1b8aaeae7 100644 --- a/tests/base/polynomial_jacobi_roots_ld.cc +++ b/tests/base/polynomial_jacobi_roots_ld.cc @@ -64,8 +64,10 @@ main() << " ) " << std::setw(22) << std::setprecision(19) << 0.5 + 0.5 * roots_reference[i] << " (fval = " << std::setw(9) << std::setprecision(3) - << jacobi_polynomial_value( - degree, alpha, beta, 0.5 + 0.5 * roots_reference[i]) + << jacobi_polynomial_value(degree, + alpha, + beta, + 0.5 + 0.5 * roots_reference[i]) << " )" << std::endl; deallog << std::endl; } diff --git a/tests/base/product_type_05.cc b/tests/base/product_type_05.cc index c6a2e3c3f3..382b6d7b81 100644 --- a/tests/base/product_type_05.cc +++ b/tests/base/product_type_05.cc @@ -50,15 +50,15 @@ main() << std::endl; check, std::complex, std::complex>(); - deallog << (ProductType, std::complex>::type( - 2.345, 1.23) * - ProductType, std::complex>::type( - 3.456, 2.45)) - << ' ' - << (ProductType, std::complex>::type( - std::complex(2.345, 1.23) * - std::complex(3.456, 2.45))) - << std::endl; + deallog + << (ProductType, std::complex>::type(2.345, + 1.23) * + ProductType, std::complex>::type(3.456, + 2.45)) + << ' ' + << (ProductType, std::complex>::type( + std::complex(2.345, 1.23) * std::complex(3.456, 2.45))) + << std::endl; deallog << "OK" << std::endl; } diff --git a/tests/base/quadrature_check_tensor_product.cc b/tests/base/quadrature_check_tensor_product.cc index 5a437abcf6..eaadb58cc8 100644 --- a/tests/base/quadrature_check_tensor_product.cc +++ b/tests/base/quadrature_check_tensor_product.cc @@ -51,10 +51,10 @@ check_tensor_product(const std::vector> &quadratures, { std::cout << q_points[q] << " " << q_basis[0].get_points()[q] << std::endl; - AssertThrow( - std::abs((q_points[q] - q_basis[0].get_points()[q]).norm()) < - 1.e-10, - ExcInternalError()); + AssertThrow(std::abs( + (q_points[q] - q_basis[0].get_points()[q]).norm()) < + 1.e-10, + ExcInternalError()); AssertThrow(std::abs(q_weights[q] - q_basis[0].get_weights()[q]) < 1.e-10, ExcInternalError()); diff --git a/tests/base/quadrature_point_data.cc b/tests/base/quadrature_point_data.cc index 6f5320f457..45aaefe99a 100644 --- a/tests/base/quadrature_point_data.cc +++ b/tests/base/quadrature_point_data.cc @@ -45,7 +45,8 @@ template class MyFunction : public Function { public: - MyFunction() : Function(1) + MyFunction() + : Function(1) {} double diff --git a/tests/base/quadrature_point_data_02.cc b/tests/base/quadrature_point_data_02.cc index 6e1533f655..546c0a437d 100644 --- a/tests/base/quadrature_point_data_02.cc +++ b/tests/base/quadrature_point_data_02.cc @@ -46,7 +46,8 @@ template class MyFunction : public Function { public: - MyFunction() : Function(1) + MyFunction() + : Function(1) {} double diff --git a/tests/base/quadrature_point_data_03.cc b/tests/base/quadrature_point_data_03.cc index 4b61c4335d..72cc74526f 100644 --- a/tests/base/quadrature_point_data_03.cc +++ b/tests/base/quadrature_point_data_03.cc @@ -43,7 +43,8 @@ template class MyFunction : public Function { public: - MyFunction() : Function(1) + MyFunction() + : Function(1) {} double diff --git a/tests/base/quadrature_simplex_01.cc b/tests/base/quadrature_simplex_01.cc index 49fc366c4a..12f05f94fb 100644 --- a/tests/base/quadrature_simplex_01.cc +++ b/tests/base/quadrature_simplex_01.cc @@ -36,8 +36,9 @@ test(int n) deallog << std::endl << "# Area: " - << std::accumulate( - quad.get_weights().begin(), quad.get_weights().end(), 0.0) + << std::accumulate(quad.get_weights().begin(), + quad.get_weights().end(), + 0.0) << std::endl << std::endl; @@ -49,8 +50,9 @@ test(int n) deallog << std::endl << "# Area 2: " - << std::accumulate( - quad2.get_weights().begin(), quad2.get_weights().end(), 0.0) + << std::accumulate(quad2.get_weights().begin(), + quad2.get_weights().end(), + 0.0) << std::endl << std::endl; } diff --git a/tests/base/quadrature_simplex_02.cc b/tests/base/quadrature_simplex_02.cc index 56445bbbde..e04da74374 100644 --- a/tests/base/quadrature_simplex_02.cc +++ b/tests/base/quadrature_simplex_02.cc @@ -36,8 +36,9 @@ test(int n) deallog << std::endl << "# Area: " - << std::accumulate( - quad.get_weights().begin(), quad.get_weights().end(), 0.0) + << std::accumulate(quad.get_weights().begin(), + quad.get_weights().end(), + 0.0) << std::endl << std::endl; @@ -49,8 +50,9 @@ test(int n) deallog << std::endl << "# Area 2: " - << std::accumulate( - quad2.get_weights().begin(), quad2.get_weights().end(), 0.0) + << std::accumulate(quad2.get_weights().begin(), + quad2.get_weights().end(), + 0.0) << std::endl << std::endl; } diff --git a/tests/base/quadrature_simplex_03.cc b/tests/base/quadrature_simplex_03.cc index 3225640c20..c8010ef9ea 100644 --- a/tests/base/quadrature_simplex_03.cc +++ b/tests/base/quadrature_simplex_03.cc @@ -36,8 +36,9 @@ test(int n) deallog << std::endl << "# Area: " - << std::accumulate( - quad.get_weights().begin(), quad.get_weights().end(), 0.0) + << std::accumulate(quad.get_weights().begin(), + quad.get_weights().end(), + 0.0) << std::endl << std::endl; @@ -49,8 +50,9 @@ test(int n) deallog << std::endl << "# Area 2: " - << std::accumulate( - quad2.get_weights().begin(), quad2.get_weights().end(), 0.0) + << std::accumulate(quad2.get_weights().begin(), + quad2.get_weights().end(), + 0.0) << std::endl << std::endl; } diff --git a/tests/base/quadrature_simplex_04.cc b/tests/base/quadrature_simplex_04.cc index 029171f109..c51873d8f3 100644 --- a/tests/base/quadrature_simplex_04.cc +++ b/tests/base/quadrature_simplex_04.cc @@ -37,8 +37,9 @@ test(int n) deallog << std::endl << "# Area: " - << std::accumulate( - quad.get_weights().begin(), quad.get_weights().end(), 0.0) + << std::accumulate(quad.get_weights().begin(), + quad.get_weights().end(), + 0.0) << std::endl << std::endl; @@ -55,8 +56,9 @@ test(int n) deallog << std::endl << "# Area: " - << std::accumulate( - quad.get_weights().begin(), quad.get_weights().end(), 0.0) + << std::accumulate(quad.get_weights().begin(), + quad.get_weights().end(), + 0.0) << std::endl << std::endl; if (quad.size() == n * n * 3) @@ -72,8 +74,9 @@ test(int n) deallog << std::endl << "# Area: " - << std::accumulate( - quad.get_weights().begin(), quad.get_weights().end(), 0.0) + << std::accumulate(quad.get_weights().begin(), + quad.get_weights().end(), + 0.0) << std::endl << std::endl; if (quad.size() == n * n * 2) diff --git a/tests/base/quadrature_simplex_05.cc b/tests/base/quadrature_simplex_05.cc index 01aa340652..96ff6d95f7 100644 --- a/tests/base/quadrature_simplex_05.cc +++ b/tests/base/quadrature_simplex_05.cc @@ -33,8 +33,9 @@ test(int n, const Point &split_point, stream_type &deallog) deallog << std::endl << "# dim = " << dim << ", quad size = " << quad.size() << ", computed area = " - << std::accumulate( - quad.get_weights().begin(), quad.get_weights().end(), 0.0) + << std::accumulate(quad.get_weights().begin(), + quad.get_weights().end(), + 0.0) << std::endl << std::endl; diff --git a/tests/base/reference.cc b/tests/base/reference.cc index da08763b71..ccd664370b 100644 --- a/tests/base/reference.cc +++ b/tests/base/reference.cc @@ -38,7 +38,8 @@ class Test : public Subscriptor const char *name; public: - Test(const char *n) : name(n) + Test(const char *n) + : name(n) { deallog << "Construct " << name << std::endl; } diff --git a/tests/base/table.cc b/tests/base/table.cc index c2aa9e363a..eb43d016c9 100644 --- a/tests/base/table.cc +++ b/tests/base/table.cc @@ -251,11 +251,11 @@ 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) - AssertThrow( - Td[i][j][k].end() - Td[i][j][k].begin() == - static_cast(L), - ExcDimensionMismatch(Td[i][j][k].end() - Td[i][j][k].begin(), - static_cast(L))); + AssertThrow(Td[i][j][k].end() - Td[i][j][k].begin() == + static_cast(L), + ExcDimensionMismatch(Td[i][j][k].end() - + Td[i][j][k].begin(), + static_cast(L))); }; // 5d-table diff --git a/tests/base/table_06.cc b/tests/base/table_06.cc index ac77bae116..fbf6141434 100644 --- a/tests/base/table_06.cc +++ b/tests/base/table_06.cc @@ -41,12 +41,15 @@ public: class Function : public FunctionBase { public: - Function() : size_(2) + Function() + : size_(2) { deallog << "Construct object" << std::endl; } - Function(const Function &f) : size_(f.size_), vec(f.vec) + Function(const Function &f) + : size_(f.size_) + , vec(f.vec) { deallog << "Copy construct object" << std::endl; } diff --git a/tests/base/task_11.cc b/tests/base/task_11.cc index a209d9b659..46dcf5e779 100644 --- a/tests/base/task_11.cc +++ b/tests/base/task_11.cc @@ -87,9 +87,9 @@ main() test(); } else - Assert( - false, - ExcInternalError("did somebody mess with LimitConcurrency in tests.h?")); + Assert(false, + ExcInternalError( + "did somebody mess with LimitConcurrency in tests.h?")); deallog << "* now with thread limit 1:" << std::endl; MultithreadInfo::set_thread_limit(1); diff --git a/tests/base/thread_local_storage_03.cc b/tests/base/thread_local_storage_03.cc index 6a7e1cc64f..c10c80096b 100644 --- a/tests/base/thread_local_storage_03.cc +++ b/tests/base/thread_local_storage_03.cc @@ -26,7 +26,8 @@ struct X { Threads::ThreadLocalStorage tls_data; - X() : tls_data(42) + X() + : tls_data(42) {} int diff --git a/tests/base/thread_local_storage_04.cc b/tests/base/thread_local_storage_04.cc index d820a83d16..82249412e3 100644 --- a/tests/base/thread_local_storage_04.cc +++ b/tests/base/thread_local_storage_04.cc @@ -27,7 +27,8 @@ struct X { Threads::ThreadLocalStorage tls_data; - X() : tls_data(42) + X() + : tls_data(42) {} int diff --git a/tests/base/thread_local_storage_05.cc b/tests/base/thread_local_storage_05.cc index 03444bc121..5b2f44f6e3 100644 --- a/tests/base/thread_local_storage_05.cc +++ b/tests/base/thread_local_storage_05.cc @@ -24,7 +24,8 @@ struct X { - X() : i(1){}; + X() + : i(1){}; int i; }; diff --git a/tests/base/thread_local_storage_06.cc b/tests/base/thread_local_storage_06.cc index 2915daaac9..1070c64abc 100644 --- a/tests/base/thread_local_storage_06.cc +++ b/tests/base/thread_local_storage_06.cc @@ -25,7 +25,8 @@ struct X { - X() : i(1){}; + X() + : i(1){}; int i; }; diff --git a/tests/base/thread_validity_01.cc b/tests/base/thread_validity_01.cc index be5e5241f5..131eeadd83 100644 --- a/tests/base/thread_validity_01.cc +++ b/tests/base/thread_validity_01.cc @@ -23,7 +23,8 @@ struct X { - X(int i) : i(i) + X(int i) + : i(i) {} int i; diff --git a/tests/base/thread_validity_02.cc b/tests/base/thread_validity_02.cc index 27500c61d8..b98577f496 100644 --- a/tests/base/thread_validity_02.cc +++ b/tests/base/thread_validity_02.cc @@ -27,7 +27,8 @@ struct X { - X(int i) : i(i) + X(int i) + : i(i) {} int i; diff --git a/tests/base/thread_validity_03.cc b/tests/base/thread_validity_03.cc index ed5ae63b7b..ae1dd13725 100644 --- a/tests/base/thread_validity_03.cc +++ b/tests/base/thread_validity_03.cc @@ -26,7 +26,8 @@ struct X { - X(int i) : i(i) + X(int i) + : i(i) {} int i; diff --git a/tests/base/thread_validity_04.cc b/tests/base/thread_validity_04.cc index bfb8362007..3ccc6a29fa 100644 --- a/tests/base/thread_validity_04.cc +++ b/tests/base/thread_validity_04.cc @@ -27,7 +27,8 @@ struct X { - X(int i) : i(i) + X(int i) + : i(i) {} int i; diff --git a/tests/base/thread_validity_05.cc b/tests/base/thread_validity_05.cc index 1a3f284444..162a3e0ef3 100644 --- a/tests/base/thread_validity_05.cc +++ b/tests/base/thread_validity_05.cc @@ -26,7 +26,8 @@ struct X { - X(int i) : i(i) + X(int i) + : i(i) {} int i; @@ -61,7 +62,8 @@ test1() struct Y { - Y(int i) : i(i) + Y(int i) + : i(i) {} int i; diff --git a/tests/base/thread_validity_06.cc b/tests/base/thread_validity_06.cc index 7dda20f076..587c35c534 100644 --- a/tests/base/thread_validity_06.cc +++ b/tests/base/thread_validity_06.cc @@ -28,9 +28,11 @@ struct X { - X() : i(0) + X() + : i(0) {} - X(const X &x) : i(x.i + 1) + X(const X &x) + : i(x.i + 1) {} X & operator=(const X &x) diff --git a/tests/base/thread_validity_13.cc b/tests/base/thread_validity_13.cc index c4fdabac2b..4e61fa4ee0 100644 --- a/tests/base/thread_validity_13.cc +++ b/tests/base/thread_validity_13.cc @@ -28,10 +28,12 @@ class X { public: // default constructor - X() : value(13) + X() + : value(13) {} - X(int i) : value(i) + X(int i) + : value(i) {} // delete the copy constructor diff --git a/tests/base/thread_validity_14.cc b/tests/base/thread_validity_14.cc index c2c1195c12..62ea3ceb08 100644 --- a/tests/base/thread_validity_14.cc +++ b/tests/base/thread_validity_14.cc @@ -27,11 +27,13 @@ class X { public: - X(int i) : value(i) + X(int i) + : value(i) {} // default constructor - X() : value(13) + X() + : value(13) {} // delete the copy constructor diff --git a/tests/base/timer_06.cc b/tests/base/timer_06.cc index 8798bc5e56..bd756652e2 100644 --- a/tests/base/timer_06.cc +++ b/tests/base/timer_06.cc @@ -37,12 +37,11 @@ main(int argc, char **argv) const auto t1 = std::chrono::system_clock::now(); // verify that the timer wall time is not double the manually calculated one - AssertThrow( - std::abs( - double( - std::chrono::duration_cast(t1 - t0).count()) - - timer.wall_time()) < 0.5, - ExcMessage("The measured times should be close.")); + AssertThrow(std::abs( + double(std::chrono::duration_cast(t1 - t0) + .count()) - + timer.wall_time()) < 0.5, + ExcMessage("The measured times should be close.")); deallog << "OK" << std::endl; } diff --git a/tests/base/timer_07.cc b/tests/base/timer_07.cc index 49104afa4c..6d9aeffe0d 100644 --- a/tests/base/timer_07.cc +++ b/tests/base/timer_07.cc @@ -66,8 +66,10 @@ main(int argc, char **argv) try { std::cerr << "TimerOutput::Scope with MPI_COMM_SELF\n"; - TimerOutput timer_out( - MPI_COMM_SELF, std::cerr, TimerOutput::summary, TimerOutput::cpu_times); + TimerOutput timer_out(MPI_COMM_SELF, + std::cerr, + TimerOutput::summary, + TimerOutput::cpu_times); TimerOutput::Scope timer_scope(timer_out, "Section1"); throw Timer07Exception(); @@ -85,8 +87,9 @@ main(int argc, char **argv) // convert everything between the |s to xs so that we have consistent // output. const std::string::iterator start_pipe = - std::find( - std::string::reverse_iterator(next_number), output.rend(), '|') + std::find(std::string::reverse_iterator(next_number), + output.rend(), + '|') .base(); Assert(start_pipe != output.end(), ExcInternalError()); const std::string::iterator end_pipe = diff --git a/tests/base/utilities_pack_unpack_05.cc b/tests/base/utilities_pack_unpack_05.cc index fc0de35494..4fa7783577 100644 --- a/tests/base/utilities_pack_unpack_05.cc +++ b/tests/base/utilities_pack_unpack_05.cc @@ -42,10 +42,12 @@ check(const double (&array)[N], const Point(&point)) // UNPACK BUFFER double unpacked_array[N]; - Utilities::unpack( - buffer.cbegin(), buffer.cbegin() + buffer_separator, unpacked_array); - Point unpacked_point = Utilities::unpack>( - buffer.cbegin() + buffer_separator, buffer.cend()); + Utilities::unpack(buffer.cbegin(), + buffer.cbegin() + buffer_separator, + unpacked_array); + Point unpacked_point = + Utilities::unpack>(buffer.cbegin() + buffer_separator, + buffer.cend()); // TEST RESULTS bool equal_array = true; diff --git a/tests/base/utilities_pack_unpack_06.cc b/tests/base/utilities_pack_unpack_06.cc index 93f96aeb91..79cae55ac4 100644 --- a/tests/base/utilities_pack_unpack_06.cc +++ b/tests/base/utilities_pack_unpack_06.cc @@ -72,16 +72,19 @@ check(const double (&array)[N], const Point(&point)) Utilities::unpack(array_compressed.cbegin(), array_compressed.cend(), unpacked_array_compressed); - Point unpacked_point_compressed = Utilities::unpack>( - point_compressed.cbegin(), point_compressed.cend()); + Point unpacked_point_compressed = + Utilities::unpack>(point_compressed.cbegin(), + point_compressed.cend()); double unpacked_array_uncompressed[N]; Utilities::unpack(array_uncompressed.cbegin(), array_uncompressed.cend(), unpacked_array_uncompressed, false); - Point unpacked_point_uncompressed = Utilities::unpack>( - point_uncompressed.cbegin(), point_uncompressed.cend(), false); + Point unpacked_point_uncompressed = + Utilities::unpack>(point_uncompressed.cbegin(), + point_uncompressed.cend(), + false); // check if unpacked results are okay bool equal_array = true; @@ -117,8 +120,10 @@ check(const double (&array)[N], const Point(&point)) // try something nasty try { - Point forbidden = Utilities::unpack>( - point_compressed.cbegin(), point_compressed.cend(), false); + Point forbidden = + Utilities::unpack>(point_compressed.cbegin(), + point_compressed.cend(), + false); } catch (const boost::archive::archive_exception &) { @@ -128,8 +133,10 @@ check(const double (&array)[N], const Point(&point)) try { double forbidden[N]; - Utilities::unpack( - array_compressed.cbegin(), array_compressed.cend(), forbidden, false); + Utilities::unpack(array_compressed.cbegin(), + array_compressed.cend(), + forbidden, + false); } catch (const boost::archive::archive_exception &) { @@ -139,8 +146,10 @@ check(const double (&array)[N], const Point(&point)) try { - Point forbidden = Utilities::unpack>( - point_uncompressed.cbegin(), point_uncompressed.cend(), true); + Point forbidden = + Utilities::unpack>(point_uncompressed.cbegin(), + point_uncompressed.cend(), + true); } catch (const boost::archive::archive_exception &) { diff --git a/tests/base/vectorization_03.cc b/tests/base/vectorization_03.cc index 4f13ca3fcc..7dbb33fb52 100644 --- a/tests/base/vectorization_03.cc +++ b/tests/base/vectorization_03.cc @@ -56,8 +56,9 @@ initialize(Evaluation &eval) eval.is_cartesian = true; eval.cartesian_weight = random_value(); for (unsigned int i = 0; i < 4; ++i) - eval.cartesian_weight = std::max( - eval.cartesian_weight, eval.cartesian_weight * eval.cartesian_weight); + eval.cartesian_weight = + std::max(eval.cartesian_weight, + eval.cartesian_weight * eval.cartesian_weight); eval.general_weight[0] = 0.2313342 * eval.cartesian_weight; eval.jac_weight[0] = random_value(); } diff --git a/tests/base/work_stream_03.cc b/tests/base/work_stream_03.cc index 7c7ec38e39..f2d42a2ba9 100644 --- a/tests/base/work_stream_03.cc +++ b/tests/base/work_stream_03.cc @@ -56,22 +56,22 @@ namespace template struct Scratch { - Scratch(const FiniteElement &fe, const Quadrature &quadrature) : - fe_collection(fe), - quadrature_collection(quadrature), - x_fe_values(fe_collection, - quadrature_collection, - update_quadrature_points), - rhs_values(quadrature_collection.size()) + Scratch(const FiniteElement &fe, const Quadrature &quadrature) + : fe_collection(fe) + , quadrature_collection(quadrature) + , x_fe_values(fe_collection, + quadrature_collection, + update_quadrature_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_quadrature_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_quadrature_points) + , rhs_values(data.rhs_values) {} const FiniteElement &fe_collection; @@ -158,15 +158,16 @@ do_project() Scratch assembler_data(fe, q); CopyData copy_data; copy_data.cell_rhs.resize(8); - WorkStream::run( - triangulation.begin_active(), - triangulation.end(), - &mass_assembler, - std::bind(©_local_to_global, std::placeholders::_1, &sum), - assembler_data, - copy_data, - 8, - 1); + WorkStream::run(triangulation.begin_active(), + triangulation.end(), + &mass_assembler, + std::bind(©_local_to_global, + std::placeholders::_1, + &sum), + assembler_data, + copy_data, + 8, + 1); Assert(std::fabs(sum - 288.) < 1e-12, ExcInternalError()); deallog << sum << std::endl; diff --git a/tests/base/work_stream_03_graph.cc b/tests/base/work_stream_03_graph.cc index 15eacd86e2..8b43ab9061 100644 --- a/tests/base/work_stream_03_graph.cc +++ b/tests/base/work_stream_03_graph.cc @@ -53,22 +53,22 @@ namespace template struct Scratch { - Scratch(const FiniteElement &fe, const Quadrature &quadrature) : - fe_collection(fe), - quadrature_collection(quadrature), - x_fe_values(fe_collection, - quadrature_collection, - update_quadrature_points), - rhs_values(quadrature_collection.size()) + Scratch(const FiniteElement &fe, const Quadrature &quadrature) + : fe_collection(fe) + , quadrature_collection(quadrature) + , x_fe_values(fe_collection, + quadrature_collection, + update_quadrature_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_quadrature_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_quadrature_points) + , rhs_values(data.rhs_values) {} const FiniteElement &fe_collection; @@ -165,19 +165,20 @@ do_project() Scratch assembler_data(fe, q); CopyData copy_data; copy_data.cell_rhs.resize(8); - WorkStream::run( - GraphColoring::make_graph_coloring( - triangulation.begin_active(), - triangulation.end(), - std::function( - const Triangulation::active_cell_iterator &)>( - &conflictor)), - &mass_assembler, - std::bind(©_local_to_global, std::placeholders::_1, &sum), - assembler_data, - copy_data, - 8, - 1); + WorkStream::run(GraphColoring::make_graph_coloring( + triangulation.begin_active(), + triangulation.end(), + std::function( + const Triangulation::active_cell_iterator &)>( + &conflictor)), + &mass_assembler, + std::bind(©_local_to_global, + std::placeholders::_1, + &sum), + assembler_data, + copy_data, + 8, + 1); Assert(std::fabs(sum - 288.) < 1e-12, ExcInternalError()); deallog << sum << std::endl; diff --git a/tests/base/work_stream_05_graph.cc b/tests/base/work_stream_05_graph.cc index efc4092ea6..0acb9af3c2 100644 --- a/tests/base/work_stream_05_graph.cc +++ b/tests/base/work_stream_05_graph.cc @@ -75,16 +75,16 @@ test() for (unsigned int i = 0; i < 200; ++i) v.push_back(i); - WorkStream::run( - GraphColoring::make_graph_coloring( - v.begin(), - v.end(), - std::function( - const std::vector::iterator &)>(&conflictor)), - &worker, - &copier, - ScratchData(), - CopyData()); + WorkStream::run(GraphColoring::make_graph_coloring( + v.begin(), + v.end(), + std::function( + const std::vector::iterator &)>( + &conflictor)), + &worker, + &copier, + ScratchData(), + CopyData()); // now simulate what we should have gotten Vector comp(result.size()); diff --git a/tests/bits/anna_1.cc b/tests/bits/anna_1.cc index 5825174e89..1cdbdeec41 100644 --- a/tests/bits/anna_1.cc +++ b/tests/bits/anna_1.cc @@ -65,9 +65,9 @@ private: }; template -SystemTest::SystemTest() : - fe(FE_Nedelec(0), 2, FE_Q(1), 1), - dof_handler(triangulation) +SystemTest::SystemTest() + : fe(FE_Nedelec(0), 2, FE_Q(1), 1) + , dof_handler(triangulation) {} diff --git a/tests/bits/anna_2.cc b/tests/bits/anna_2.cc index 0574d4d024..2e198951cb 100644 --- a/tests/bits/anna_2.cc +++ b/tests/bits/anna_2.cc @@ -69,9 +69,9 @@ private: }; template -SystemTest::SystemTest() : - fe(FE_Nedelec(0), 2, FE_Q(1), 1), - dof_handler(triangulation) +SystemTest::SystemTest() + : fe(FE_Nedelec(0), 2, FE_Q(1), 1) + , dof_handler(triangulation) {} diff --git a/tests/bits/anna_3.cc b/tests/bits/anna_3.cc index 241ffbc136..6bdcb934a9 100644 --- a/tests/bits/anna_3.cc +++ b/tests/bits/anna_3.cc @@ -61,9 +61,9 @@ private: }; template -SystemTest::SystemTest() : - fe(FE_Nedelec(0), 2, FE_Q(1), 1), - dof_handler(triangulation) +SystemTest::SystemTest() + : fe(FE_Nedelec(0), 2, FE_Q(1), 1) + , dof_handler(triangulation) {} diff --git a/tests/bits/anna_4.cc b/tests/bits/anna_4.cc index 5871c9b102..87ff66f3c9 100644 --- a/tests/bits/anna_4.cc +++ b/tests/bits/anna_4.cc @@ -60,7 +60,8 @@ public: }; template -VectorBoundaryValues::VectorBoundaryValues() : Function(2) +VectorBoundaryValues::VectorBoundaryValues() + : Function(2) {} template @@ -101,9 +102,9 @@ private: // first component: Q1-Element, // second component: lowest order DG_Element template -FindBug::FindBug() : - fe(FE_Q(1), 1, FE_DGP(0), 1), - dof_handler(triangulation) +FindBug::FindBug() + : fe(FE_Q(1), 1, FE_DGP(0), 1) + , dof_handler(triangulation) {} @@ -194,8 +195,10 @@ FindBug::dirichlet_conditions() // get a list of those boundary DoFs which // we want to be fixed: - DoFTools::extract_boundary_dofs( - dof_handler, component_mask, fixed_dofs, boundary_ids); + DoFTools::extract_boundary_dofs(dof_handler, + component_mask, + fixed_dofs, + boundary_ids); // (Primitive) Check if the DoFs // where adjusted correctly (note diff --git a/tests/bits/anna_6.cc b/tests/bits/anna_6.cc index 288d60f00e..79583f2730 100644 --- a/tests/bits/anna_6.cc +++ b/tests/bits/anna_6.cc @@ -112,7 +112,8 @@ public: template -BoundaryFunction::BoundaryFunction() : Function(dim + 1) +BoundaryFunction::BoundaryFunction() + : Function(dim + 1) {} @@ -134,9 +135,9 @@ BoundaryFunction::vector_value(const Point &, // Construct FE with first component: Nedelec-Element, // second component: Q1_Element template -ImposeBC::ImposeBC() : - fe(FE_Nedelec(0), 1, FE_Q(1), 1), - dof_handler(triangulation) +ImposeBC::ImposeBC() + : fe(FE_Nedelec(0), 1, FE_Q(1), 1) + , dof_handler(triangulation) {} @@ -182,8 +183,10 @@ ImposeBC::test_extract_boundary_DoFs() std::vector ned_boundary_dofs(dof_handler.n_dofs()); std::set boundary_ids; boundary_ids.insert(0); - DoFTools::extract_boundary_dofs( - dof_handler, bc_component_select, ned_boundary_dofs, boundary_ids); + DoFTools::extract_boundary_dofs(dof_handler, + bc_component_select, + ned_boundary_dofs, + boundary_ids); for (unsigned int i = 0; i < dof_handler.n_dofs(); ++i) @@ -219,8 +222,10 @@ ImposeBC::test_interpolate_BC() std::vector p_boundary_dofs(dof_handler.n_dofs()); std::set boundary_ids; boundary_ids.insert(0); - DoFTools::extract_boundary_dofs( - dof_handler, bc_component_select, p_boundary_dofs, boundary_ids); + DoFTools::extract_boundary_dofs(dof_handler, + bc_component_select, + p_boundary_dofs, + boundary_ids); for (unsigned int i = 0; i < dof_handler.n_dofs(); ++i) { // error: pressure boundary DoF diff --git a/tests/bits/apply_boundary_values_01.cc b/tests/bits/apply_boundary_values_01.cc index 70123b501b..5ee9eb67e4 100644 --- a/tests/bits/apply_boundary_values_01.cc +++ b/tests/bits/apply_boundary_values_01.cc @@ -89,8 +89,10 @@ test() // applying boundary values later on, or // (2) applying them right away std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ConstantFunction(1.), boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ConstantFunction(1.), + boundary_values); std::vector local_dofs(fe.dofs_per_cell); FullMatrix local_matrix(fe.dofs_per_cell, fe.dofs_per_cell); diff --git a/tests/bits/apply_boundary_values_02.cc b/tests/bits/apply_boundary_values_02.cc index 23b44b4756..c8e57e8c2e 100644 --- a/tests/bits/apply_boundary_values_02.cc +++ b/tests/bits/apply_boundary_values_02.cc @@ -89,8 +89,10 @@ test() // applying boundary values later on, or // (2) applying them right away std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ConstantFunction(1.), boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ConstantFunction(1.), + boundary_values); std::vector local_dofs(fe.dofs_per_cell); FullMatrix local_matrix(fe.dofs_per_cell, fe.dofs_per_cell); diff --git a/tests/bits/block_sparse_matrix_1.cc b/tests/bits/block_sparse_matrix_1.cc index 941c2b5cde..e3c6798e8f 100644 --- a/tests/bits/block_sparse_matrix_1.cc +++ b/tests/bits/block_sparse_matrix_1.cc @@ -70,8 +70,9 @@ main() dof_handler.n_dofs(), dof_handler.max_couplings_between_dofs()); sparsity_pattern.block(0, 1).reinit(dof_handler.n_dofs(), 1, 1); - sparsity_pattern.block(1, 0).reinit( - 1, dof_handler.n_dofs(), dof_handler.n_dofs()); + sparsity_pattern.block(1, 0).reinit(1, + dof_handler.n_dofs(), + dof_handler.n_dofs()); sparsity_pattern.block(1, 1).reinit(1, 1, 1); sparsity_pattern.collect_sizes(); diff --git a/tests/bits/block_sparse_matrix_2.cc b/tests/bits/block_sparse_matrix_2.cc index 104fc8e761..5d0adbab48 100644 --- a/tests/bits/block_sparse_matrix_2.cc +++ b/tests/bits/block_sparse_matrix_2.cc @@ -51,8 +51,9 @@ main() dof_handler.n_dofs(), dof_handler.max_couplings_between_dofs()); sparsity_pattern.block(0, 1).reinit(dof_handler.n_dofs(), 1, 1); - sparsity_pattern.block(1, 0).reinit( - 1, dof_handler.n_dofs(), dof_handler.n_dofs()); + sparsity_pattern.block(1, 0).reinit(1, + dof_handler.n_dofs(), + dof_handler.n_dofs()); sparsity_pattern.block(1, 1).reinit(1, 1, 1); sparsity_pattern.collect_sizes(); diff --git a/tests/bits/christian_1.cc b/tests/bits/christian_1.cc index d2d8ed3374..c221e718bc 100644 --- a/tests/bits/christian_1.cc +++ b/tests/bits/christian_1.cc @@ -103,7 +103,8 @@ DoFToolsEx::transfer(const DoFHandler &source_dof, class TestFunction : public Function<2> { public: - TestFunction() : Function<2>() + TestFunction() + : Function<2>() {} virtual double value(const Point<2> &p, const unsigned int) const diff --git a/tests/bits/denis_1.cc b/tests/bits/denis_1.cc index 72a7145c9c..54e1188cd3 100644 --- a/tests/bits/denis_1.cc +++ b/tests/bits/denis_1.cc @@ -85,8 +85,9 @@ main() VectorTools::interpolate(dof_handler, F(), phi_solution); gradient_phi.reinit(triangulation.n_active_cells()); - DerivativeApproximation::approximate_gradient( - dof_handler, phi_solution, gradient_phi); + DerivativeApproximation::approximate_gradient(dof_handler, + phi_solution, + gradient_phi); gradient_phi_min = 1e30; gradient_phi_max = -1; diff --git a/tests/bits/error_estimator_01.cc b/tests/bits/error_estimator_01.cc index a9e4fa90ce..a217b0c29e 100644 --- a/tests/bits/error_estimator_01.cc +++ b/tests/bits/error_estimator_01.cc @@ -45,7 +45,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(2) + MySquareFunction() + : Function(2) {} virtual double diff --git a/tests/bits/error_estimator_02.cc b/tests/bits/error_estimator_02.cc index 2b0ec9c346..38481d0e2d 100644 --- a/tests/bits/error_estimator_02.cc +++ b/tests/bits/error_estimator_02.cc @@ -45,7 +45,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(2) + MySquareFunction() + : Function(2) {} virtual double diff --git a/tests/bits/face_orientation_and_fe_nedelec_01.cc b/tests/bits/face_orientation_and_fe_nedelec_01.cc index cc6caa3d15..b38f9686a2 100644 --- a/tests/bits/face_orientation_and_fe_nedelec_01.cc +++ b/tests/bits/face_orientation_and_fe_nedelec_01.cc @@ -67,9 +67,9 @@ template class F : public Function { public: - F(const unsigned int q, const unsigned int n_components) : - Function(n_components), - q(q) + F(const unsigned int q, const unsigned int n_components) + : Function(n_components) + , q(q) {} virtual double @@ -151,9 +151,9 @@ do_project(const Triangulation &triangulation, << std::endl; if (q <= p - order_difference) - AssertThrow( - error.l2_norm() <= 1e-10 * projection.l2_norm(), - ExcFailedProjection(error.l2_norm() / projection.l2_norm())); + AssertThrow(error.l2_norm() <= 1e-10 * projection.l2_norm(), + ExcFailedProjection(error.l2_norm() / + projection.l2_norm())); } } diff --git a/tests/bits/face_orientation_and_fe_q_01.cc b/tests/bits/face_orientation_and_fe_q_01.cc index baa8d27dba..3dbfe4788f 100644 --- a/tests/bits/face_orientation_and_fe_q_01.cc +++ b/tests/bits/face_orientation_and_fe_q_01.cc @@ -70,9 +70,9 @@ template class F : public Function { public: - F(const unsigned int q, const unsigned int n_components) : - Function(n_components), - q(q) + F(const unsigned int q, const unsigned int n_components) + : Function(n_components) + , q(q) {} virtual double @@ -154,9 +154,9 @@ do_project(const Triangulation &triangulation, << std::endl; if (q <= p - order_difference) - AssertThrow( - error.l2_norm() <= 1e-10 * projection.l2_norm(), - ExcFailedProjection(error.l2_norm() / projection.l2_norm())); + AssertThrow(error.l2_norm() <= 1e-10 * projection.l2_norm(), + ExcFailedProjection(error.l2_norm() / + projection.l2_norm())); } } diff --git a/tests/bits/face_orientation_and_fe_q_02.cc b/tests/bits/face_orientation_and_fe_q_02.cc index d375205449..1c4a531b2d 100644 --- a/tests/bits/face_orientation_and_fe_q_02.cc +++ b/tests/bits/face_orientation_and_fe_q_02.cc @@ -58,9 +58,9 @@ template class F : public Function { public: - F(const unsigned int q, const unsigned int n_components) : - Function(n_components), - q(q) + F(const unsigned int q, const unsigned int n_components) + : Function(n_components) + , q(q) {} virtual double @@ -142,9 +142,9 @@ do_project(const Triangulation &triangulation, << std::endl; if (q <= p - order_difference) - AssertThrow( - error.l2_norm() <= 1e-10 * projection.l2_norm(), - ExcFailedProjection(error.l2_norm() / projection.l2_norm())); + AssertThrow(error.l2_norm() <= 1e-10 * projection.l2_norm(), + ExcFailedProjection(error.l2_norm() / + projection.l2_norm())); } } diff --git a/tests/bits/faceq_subface_interpolation.cc b/tests/bits/faceq_subface_interpolation.cc index ca223361a7..f0d908d72f 100644 --- a/tests/bits/faceq_subface_interpolation.cc +++ b/tests/bits/faceq_subface_interpolation.cc @@ -79,8 +79,9 @@ check_this(const FiniteElement &fe1, const FiniteElement &fe2) try { face_constraints.reinit(fe2.dofs_per_face, fe1.dofs_per_face); - fe1.get_subface_interpolation_matrix( - fe2, subface, face_constraints); + fe1.get_subface_interpolation_matrix(fe2, + subface, + face_constraints); deallog << fe1.get_name() << " vs. " << fe2.get_name() << std::endl; @@ -93,8 +94,9 @@ check_this(const FiniteElement &fe1, const FiniteElement &fe2) try { face_constraints.reinit(fe1.dofs_per_face, fe2.dofs_per_face); - fe2.get_subface_interpolation_matrix( - fe1, subface, face_constraints); + fe2.get_subface_interpolation_matrix(fe1, + subface, + face_constraints); deallog << fe2.get_name() << " vs. " << fe1.get_name() << std::endl; diff --git a/tests/bits/fe_field_function_01_vector.cc b/tests/bits/fe_field_function_01_vector.cc index e1af08cf19..1123757a9f 100644 --- a/tests/bits/fe_field_function_01_vector.cc +++ b/tests/bits/fe_field_function_01_vector.cc @@ -40,7 +40,8 @@ template class F : public Function { public: - F() : Function(2) + F() + : Function(2) {} virtual void vector_value(const Point &p, Vector &v) const diff --git a/tests/bits/fe_field_function_02_vector.cc b/tests/bits/fe_field_function_02_vector.cc index b2b077ff1f..3bf5f3899b 100644 --- a/tests/bits/fe_field_function_02_vector.cc +++ b/tests/bits/fe_field_function_02_vector.cc @@ -43,7 +43,8 @@ template class F : public Function { public: - F() : Function(2) + F() + : Function(2) {} virtual void vector_value(const Point &p, Vector &v) const diff --git a/tests/bits/fe_field_function_04_vector.cc b/tests/bits/fe_field_function_04_vector.cc index bed5aad0ea..01bc73764c 100644 --- a/tests/bits/fe_field_function_04_vector.cc +++ b/tests/bits/fe_field_function_04_vector.cc @@ -40,7 +40,8 @@ template class F : public Function { public: - F() : Function(2) + F() + : Function(2) {} virtual void vector_value(const Point &p, Vector &v) const diff --git a/tests/bits/fe_field_function_05_vector.cc b/tests/bits/fe_field_function_05_vector.cc index 62db58bf05..636186a9a0 100644 --- a/tests/bits/fe_field_function_05_vector.cc +++ b/tests/bits/fe_field_function_05_vector.cc @@ -44,7 +44,8 @@ template class F : public Function { public: - F() : Function(2) + F() + : Function(2) {} virtual void vector_value(const Point &p, Vector &v) const diff --git a/tests/bits/fe_field_function_06_vector.cc b/tests/bits/fe_field_function_06_vector.cc index aa16abf8d8..d364658ce3 100644 --- a/tests/bits/fe_field_function_06_vector.cc +++ b/tests/bits/fe_field_function_06_vector.cc @@ -44,7 +44,8 @@ template class F : public Function { public: - F() : Function(2) + F() + : Function(2) {} virtual void vector_value(const Point &p, Vector &v) const diff --git a/tests/bits/fe_field_function_07_vector.cc b/tests/bits/fe_field_function_07_vector.cc index 8be331e018..40cd38d7dd 100644 --- a/tests/bits/fe_field_function_07_vector.cc +++ b/tests/bits/fe_field_function_07_vector.cc @@ -44,7 +44,8 @@ template class F : public Function { public: - F() : Function(2) + F() + : Function(2) {} virtual void diff --git a/tests/bits/fe_field_function_08_vector.cc b/tests/bits/fe_field_function_08_vector.cc index 73980f23b8..1857b22455 100644 --- a/tests/bits/fe_field_function_08_vector.cc +++ b/tests/bits/fe_field_function_08_vector.cc @@ -44,7 +44,8 @@ template class F : public Function { public: - F() : Function(2) + F() + : Function(2) {} virtual void diff --git a/tests/bits/fe_q_constraints.cc b/tests/bits/fe_q_constraints.cc index 83d4956b56..47a97fec73 100644 --- a/tests/bits/fe_q_constraints.cc +++ b/tests/bits/fe_q_constraints.cc @@ -67,7 +67,8 @@ public: template -TestFunction::TestFunction(const unsigned int p_order) : p_order(p_order) +TestFunction::TestFunction(const unsigned int p_order) + : p_order(p_order) { std::vector coeff(p_order); @@ -120,11 +121,11 @@ private: template TestFEQConstraints::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) {} @@ -141,8 +142,10 @@ TestFEQConstraints::refine_grid_random() for (unsigned int i = 0; i < n_cells; ++i) estimated_error_per_cell(i) = random_value(); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/bits/fe_tools_cpfqpm_01.cc b/tests/bits/fe_tools_cpfqpm_01.cc index 7368e3d78e..e24ba1cba6 100644 --- a/tests/bits/fe_tools_cpfqpm_01.cc +++ b/tests/bits/fe_tools_cpfqpm_01.cc @@ -58,8 +58,10 @@ check_this(const FiniteElement &fe, const FiniteElement & /*fe2*/) FullMatrix X(fe.dofs_per_cell, q_rhs.size()); - FETools::compute_projection_from_quadrature_points_matrix( - fe, q_lhs, q_rhs, X); + FETools::compute_projection_from_quadrature_points_matrix(fe, + q_lhs, + q_rhs, + X); output_matrix(X); } diff --git a/tests/bits/fe_tools_cpfqpm_02.cc b/tests/bits/fe_tools_cpfqpm_02.cc index f9000c4742..656ab175c9 100644 --- a/tests/bits/fe_tools_cpfqpm_02.cc +++ b/tests/bits/fe_tools_cpfqpm_02.cc @@ -69,8 +69,10 @@ check_this(const FiniteElement &fe, const FiniteElement & /*fe2*/) FullMatrix X(fe.dofs_per_cell, q_rhs.size()); - FETools::compute_projection_from_quadrature_points_matrix( - fe, q_lhs, q_rhs, X); + FETools::compute_projection_from_quadrature_points_matrix(fe, + q_lhs, + q_rhs, + X); // then compute the matrix that // interpolates back to the quadrature diff --git a/tests/bits/fe_tools_cpfqpm_03.cc b/tests/bits/fe_tools_cpfqpm_03.cc index 9e461d0023..efafe4be87 100644 --- a/tests/bits/fe_tools_cpfqpm_03.cc +++ b/tests/bits/fe_tools_cpfqpm_03.cc @@ -58,8 +58,10 @@ check_this(const FiniteElement &fe, const FiniteElement & /*fe2*/) FullMatrix X(fe.dofs_per_cell, q_rhs.size()); - FETools::compute_projection_from_quadrature_points_matrix( - fe, q_lhs, q_rhs, X); + FETools::compute_projection_from_quadrature_points_matrix(fe, + q_lhs, + q_rhs, + X); output_matrix(X); } diff --git a/tests/bits/fe_tools_cpfqpm_04.cc b/tests/bits/fe_tools_cpfqpm_04.cc index 4dce2ab74a..9234427a3c 100644 --- a/tests/bits/fe_tools_cpfqpm_04.cc +++ b/tests/bits/fe_tools_cpfqpm_04.cc @@ -56,16 +56,18 @@ check_this(const FiniteElement &fe, const FiniteElement & /*fe2*/) return; // test with different quadrature formulas - Quadrature q_rhs( - fe.get_unit_support_points(), - std::vector(fe.dofs_per_cell, 1. / fe.dofs_per_cell)); + Quadrature q_rhs(fe.get_unit_support_points(), + std::vector(fe.dofs_per_cell, + 1. / fe.dofs_per_cell)); FullMatrix X(fe.dofs_per_cell, q_rhs.size()); AssertThrow(X.m() == X.n(), ExcInternalError()); - FETools::compute_projection_from_quadrature_points_matrix( - fe, q_rhs, q_rhs, X); + FETools::compute_projection_from_quadrature_points_matrix(fe, + q_rhs, + q_rhs, + X); for (unsigned int i = 0; i < X.m(); ++i) X(i, i) -= 1; diff --git a/tests/bits/fe_tools_cpfqpm_05.cc b/tests/bits/fe_tools_cpfqpm_05.cc index 79b6153a03..c84240ac40 100644 --- a/tests/bits/fe_tools_cpfqpm_05.cc +++ b/tests/bits/fe_tools_cpfqpm_05.cc @@ -116,8 +116,10 @@ check_this(const FiniteElement &fe, FullMatrix X(fe.dofs_per_cell, q_rhs.size()); - FETools::compute_projection_from_quadrature_points_matrix( - fe, q_lhs, q_rhs, X); + FETools::compute_projection_from_quadrature_points_matrix(fe, + q_lhs, + q_rhs, + X); // then compute the matrix that // interpolates back to the quadrature diff --git a/tests/bits/find_cell_12.cc b/tests/bits/find_cell_12.cc index dfe6af0f78..2091a24a48 100644 --- a/tests/bits/find_cell_12.cc +++ b/tests/bits/find_cell_12.cc @@ -78,8 +78,9 @@ test() try { std::pair::active_cell_iterator, Point<2>> current_cell = - GridTools::find_active_cell_around_point( - MappingQGeneric<2>(1), triangulation, test_point); + GridTools::find_active_cell_around_point(MappingQGeneric<2>(1), + triangulation, + test_point); deallog << "cell: index = " << current_cell.first->index() << " level = " << current_cell.first->level() << std::endl; diff --git a/tests/bits/find_cell_7.cc b/tests/bits/find_cell_7.cc index e5f69a1aa8..f99526850e 100644 --- a/tests/bits/find_cell_7.cc +++ b/tests/bits/find_cell_7.cc @@ -83,8 +83,9 @@ check2() hp::DoFHandler<3> dof_handler(tria); dof_handler.distribute_dofs(fes); - GridTools::find_active_cell_around_point( - mappings, dof_handler, p2); // triggered exception + GridTools::find_active_cell_around_point(mappings, + dof_handler, + p2); // triggered exception } diff --git a/tests/bits/find_closest_vertex_1.cc b/tests/bits/find_closest_vertex_1.cc index 9295880e07..0f5c2dfb2d 100644 --- a/tests/bits/find_closest_vertex_1.cc +++ b/tests/bits/find_closest_vertex_1.cc @@ -35,8 +35,9 @@ void check(Triangulation<3> &tria) const std::vector> &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)) + << GridTools::find_closest_vertex(tria, + v[i] + + Point<3>(0.01, -0.01, 0.01)) << "] "; deallog << std::endl; diff --git a/tests/bits/gerold_1.cc b/tests/bits/gerold_1.cc index 6cdf03874b..7b25f4a947 100644 --- a/tests/bits/gerold_1.cc +++ b/tests/bits/gerold_1.cc @@ -73,7 +73,9 @@ private: template -LaplaceProblem::LaplaceProblem() : fe(1), dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : fe(1) + , dof_handler(triangulation) {} diff --git a/tests/bits/joa_1.cc b/tests/bits/joa_1.cc index 229f0e4ee0..bc549a67d2 100644 --- a/tests/bits/joa_1.cc +++ b/tests/bits/joa_1.cc @@ -179,7 +179,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -242,7 +243,9 @@ Coefficient::value_list(const std::vector> &points, // the desired polynomial degree // (here 2): template -LaplaceProblem::LaplaceProblem() : dof_handler(triangulation), fe(2) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) + , fe(2) {} @@ -609,8 +612,9 @@ LaplaceProblem::assemble_system() 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -658,10 +662,14 @@ LaplaceProblem::assemble_system() // happens *after* the elimination // of hanging nodes. std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } @@ -896,8 +904,10 @@ LaplaceProblem::refine_grid() // 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); + 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 diff --git a/tests/bits/make_boundary_constraints_01.cc b/tests/bits/make_boundary_constraints_01.cc index dae5f6ae1e..87edad98cb 100644 --- a/tests/bits/make_boundary_constraints_01.cc +++ b/tests/bits/make_boundary_constraints_01.cc @@ -87,8 +87,10 @@ test() // boundary values and boundary // constraints std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ConstantFunction(1.), boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ConstantFunction(1.), + boundary_values); ConstraintMatrix constraints; constraints.clear(); DoFTools::make_zero_boundary_constraints(dof_handler, constraints); diff --git a/tests/bits/make_boundary_constraints_02.cc b/tests/bits/make_boundary_constraints_02.cc index 9e7e973c7a..2615911485 100644 --- a/tests/bits/make_boundary_constraints_02.cc +++ b/tests/bits/make_boundary_constraints_02.cc @@ -93,8 +93,10 @@ test() // boundary values and boundary // constraints std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 1, Functions::ConstantFunction(1.), boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 1, + Functions::ConstantFunction(1.), + boundary_values); ConstraintMatrix constraints; constraints.clear(); DoFTools::make_zero_boundary_constraints(dof_handler, 1, constraints); diff --git a/tests/bits/map_dofs_to_support_points_hp_01.cc b/tests/bits/map_dofs_to_support_points_hp_01.cc index cab7bac9f5..ecc0dd595b 100644 --- a/tests/bits/map_dofs_to_support_points_hp_01.cc +++ b/tests/bits/map_dofs_to_support_points_hp_01.cc @@ -74,8 +74,9 @@ test() std::vector> 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); + DoFTools::map_dofs_to_support_points(mapping_collection, + hp_dof_handler, + hp_map); // output the elements for (unsigned int i = 0; i < hp_map.size(); i++) diff --git a/tests/bits/map_dofs_to_support_points_hp_02.cc b/tests/bits/map_dofs_to_support_points_hp_02.cc index c0ad215205..d256c1fcc8 100644 --- a/tests/bits/map_dofs_to_support_points_hp_02.cc +++ b/tests/bits/map_dofs_to_support_points_hp_02.cc @@ -69,8 +69,9 @@ test() // now map the dofs to the support points and show them on the screen std::vector> hp_map(hp_dof_handler.n_dofs()); - DoFTools::map_dofs_to_support_points( - mapping_collection, hp_dof_handler, hp_map); + DoFTools::map_dofs_to_support_points(mapping_collection, + hp_dof_handler, + hp_map); // output the elements for (unsigned int i = 0; i < hp_map.size(); i++) diff --git a/tests/bits/normals_1.cc b/tests/bits/normals_1.cc index bedf9368e2..47e6b58849 100644 --- a/tests/bits/normals_1.cc +++ b/tests/bits/normals_1.cc @@ -46,8 +46,9 @@ check(const Triangulation &tria) QGauss q_face(3); - FEFaceValues fe_face_values( - fe, q_face, update_normal_vectors | update_JxW_values); + FEFaceValues fe_face_values(fe, + q_face, + update_normal_vectors | update_JxW_values); FESubfaceValues fe_subface_values( fe, q_face, update_normal_vectors | update_JxW_values); diff --git a/tests/bits/normals_2.cc b/tests/bits/normals_2.cc index 5affea79f8..304bf6200a 100644 --- a/tests/bits/normals_2.cc +++ b/tests/bits/normals_2.cc @@ -54,8 +54,10 @@ check(const Triangulation &tria, const unsigned int order) QGauss q_face(3); - FEFaceValues fe_face_values( - mapping, fe, q_face, update_normal_vectors | update_JxW_values); + FEFaceValues fe_face_values(mapping, + fe, + q_face, + update_normal_vectors | update_JxW_values); FESubfaceValues fe_subface_values( mapping, fe, q_face, update_normal_vectors | update_JxW_values); diff --git a/tests/bits/normals_3.cc b/tests/bits/normals_3.cc index a0399ffd13..c255d23b7c 100644 --- a/tests/bits/normals_3.cc +++ b/tests/bits/normals_3.cc @@ -51,8 +51,10 @@ check(const Triangulation &tria) QGauss q_face(3); - FEFaceValues fe_face_values( - mapping, fe, q_face, update_normal_vectors | update_JxW_values); + FEFaceValues fe_face_values(mapping, + fe, + q_face, + update_normal_vectors | update_JxW_values); FESubfaceValues fe_subface_values( mapping, fe, q_face, update_normal_vectors | update_JxW_values); diff --git a/tests/bits/normals_4.cc b/tests/bits/normals_4.cc index 436f35d835..afccff2a68 100644 --- a/tests/bits/normals_4.cc +++ b/tests/bits/normals_4.cc @@ -51,8 +51,10 @@ check(const Triangulation &tria) QGauss q_face(3); - FEFaceValues fe_face_values( - mapping, fe, q_face, update_normal_vectors | update_JxW_values); + FEFaceValues fe_face_values(mapping, + fe, + q_face, + update_normal_vectors | update_JxW_values); FESubfaceValues fe_subface_values( mapping, fe, q_face, update_normal_vectors | update_JxW_values); diff --git a/tests/bits/periodic_flux_coupling_01.cc b/tests/bits/periodic_flux_coupling_01.cc index 7b064af76b..5777e1b5a9 100644 --- a/tests/bits/periodic_flux_coupling_01.cc +++ b/tests/bits/periodic_flux_coupling_01.cc @@ -62,7 +62,9 @@ private: }; template -MakeFlux::MakeFlux() : fe(1), dof_handler(triangulation) +MakeFlux::MakeFlux() + : fe(1) + , dof_handler(triangulation) {} diff --git a/tests/bits/periodicity_01.cc b/tests/bits/periodicity_01.cc index 4ef88f05eb..fd79935b45 100644 --- a/tests/bits/periodicity_01.cc +++ b/tests/bits/periodicity_01.cc @@ -43,19 +43,20 @@ test() Triangulation triangulation; std::vector repetitions(dim, 1); repetitions[0] = 2; - GridGenerator::subdivided_hyper_rectangle( - triangulation, - repetitions, - Point(), - (dim == 2 ? Point(2, 1) : Point(2, 1, 1))); + GridGenerator::subdivided_hyper_rectangle(triangulation, + repetitions, + Point(), + (dim == 2 ? Point(2, 1) : + Point(2, 1, 1))); FE_Q fe(1); DoFHandler 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); + DoFTools::make_periodicity_constraints(dof_handler.begin(0)->face(0), + (++dof_handler.begin(0))->face(1), + cm); cm.print(deallog.get_file_stream()); } diff --git a/tests/bits/periodicity_02.cc b/tests/bits/periodicity_02.cc index 048dc3f164..a03fb505cf 100644 --- a/tests/bits/periodicity_02.cc +++ b/tests/bits/periodicity_02.cc @@ -46,11 +46,11 @@ test() Triangulation triangulation; std::vector repetitions(dim, 1); repetitions[0] = 2; - GridGenerator::subdivided_hyper_rectangle( - triangulation, - repetitions, - Point(), - (dim == 2 ? Point(2, 1) : Point(2, 1, 1))); + GridGenerator::subdivided_hyper_rectangle(triangulation, + repetitions, + Point(), + (dim == 2 ? Point(2, 1) : + Point(2, 1, 1))); triangulation.begin_active()->set_refine_flag(); triangulation.execute_coarsening_and_refinement(); @@ -59,8 +59,9 @@ test() dof_handler.distribute_dofs(fe); ConstraintMatrix cm; - DoFTools::make_periodicity_constraints( - dof_handler.begin(0)->face(0), (++dof_handler.begin(0))->face(1), cm); + DoFTools::make_periodicity_constraints(dof_handler.begin(0)->face(0), + (++dof_handler.begin(0))->face(1), + cm); cm.print(deallog.get_file_stream()); } diff --git a/tests/bits/periodicity_03.cc b/tests/bits/periodicity_03.cc index 0e92b7c7c6..f1128fa0ca 100644 --- a/tests/bits/periodicity_03.cc +++ b/tests/bits/periodicity_03.cc @@ -46,11 +46,11 @@ test() Triangulation triangulation; std::vector repetitions(dim, 1); repetitions[0] = 2; - GridGenerator::subdivided_hyper_rectangle( - triangulation, - repetitions, - Point(), - (dim == 2 ? Point(2, 1) : Point(2, 1, 1))); + GridGenerator::subdivided_hyper_rectangle(triangulation, + repetitions, + Point(), + (dim == 2 ? Point(2, 1) : + Point(2, 1, 1))); triangulation.begin_active()->set_refine_flag(); triangulation.execute_coarsening_and_refinement(); triangulation.begin_active(1)->set_refine_flag(); @@ -61,8 +61,9 @@ test() dof_handler.distribute_dofs(fe); ConstraintMatrix cm; - DoFTools::make_periodicity_constraints( - dof_handler.begin(0)->face(0), (++dof_handler.begin(0))->face(1), cm); + DoFTools::make_periodicity_constraints(dof_handler.begin(0)->face(0), + (++dof_handler.begin(0))->face(1), + cm); cm.print(deallog.get_file_stream()); } diff --git a/tests/bits/periodicity_04.cc b/tests/bits/periodicity_04.cc index f67bf2eb20..5cc1512783 100644 --- a/tests/bits/periodicity_04.cc +++ b/tests/bits/periodicity_04.cc @@ -50,11 +50,11 @@ test() Triangulation triangulation; std::vector repetitions(dim, 1); repetitions[0] = 2; - GridGenerator::subdivided_hyper_rectangle( - triangulation, - repetitions, - Point(), - (dim == 2 ? Point(2, 1) : Point(2, 1, 1))); + GridGenerator::subdivided_hyper_rectangle(triangulation, + repetitions, + Point(), + (dim == 2 ? Point(2, 1) : + Point(2, 1, 1))); triangulation.begin_active()->set_refine_flag(); triangulation.execute_coarsening_and_refinement(); triangulation.begin_active(1)->set_refine_flag(); @@ -68,8 +68,10 @@ test() std::vector mask(2, true); mask[1] = false; ConstraintMatrix cm; - DoFTools::make_periodicity_constraints( - dof_handler.begin(0)->face(0), (++dof_handler.begin(0))->face(1), cm, mask); + DoFTools::make_periodicity_constraints(dof_handler.begin(0)->face(0), + (++dof_handler.begin(0))->face(1), + cm, + mask); cm.print(deallog.get_file_stream()); } diff --git a/tests/bits/periodicity_05.cc b/tests/bits/periodicity_05.cc index eeca221b27..60fcb11ae2 100644 --- a/tests/bits/periodicity_05.cc +++ b/tests/bits/periodicity_05.cc @@ -85,7 +85,9 @@ private: ConstraintMatrix constraints; }; -Deal2PeriodicBug::Deal2PeriodicBug() : fe(2), dof_handler(triangulation) +Deal2PeriodicBug::Deal2PeriodicBug() + : fe(2) + , dof_handler(triangulation) {} diff --git a/tests/bits/periodicity_06.cc b/tests/bits/periodicity_06.cc index 7b1f1e9789..5ec28a2fe5 100644 --- a/tests/bits/periodicity_06.cc +++ b/tests/bits/periodicity_06.cc @@ -106,8 +106,9 @@ make_constraint_matrix(const DoFHandler<2> &dof_handler, int version) constraints.close(); std::map> support_points; - DoFTools::map_dofs_to_support_points( - MappingQ(1), dof_handler, support_points); + DoFTools::map_dofs_to_support_points(MappingQ(1), + dof_handler, + support_points); for (const auto &line : constraints.get_lines()) for (const auto &entry : line.entries) deallog << "DoF " << line.index << " at " << support_points[line.index] @@ -121,7 +122,8 @@ template class PeriodicReference : public Function { public: - PeriodicReference() : Function() + PeriodicReference() + : Function() {} virtual double value(const Point &p, const unsigned int component = 0) const override diff --git a/tests/bits/periodicity_07.cc b/tests/bits/periodicity_07.cc index d8063f1b61..9a8f28215c 100644 --- a/tests/bits/periodicity_07.cc +++ b/tests/bits/periodicity_07.cc @@ -95,8 +95,9 @@ make_constraint_matrix(const DoFHandler<3> &dof_handler, int version) constraints.close(); std::map> support_points; - DoFTools::map_dofs_to_support_points( - MappingQ(1), dof_handler, support_points); + DoFTools::map_dofs_to_support_points(MappingQ(1), + dof_handler, + support_points); for (const auto &line : constraints.get_lines()) for (const auto &entry : line.entries) deallog << "DoF " << line.index << " at " << support_points[line.index] @@ -110,7 +111,8 @@ template class PeriodicReference : public Function { public: - PeriodicReference() : Function() + PeriodicReference() + : Function() {} virtual double value(const Point &p, const unsigned int component = 0) const override diff --git a/tests/bits/point_difference_01.cc b/tests/bits/point_difference_01.cc index 7ceda11fef..9e9177062a 100644 --- a/tests/bits/point_difference_01.cc +++ b/tests/bits/point_difference_01.cc @@ -43,7 +43,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function() + MySquareFunction() + : Function() {} virtual double @@ -64,7 +65,8 @@ template class MyExpFunction : public Function { public: - MyExpFunction() : Function() + MyExpFunction() + : Function() {} virtual double diff --git a/tests/bits/point_difference_02.cc b/tests/bits/point_difference_02.cc index 1032f42620..506b21aa5b 100644 --- a/tests/bits/point_difference_02.cc +++ b/tests/bits/point_difference_02.cc @@ -47,7 +47,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function() + MySquareFunction() + : Function() {} virtual double @@ -68,7 +69,8 @@ template class MyExpFunction : public Function { public: - MyExpFunction() : Function() + MyExpFunction() + : Function() {} virtual double diff --git a/tests/bits/point_gradient_01.cc b/tests/bits/point_gradient_01.cc index f31986af75..cee9f029ba 100644 --- a/tests/bits/point_gradient_01.cc +++ b/tests/bits/point_gradient_01.cc @@ -42,7 +42,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function() + MySquareFunction() + : Function() {} virtual double @@ -80,7 +81,8 @@ template class MyExpFunction : public Function { public: - MyExpFunction() : Function() + MyExpFunction() + : Function() {} virtual double @@ -183,10 +185,10 @@ check() VectorTools::point_gradient(dof, v, p[i], gradient); deallog << -gradient[0] << std::endl; - Assert( - std::abs((gradient[0] - function.gradient(p[i])).norm_square()) < - 1e-4, - ExcInternalError()); + Assert(std::abs( + (gradient[0] - function.gradient(p[i])).norm_square()) < + 1e-4, + ExcInternalError()); const Tensor<1, dim> scalar_gradient = VectorTools::point_gradient(dof, v, p[i]); diff --git a/tests/bits/point_gradient_02.cc b/tests/bits/point_gradient_02.cc index 34ca9cf854..d6455c0c3a 100644 --- a/tests/bits/point_gradient_02.cc +++ b/tests/bits/point_gradient_02.cc @@ -43,7 +43,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function() + MySquareFunction() + : Function() {} virtual double @@ -81,7 +82,8 @@ template class MyExpFunction : public Function { public: - MyExpFunction() : Function() + MyExpFunction() + : Function() {} virtual double @@ -185,10 +187,10 @@ check() VectorTools::point_gradient(mapping, dof, v, p[i], gradient); deallog << -gradient[0] << std::endl; - Assert( - std::abs((gradient[0] - function.gradient(p[i])).norm_square()) < - 1e-4, - ExcInternalError()); + Assert(std::abs( + (gradient[0] - function.gradient(p[i])).norm_square()) < + 1e-4, + ExcInternalError()); const Tensor<1, dim> scalar_gradient = VectorTools::point_gradient(dof, v, p[i]); diff --git a/tests/bits/point_gradient_hp_01.cc b/tests/bits/point_gradient_hp_01.cc index 3e5851eea0..44fa748da4 100644 --- a/tests/bits/point_gradient_hp_01.cc +++ b/tests/bits/point_gradient_hp_01.cc @@ -43,7 +43,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function() + MySquareFunction() + : Function() {} virtual double @@ -81,7 +82,8 @@ template class MyExpFunction : public Function { public: - MyExpFunction() : Function() + MyExpFunction() + : Function() {} virtual double @@ -197,10 +199,10 @@ check() VectorTools::point_gradient(dof_handler, v, p[i], gradient); deallog << -gradient[0] << std::endl; - Assert( - std::abs((gradient[0] - function.gradient(p[i])).norm_square()) < - 1e-4, - ExcInternalError()); + Assert(std::abs( + (gradient[0] - function.gradient(p[i])).norm_square()) < + 1e-4, + ExcInternalError()); const Tensor<1, dim> scalar_gradient = VectorTools::point_gradient(dof_handler, v, p[i]); diff --git a/tests/bits/point_gradient_hp_02.cc b/tests/bits/point_gradient_hp_02.cc index 5742ee7212..ecd7f09c5e 100644 --- a/tests/bits/point_gradient_hp_02.cc +++ b/tests/bits/point_gradient_hp_02.cc @@ -44,7 +44,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function() + MySquareFunction() + : Function() {} virtual double @@ -82,7 +83,8 @@ template class MyExpFunction : public Function { public: - MyExpFunction() : Function() + MyExpFunction() + : Function() {} virtual double @@ -207,18 +209,18 @@ check() mapping_1, dof_handler, v, p[i], gradient); deallog << -gradient[0] << std::endl; - Assert( - std::abs((gradient[0] - function.gradient(p[i])).norm_square()) < - 1e-4, - ExcInternalError()); + Assert(std::abs( + (gradient[0] - function.gradient(p[i])).norm_square()) < + 1e-4, + ExcInternalError()); VectorTools::point_gradient( mapping_2, dof_handler, v, p[i], gradient); deallog << -gradient[0] << std::endl; - Assert( - std::abs((gradient[0] - function.gradient(p[i])).norm_square()) < - 1e-4, - ExcInternalError()); + Assert(std::abs( + (gradient[0] - function.gradient(p[i])).norm_square()) < + 1e-4, + ExcInternalError()); const Tensor<1, dim> scalar_gradient_1 = VectorTools::point_gradient(mapping_1, dof_handler, v, p[i]); diff --git a/tests/bits/point_value_01.cc b/tests/bits/point_value_01.cc index 5b45d440dd..ca2ab73988 100644 --- a/tests/bits/point_value_01.cc +++ b/tests/bits/point_value_01.cc @@ -42,7 +42,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function() + MySquareFunction() + : Function() {} virtual double @@ -63,7 +64,8 @@ template class MyExpFunction : public Function { public: - MyExpFunction() : Function() + MyExpFunction() + : Function() {} virtual double diff --git a/tests/bits/point_value_02.cc b/tests/bits/point_value_02.cc index 3aed359242..77af443902 100644 --- a/tests/bits/point_value_02.cc +++ b/tests/bits/point_value_02.cc @@ -43,7 +43,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function() + MySquareFunction() + : Function() {} virtual double @@ -64,7 +65,8 @@ template class MyExpFunction : public Function { public: - MyExpFunction() : Function() + MyExpFunction() + : Function() {} virtual double diff --git a/tests/bits/point_value_hp_01.cc b/tests/bits/point_value_hp_01.cc index 5557208e2f..f6568b5109 100644 --- a/tests/bits/point_value_hp_01.cc +++ b/tests/bits/point_value_hp_01.cc @@ -43,7 +43,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function() + MySquareFunction() + : Function() {} virtual double @@ -64,7 +65,8 @@ template class MyExpFunction : public Function { public: - MyExpFunction() : Function() + MyExpFunction() + : Function() {} virtual double diff --git a/tests/bits/point_value_hp_02.cc b/tests/bits/point_value_hp_02.cc index f45a112b9b..36b1442abb 100644 --- a/tests/bits/point_value_hp_02.cc +++ b/tests/bits/point_value_hp_02.cc @@ -44,7 +44,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function() + MySquareFunction() + : Function() {} virtual double @@ -65,7 +66,8 @@ template class MyExpFunction : public Function { public: - MyExpFunction() : Function() + MyExpFunction() + : Function() {} virtual double diff --git a/tests/bits/q_points.cc b/tests/bits/q_points.cc index b2edfb2cfa..daed111c02 100644 --- a/tests/bits/q_points.cc +++ b/tests/bits/q_points.cc @@ -69,8 +69,9 @@ void create_two_cubes(Triangulation<3> &coarse_grid) // finally generate a triangulation // out of this GridReordering<3>::reorder_cells(cells); - coarse_grid.create_triangulation_compatibility( - vertices, cells, SubCellData()); + coarse_grid.create_triangulation_compatibility(vertices, + cells, + SubCellData()); } @@ -78,10 +79,12 @@ void check(Triangulation<3> &tria) { QGauss<2> quadrature(3); FE_Q<3> fe(1); - FEFaceValues<3> fe_face_values1( - fe, quadrature, update_quadrature_points | update_JxW_values); - FEFaceValues<3> fe_face_values2( - fe, quadrature, update_quadrature_points | update_JxW_values); + FEFaceValues<3> fe_face_values1(fe, + quadrature, + update_quadrature_points | update_JxW_values); + FEFaceValues<3> fe_face_values2(fe, + quadrature, + update_quadrature_points | update_JxW_values); DoFHandler<3> dof_handler(tria); dof_handler.distribute_dofs(fe); diff --git a/tests/bits/solution_transfer.cc b/tests/bits/solution_transfer.cc index 82476ed786..af2d7ef893 100644 --- a/tests/bits/solution_transfer.cc +++ b/tests/bits/solution_transfer.cc @@ -47,7 +47,8 @@ template class MyFunction : public Function { public: - MyFunction() : Function(){}; + MyFunction() + : Function(){}; virtual double value(const Point &p, const unsigned int) const diff --git a/tests/bits/static_condensation.cc b/tests/bits/static_condensation.cc index 3456e28096..68d20aff02 100644 --- a/tests/bits/static_condensation.cc +++ b/tests/bits/static_condensation.cc @@ -74,17 +74,13 @@ protected: 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)}; + 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)}; 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)}; + 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)}; template <> const Point<3> @@ -102,7 +98,8 @@ template class Solution : public Function, protected SolutionBase { public: - Solution() : Function() + Solution() + : Function() {} virtual double @@ -154,7 +151,8 @@ template class RightHandSide : public Function, protected SolutionBase { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -240,12 +238,12 @@ private: template HelmholtzProblem::HelmholtzProblem(const unsigned int fe_degree, - const RefinementMode refinement_mode) : - fe(fe_degree), - dof_handler(triangulation), - fe_trace(fe_degree), - dof_handler_trace(triangulation), - refinement_mode(refinement_mode) + const RefinementMode refinement_mode) + : fe(fe_degree) + , dof_handler(triangulation) + , fe_trace(fe_degree) + , dof_handler_trace(triangulation) + , refinement_mode(refinement_mode) { deallog << "Solving with Q" << fe_degree << " elements, " << (refinement_mode == global_refinement ? "global" : "adaptive") @@ -265,8 +263,10 @@ HelmholtzProblem::setup_system() constraints.clear(); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Solution(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Solution(), + constraints); constraints.close(); { @@ -285,14 +285,18 @@ HelmholtzProblem::setup_system() constraints_trace.clear(); DoFTools::make_hanging_node_constraints(dof_handler_trace, constraints_trace); - VectorTools::interpolate_boundary_values( - dof_handler_trace, 0, Solution(), constraints_trace); + VectorTools::interpolate_boundary_values(dof_handler_trace, + 0, + Solution(), + constraints_trace); constraints_trace.close(); { DynamicSparsityPattern csp(dof_handler_trace.n_dofs()); - DoFTools::make_sparsity_pattern( - dof_handler_trace, csp, constraints_trace, false); + DoFTools::make_sparsity_pattern(dof_handler_trace, + csp, + constraints_trace, + false); sparsity_pattern_trace.copy_from(csp); } @@ -507,8 +511,10 @@ HelmholtzProblem::solve() PreconditionSSOR<> preconditioner; preconditioner.initialize(system_matrix_trace, 1.2); - cg.solve( - system_matrix_trace, solution_trace, system_rhs_trace, preconditioner); + cg.solve(system_matrix_trace, + solution_trace, + system_rhs_trace, + preconditioner); constraints_trace.distribute(solution_trace); } diff --git a/tests/bits/step-10-high-order.cc b/tests/bits/step-10-high-order.cc index eb43fbe812..fe80f2139d 100644 --- a/tests/bits/step-10-high-order.cc +++ b/tests/bits/step-10-high-order.cc @@ -142,8 +142,10 @@ compute_pi_by_perimeter() DoFHandler dof_handler(triangulation); - FEFaceValues x_fe_face_values( - mapping, fe, quadrature, update_JxW_values); + FEFaceValues x_fe_face_values(mapping, + fe, + quadrature, + update_JxW_values); for (unsigned int refinement = 0; refinement < 2; ++refinement, triangulation.refine_global(1)) { diff --git a/tests/bits/step-10.cc b/tests/bits/step-10.cc index 8634cf0e17..fa753910d2 100644 --- a/tests/bits/step-10.cc +++ b/tests/bits/step-10.cc @@ -76,8 +76,9 @@ gnuplot_output() GridOutFlags::Gnuplot gnuplot_flags(false, 30); grid_out.set_flags(gnuplot_flags); - grid_out.write_gnuplot( - triangulation, deallog.get_file_stream(), &mapping); + grid_out.write_gnuplot(triangulation, + deallog.get_file_stream(), + &mapping); } deallog << std::endl; } @@ -108,8 +109,10 @@ compute_pi_by_area() DoFHandler dof_handler(triangulation); - FEValues x_fe_values( - mapping, dummy_fe, quadrature, update_JxW_values); + FEValues x_fe_values(mapping, + dummy_fe, + quadrature, + update_JxW_values); ConvergenceTable table; @@ -172,9 +175,11 @@ compute_pi_by_perimeter() DoFHandler dof_handler(triangulation); - FEFaceValues x_fe_face_values( - mapping, fe, quadrature, update_JxW_values); - ConvergenceTable table; + FEFaceValues x_fe_face_values(mapping, + fe, + quadrature, + update_JxW_values); + ConvergenceTable table; for (unsigned int refinement = 0; refinement < (degree != 4 ? 6 : 4); ++refinement, triangulation.refine_global(1)) diff --git a/tests/bits/step-11.cc b/tests/bits/step-11.cc index cc354e9e99..ed07e5d79d 100644 --- a/tests/bits/step-11.cc +++ b/tests/bits/step-11.cc @@ -88,10 +88,10 @@ private: template -LaplaceProblem::LaplaceProblem(const unsigned int mapping_degree) : - fe(1), - dof_handler(triangulation), - mapping(mapping_degree) +LaplaceProblem::LaplaceProblem(const unsigned int mapping_degree) + : fe(1) + , dof_handler(triangulation) + , mapping(mapping_degree) { deallog << "Using mapping with degree " << mapping_degree << ":" << std::endl << "============================" << std::endl; @@ -108,8 +108,9 @@ LaplaceProblem::setup_system() system_rhs.reinit(dof_handler.n_dofs()); std::vector boundary_dofs(dof_handler.n_dofs(), false); - DoFTools::extract_boundary_dofs( - dof_handler, std::vector(1, true), boundary_dofs); + DoFTools::extract_boundary_dofs(dof_handler, + std::vector(1, true), + boundary_dofs); const unsigned int first_boundary_dof = std::distance(boundary_dofs.begin(), @@ -136,23 +137,26 @@ template void LaplaceProblem::assemble_and_solve() { - const unsigned int gauss_degree = std::max( - static_cast(std::ceil(1. * (mapping.get_degree() + 1) / 2)), - 2U); - MatrixTools::create_laplace_matrix( - mapping, dof_handler, QGauss(gauss_degree), system_matrix); + const unsigned int gauss_degree = + std::max(static_cast( + std::ceil(1. * (mapping.get_degree() + 1) / 2)), + 2U); + MatrixTools::create_laplace_matrix(mapping, + dof_handler, + QGauss(gauss_degree), + system_matrix); VectorTools::create_right_hand_side(mapping, dof_handler, QGauss(gauss_degree), Functions::ConstantFunction(-2), system_rhs); Vector tmp(system_rhs.size()); - VectorTools::create_boundary_right_hand_side( - mapping, - dof_handler, - QGauss(gauss_degree), - Functions::ConstantFunction(1), - tmp); + VectorTools::create_boundary_right_hand_side(mapping, + dof_handler, + QGauss(gauss_degree), + Functions::ConstantFunction( + 1), + tmp); system_rhs += tmp; mean_value_constraints.condense(system_matrix); diff --git a/tests/bits/step-12.cc b/tests/bits/step-12.cc index 90c51a4c4f..3d801a39c5 100644 --- a/tests/bits/step-12.cc +++ b/tests/bits/step-12.cc @@ -175,10 +175,10 @@ private: template -DGTransportEquation::DGTransportEquation() : - beta_function(), - rhs_function(), - boundary_function() +DGTransportEquation::DGTransportEquation() + : beta_function() + , rhs_function() + , boundary_function() {} @@ -367,13 +367,13 @@ private: template -DGMethod::DGMethod() : - mapping(1), - fe(1), - dof_handler(triangulation), - quadrature(4), - face_quadrature(4), - dg() +DGMethod::DGMethod() + : mapping(1) + , fe(1) + , dof_handler(triangulation) + , quadrature(4) + , face_quadrature(4) + , dg() {} @@ -429,12 +429,18 @@ DGMethod::assemble_system1() FEValues fe_v(mapping, fe, quadrature, update_flags); FEFaceValues fe_v_face(mapping, fe, face_quadrature, face_update_flags); - FESubfaceValues fe_v_subface( - mapping, fe, face_quadrature, face_update_flags); - FEFaceValues fe_v_face_neighbor( - mapping, fe, face_quadrature, neighbor_face_update_flags); - FESubfaceValues fe_v_subface_neighbor( - mapping, fe, face_quadrature, neighbor_face_update_flags); + FESubfaceValues fe_v_subface(mapping, + fe, + face_quadrature, + face_update_flags); + FEFaceValues fe_v_face_neighbor(mapping, + fe, + face_quadrature, + neighbor_face_update_flags); + FESubfaceValues fe_v_subface_neighbor(mapping, + fe, + face_quadrature, + neighbor_face_update_flags); FullMatrix ui_vi_matrix(dofs_per_cell, dofs_per_cell); FullMatrix ue_vi_matrix(dofs_per_cell, dofs_per_cell); @@ -510,8 +516,9 @@ DGMethod::assemble_system1() 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)); + system_matrix.add(dofs[i], + dofs_neighbor[k], + ue_vi_matrix(i, k)); } } else @@ -547,8 +554,9 @@ DGMethod::assemble_system1() ExcInternalError()); fe_v_face.reinit(cell, face_no); - fe_v_subface_neighbor.reinit( - neighbor, neighbor_face_no, neighbor_subface_no); + fe_v_subface_neighbor.reinit(neighbor, + neighbor_face_no, + neighbor_subface_no); dg.assemble_face_term1(fe_v_face, fe_v_subface_neighbor, @@ -560,8 +568,9 @@ DGMethod::assemble_system1() 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)); + system_matrix.add(dofs[i], + dofs_neighbor[k], + ue_vi_matrix(i, k)); } } } @@ -596,10 +605,14 @@ DGMethod::assemble_system2() FEValues fe_v(mapping, fe, quadrature, update_flags); FEFaceValues fe_v_face(mapping, fe, face_quadrature, face_update_flags); - FESubfaceValues fe_v_subface( - mapping, fe, face_quadrature, face_update_flags); - FEFaceValues fe_v_face_neighbor( - mapping, fe, face_quadrature, neighbor_face_update_flags); + FESubfaceValues fe_v_subface(mapping, + fe, + face_quadrature, + face_update_flags); + FEFaceValues fe_v_face_neighbor(mapping, + fe, + face_quadrature, + neighbor_face_update_flags); FullMatrix ui_vi_matrix(dofs_per_cell, dofs_per_cell); @@ -678,10 +691,12 @@ DGMethod::assemble_system2() 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[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)); @@ -715,10 +730,12 @@ DGMethod::assemble_system2() 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[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)); @@ -759,8 +776,10 @@ DGMethod::refine_grid() { Vector gradient_indicator(triangulation.n_active_cells()); - DerivativeApproximation::approximate_gradient( - mapping, dof_handler, solution2, gradient_indicator); + DerivativeApproximation::approximate_gradient(mapping, + dof_handler, + solution2, + gradient_indicator); typename DoFHandler::active_cell_iterator cell = dof_handler.begin_active(), @@ -769,8 +788,10 @@ DGMethod::refine_grid() 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); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + gradient_indicator, + 0.3, + 0.1); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/bits/step-13.cc b/tests/bits/step-13.cc index 07a696c510..f94eef1a8e 100644 --- a/tests/bits/step-13.cc +++ b/tests/bits/step-13.cc @@ -119,9 +119,9 @@ namespace Evaluation template PointValueEvaluation::PointValueEvaluation( const Point &evaluation_point, - TableHandler & results_table) : - evaluation_point(evaluation_point), - results_table(results_table) + TableHandler & results_table) + : evaluation_point(evaluation_point) + , results_table(results_table) {} @@ -178,9 +178,9 @@ namespace Evaluation template SolutionOutput::SolutionOutput( const std::string & output_name_base, - const DataOutBase::OutputFormat output_format) : - output_name_base(output_name_base), - output_format(output_format) + const DataOutBase::OutputFormat output_format) + : output_name_base(output_name_base) + , output_format(output_format) {} @@ -233,7 +233,8 @@ namespace LaplaceSolver template - Base::Base(Triangulation &coarse_grid) : triangulation(&coarse_grid) + Base::Base(Triangulation &coarse_grid) + : triangulation(&coarse_grid) {} @@ -303,12 +304,12 @@ namespace LaplaceSolver Solver::Solver(Triangulation & triangulation, const FiniteElement &fe, const Quadrature & quadrature, - const Function & boundary_values) : - Base(triangulation), - fe(&fe), - quadrature(&quadrature), - dof_handler(triangulation), - boundary_values(&boundary_values) + const Function & boundary_values) + : Base(triangulation) + , fe(&fe) + , quadrature(&quadrature) + , dof_handler(triangulation) + , boundary_values(&boundary_values) {} @@ -357,8 +358,10 @@ namespace LaplaceSolver const unsigned int n_threads = MultithreadInfo::n_threads(); std::vector> - thread_ranges = Threads::split_range( - dof_handler.begin_active(), dof_handler.end(), n_threads); + thread_ranges = + Threads::split_range(dof_handler.begin_active(), + dof_handler.end(), + n_threads); Threads::Mutex mutex; Threads::ThreadGroup<> threads; @@ -374,15 +377,19 @@ namespace LaplaceSolver linear_system.hanging_node_constraints.condense(linear_system.rhs); std::map boundary_value_map; - VectorTools::interpolate_boundary_values( - dof_handler, 0, *boundary_values, boundary_value_map); + VectorTools::interpolate_boundary_values(dof_handler, + 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); + MatrixTools::apply_boundary_values(boundary_value_map, + linear_system.matrix, + solution, + linear_system.rhs); } @@ -394,8 +401,9 @@ namespace LaplaceSolver const typename DoFHandler::active_cell_iterator &end_cell, Threads::Mutex & mutex) const { - FEValues fe_values( - *fe, *quadrature, update_gradients | update_JxW_values); + FEValues 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(); @@ -425,8 +433,9 @@ namespace LaplaceSolver Threads::Mutex::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)); + linear_system.matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); }; } @@ -497,10 +506,10 @@ namespace LaplaceSolver const FiniteElement &fe, const Quadrature & quadrature, const Function & rhs_function, - const Function & boundary_values) : - Base(triangulation), - Solver(triangulation, fe, quadrature, boundary_values), - rhs_function(&rhs_function) + const Function & boundary_values) + : Base(triangulation) + , Solver(triangulation, fe, quadrature, boundary_values) + , rhs_function(&rhs_function) {} @@ -561,18 +570,17 @@ namespace LaplaceSolver template - RefinementGlobal::RefinementGlobal( - Triangulation & coarse_grid, - const FiniteElement &fe, - const Quadrature & quadrature, - const Function & rhs_function, - const Function & boundary_values) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - fe, - quadrature, - rhs_function, - boundary_values) + RefinementGlobal::RefinementGlobal(Triangulation & coarse_grid, + const FiniteElement &fe, + const Quadrature & quadrature, + const Function &rhs_function, + const Function &boundary_values) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + fe, + quadrature, + rhs_function, + boundary_values) {} @@ -607,13 +615,13 @@ namespace LaplaceSolver const FiniteElement &fe, const Quadrature & quadrature, const Function & rhs_function, - const Function &boundary_values) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - fe, - quadrature, - rhs_function, - boundary_values) + const Function &boundary_values) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + fe, + quadrature, + rhs_function, + boundary_values) {} @@ -629,8 +637,10 @@ namespace LaplaceSolver typename FunctionMap::type(), this->solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - *this->triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(*this->triangulation, + estimated_error_per_cell, + 0.3, + 0.03); this->triangulation->execute_coarsening_and_refinement(); } @@ -642,7 +652,8 @@ template class Solution : public Function { public: - Solution() : Function() + Solution() + : Function() {} virtual double @@ -668,7 +679,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -768,8 +780,9 @@ solve_problem(const std::string &solver_name) Evaluation::PointValueEvaluation postprocessor1(Point(0.5, 0.5), results_table); - Evaluation::SolutionOutput postprocessor2( - std::string("solution-") + solver_name, DataOutBase::gnuplot); + Evaluation::SolutionOutput postprocessor2(std::string("solution-") + + solver_name, + DataOutBase::gnuplot); std::list *> postprocessor_list; postprocessor_list.push_back(&postprocessor1); diff --git a/tests/bits/step-14.cc b/tests/bits/step-14.cc index 40c56a6edd..44198bc93f 100644 --- a/tests/bits/step-14.cc +++ b/tests/bits/step-14.cc @@ -117,8 +117,8 @@ namespace Evaluation template PointValueEvaluation::PointValueEvaluation( - const Point &evaluation_point) : - evaluation_point(evaluation_point) + const Point &evaluation_point) + : evaluation_point(evaluation_point) {} @@ -177,8 +177,8 @@ namespace Evaluation template PointXDerivativeEvaluation::PointXDerivativeEvaluation( - const Point &evaluation_point) : - evaluation_point(evaluation_point) + const Point &evaluation_point) + : evaluation_point(evaluation_point) {} @@ -246,8 +246,8 @@ namespace Evaluation template - GridOutput::GridOutput(const std::string &output_name_base) : - output_name_base(output_name_base) + GridOutput::GridOutput(const std::string &output_name_base) + : output_name_base(output_name_base) {} @@ -304,7 +304,8 @@ namespace LaplaceSolver template - Base::Base(Triangulation &coarse_grid) : triangulation(&coarse_grid) + Base::Base(Triangulation &coarse_grid) + : triangulation(&coarse_grid) {} @@ -386,13 +387,13 @@ namespace LaplaceSolver const FiniteElement & fe, const Quadrature & quadrature, const Quadrature &face_quadrature, - const Function & boundary_values) : - Base(triangulation), - fe(&fe), - quadrature(&quadrature), - face_quadrature(&face_quadrature), - dof_handler(triangulation), - boundary_values(&boundary_values) + const Function & boundary_values) + : Base(triangulation) + , fe(&fe) + , quadrature(&quadrature) + , face_quadrature(&face_quadrature) + , dof_handler(triangulation) + , boundary_values(&boundary_values) {} @@ -441,8 +442,10 @@ namespace LaplaceSolver const unsigned int n_threads = MultithreadInfo::n_threads(); std::vector> - thread_ranges = Threads::split_range( - dof_handler.begin_active(), dof_handler.end(), n_threads); + thread_ranges = + Threads::split_range(dof_handler.begin_active(), + dof_handler.end(), + n_threads); { Threads::Mutex mutex; @@ -459,13 +462,17 @@ namespace LaplaceSolver linear_system.hanging_node_constraints.condense(linear_system.rhs); std::map boundary_value_map; - VectorTools::interpolate_boundary_values( - dof_handler, 0, *boundary_values, boundary_value_map); + VectorTools::interpolate_boundary_values(dof_handler, + 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); + MatrixTools::apply_boundary_values(boundary_value_map, + linear_system.matrix, + solution, + linear_system.rhs); } @@ -477,8 +484,9 @@ namespace LaplaceSolver const typename DoFHandler::active_cell_iterator &end_cell, Threads::Mutex & mutex) const { - FEValues fe_values( - *fe, *quadrature, update_gradients | update_JxW_values); + FEValues 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(); @@ -507,8 +515,9 @@ namespace LaplaceSolver Threads::Mutex::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)); + linear_system.matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); }; } @@ -595,14 +604,14 @@ namespace LaplaceSolver const Quadrature & quadrature, const Quadrature &face_quadrature, const Function & rhs_function, - const Function & boundary_values) : - Base(triangulation), - Solver(triangulation, - fe, - quadrature, - face_quadrature, - boundary_values), - rhs_function(&rhs_function) + const Function & boundary_values) + : Base(triangulation) + , Solver(triangulation, + fe, + quadrature, + face_quadrature, + boundary_values) + , rhs_function(&rhs_function) {} @@ -714,14 +723,14 @@ namespace LaplaceSolver const Quadrature & quadrature, const Quadrature &face_quadrature, const Function & rhs_function, - const Function & boundary_values) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - fe, - quadrature, - face_quadrature, - rhs_function, - boundary_values) + const Function & boundary_values) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + fe, + quadrature, + face_quadrature, + rhs_function, + boundary_values) {} @@ -759,14 +768,14 @@ namespace LaplaceSolver const Quadrature & quadrature, const Quadrature &face_quadrature, const Function & rhs_function, - const Function & boundary_values) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - fe, - quadrature, - face_quadrature, - rhs_function, - boundary_values) + const Function & boundary_values) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + fe, + quadrature, + face_quadrature, + rhs_function, + boundary_values) {} @@ -782,8 +791,10 @@ namespace LaplaceSolver typename FunctionMap::type(), this->solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - *this->triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(*this->triangulation, + estimated_error_per_cell, + 0.3, + 0.03); this->triangulation->execute_coarsening_and_refinement(); } @@ -818,15 +829,15 @@ namespace LaplaceSolver const Quadrature &face_quadrature, const Function & rhs_function, const Function & boundary_values, - const Function & weighting_function) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - fe, - quadrature, - face_quadrature, - rhs_function, - boundary_values), - weighting_function(&weighting_function) + const Function & weighting_function) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + fe, + quadrature, + face_quadrature, + rhs_function, + boundary_values) + , weighting_function(&weighting_function) {} @@ -849,8 +860,10 @@ namespace LaplaceSolver for (unsigned int cell_index = 0; cell != endc; ++cell, ++cell_index) estimated_error(cell_index) *= weighting_function->value(cell->center()); - GridRefinement::refine_and_coarsen_fixed_number( - *this->triangulation, estimated_error, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(*this->triangulation, + estimated_error, + 0.3, + 0.03); this->triangulation->execute_coarsening_and_refinement(); } @@ -930,7 +943,8 @@ namespace Data class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -941,7 +955,8 @@ namespace Data class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -1012,7 +1027,8 @@ namespace Data class RightHandSide : public Functions::ConstantFunction { public: - RightHandSide() : Functions::ConstantFunction(1.) + RightHandSide() + : Functions::ConstantFunction(1.) {} }; @@ -1116,8 +1132,8 @@ namespace DualFunctional template PointValueEvaluation::PointValueEvaluation( - const Point &evaluation_point) : - evaluation_point(evaluation_point) + const Point &evaluation_point) + : evaluation_point(evaluation_point) {} @@ -1168,8 +1184,8 @@ namespace DualFunctional template PointXDerivativeEvaluation::PointXDerivativeEvaluation( - const Point &evaluation_point) : - evaluation_point(evaluation_point) + const Point &evaluation_point) + : evaluation_point(evaluation_point) {} @@ -1265,14 +1281,14 @@ namespace LaplaceSolver const FiniteElement & fe, const Quadrature & quadrature, const Quadrature & face_quadrature, - const DualFunctional::DualFunctionalBase &dual_functional) : - Base(triangulation), - Solver(triangulation, - fe, - quadrature, - face_quadrature, - boundary_values), - dual_functional(&dual_functional) + const DualFunctional::DualFunctionalBase &dual_functional) + : Base(triangulation) + , Solver(triangulation, + fe, + quadrature, + face_quadrature, + boundary_values) + , dual_functional(&dual_functional) {} @@ -1423,12 +1439,12 @@ namespace LaplaceSolver WeightedResidual::CellData::CellData( const FiniteElement &fe, const Quadrature & quadrature, - const Function & right_hand_side) : - fe_values(fe, - quadrature, - update_values | update_hessians | update_quadrature_points | - update_JxW_values), - right_hand_side(&right_hand_side) + const Function & right_hand_side) + : fe_values(fe, + quadrature, + update_values | update_hessians | update_quadrature_points | + update_JxW_values) + , right_hand_side(&right_hand_side) { const unsigned int n_q_points = quadrature.size(); @@ -1443,16 +1459,16 @@ namespace LaplaceSolver template WeightedResidual::FaceData::FaceData( const FiniteElement & fe, - const Quadrature &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 &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(); @@ -1473,19 +1489,19 @@ namespace LaplaceSolver const Quadrature & face_quadrature, const Function & rhs_function, const Function & bv, - const DualFunctional::DualFunctionalBase &dual_functional) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - primal_fe, + const DualFunctional::DualFunctionalBase &dual_functional) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + primal_fe, + quadrature, + face_quadrature, + rhs_function, + bv) + , DualSolver(coarse_grid, + dual_fe, quadrature, face_quadrature, - rhs_function, - bv), - DualSolver(coarse_grid, - dual_fe, - quadrature, - face_quadrature, - dual_functional) + dual_functional) {} @@ -1543,8 +1559,10 @@ namespace LaplaceSolver ++i) *i = std::fabs(*i); - GridRefinement::refine_and_coarsen_fixed_fraction( - *this->triangulation, error_indicators, 0.8, 0.02); + GridRefinement::refine_and_coarsen_fixed_fraction(*this->triangulation, + error_indicators, + 0.8, + 0.02); this->triangulation->execute_coarsening_and_refinement(); } @@ -1652,8 +1670,9 @@ namespace LaplaceSolver 0.5 * face_integrals[cell->face(face_no)]; }; deallog << " Estimated error=" - << std::accumulate( - error_indicators.begin(), error_indicators.end(), 0.) + << std::accumulate(error_indicators.begin(), + error_indicators.end(), + 0.) << std::endl; } @@ -1671,8 +1690,9 @@ namespace LaplaceSolver const PrimalSolver &primal_solver = *this; const DualSolver & dual_solver = *this; - CellData cell_data( - *dual_solver.fe, *dual_solver.quadrature, *primal_solver.rhs_function); + CellData cell_data(*dual_solver.fe, + *dual_solver.quadrature, + *primal_solver.rhs_function); FaceData face_data(*dual_solver.fe, *dual_solver.face_quadrature); active_cell_iterator cell = dual_solver.dof_handler.begin_active(); @@ -1934,11 +1954,11 @@ public: template -Framework::ProblemDescription::ProblemDescription() : - primal_fe_degree(1), - dual_fe_degree(2), - refinement_criterion(dual_weighted_error_estimator), - max_degrees_of_freedom(5000) +Framework::ProblemDescription::ProblemDescription() + : primal_fe_degree(1) + , dual_fe_degree(2) + , refinement_criterion(dual_weighted_error_estimator) + , max_degrees_of_freedom(5000) {} diff --git a/tests/bits/step-16.cc b/tests/bits/step-16.cc index bfcc41b6fb..76a4035e01 100644 --- a/tests/bits/step-16.cc +++ b/tests/bits/step-16.cc @@ -94,10 +94,10 @@ private: template -LaplaceProblem::LaplaceProblem() : - triangulation(Triangulation::limit_level_difference_at_vertices), - fe(1), - mg_dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : triangulation(Triangulation::limit_level_difference_at_vertices) + , fe(1) + , mg_dof_handler(triangulation) {} @@ -187,8 +187,9 @@ LaplaceProblem::assemble_system() 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); }; @@ -240,8 +241,9 @@ LaplaceProblem::assemble_multigrid() 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], local_dof_indices[j], cell_matrix(i, j)); + mg_matrices[level].add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); }; }; } diff --git a/tests/bits/step-2.cc b/tests/bits/step-2.cc index f7905e27ff..2c9ee2feb7 100644 --- a/tests/bits/step-2.cc +++ b/tests/bits/step-2.cc @@ -83,8 +83,9 @@ 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(), 20); + SparsityPattern sparsity_pattern(dof_handler.n_dofs(), + dof_handler.n_dofs(), + 20); DoFTools::make_sparsity_pattern(dof_handler, sparsity_pattern); sparsity_pattern.compress(); diff --git a/tests/bits/step-3.cc b/tests/bits/step-3.cc index 28b43c2f52..c2c5f23e85 100644 --- a/tests/bits/step-3.cc +++ b/tests/bits/step-3.cc @@ -80,7 +80,9 @@ private: }; -LaplaceProblem::LaplaceProblem() : fe(1), dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : fe(1) + , dof_handler(triangulation) {} @@ -155,8 +157,9 @@ LaplaceProblem::assemble_system() 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_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); @@ -164,10 +167,14 @@ LaplaceProblem::assemble_system() std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction<2>(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction<2>(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/tests/bits/step-4.cc b/tests/bits/step-4.cc index 8e0d49a805..cf6ea205e9 100644 --- a/tests/bits/step-4.cc +++ b/tests/bits/step-4.cc @@ -87,7 +87,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -100,7 +101,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -133,7 +135,9 @@ BoundaryValues::value(const Point &p, template -LaplaceProblem::LaplaceProblem() : fe(1), dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : fe(1) + , dof_handler(triangulation) {} @@ -220,8 +224,9 @@ LaplaceProblem::assemble_system() 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -229,10 +234,14 @@ LaplaceProblem::assemble_system() std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/tests/bits/step-4_dg_periodic.cc b/tests/bits/step-4_dg_periodic.cc index 0c9326aa42..bccc6220c2 100644 --- a/tests/bits/step-4_dg_periodic.cc +++ b/tests/bits/step-4_dg_periodic.cc @@ -143,7 +143,9 @@ private: template -Step4::Step4() : fe(1), dof_handler(triangulation) +Step4::Step4() + : fe(1) + , dof_handler(triangulation) {} diff --git a/tests/bits/step-4_dg_periodic_coupling.cc b/tests/bits/step-4_dg_periodic_coupling.cc index bb4efcf745..d70bf9c02e 100644 --- a/tests/bits/step-4_dg_periodic_coupling.cc +++ b/tests/bits/step-4_dg_periodic_coupling.cc @@ -143,7 +143,9 @@ private: template -Step4::Step4() : fe(1), dof_handler(triangulation) +Step4::Step4() + : fe(1) + , dof_handler(triangulation) {} diff --git a/tests/bits/step-5.cc b/tests/bits/step-5.cc index 1b5493b172..de5f0b8261 100644 --- a/tests/bits/step-5.cc +++ b/tests/bits/step-5.cc @@ -87,7 +87,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -139,7 +140,9 @@ Coefficient::value_list(const std::vector> &points, template -LaplaceProblem::LaplaceProblem() : fe(1), dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : fe(1) + , dof_handler(triangulation) {} @@ -221,18 +224,23 @@ LaplaceProblem::assemble_system() 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_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 boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/tests/bits/step-51.cc b/tests/bits/step-51.cc index 46ff8a81ba..3be2cf4f7e 100644 --- a/tests/bits/step-51.cc +++ b/tests/bits/step-51.cc @@ -72,18 +72,14 @@ namespace Step51 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)}; + 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)}; 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)}; + 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)}; template <> const Point<3> @@ -100,7 +96,8 @@ namespace Step51 class Solution : public Function, protected SolutionBase { public: - Solution() : Function() + Solution() + : Function() {} virtual double @@ -156,7 +153,8 @@ namespace Step51 class SolutionAndGradient : public Function, protected SolutionBase { public: - SolutionAndGradient() : Function(dim + 1) + SolutionAndGradient() + : Function(dim + 1) {} virtual void @@ -182,7 +180,8 @@ namespace Step51 class ConvectionVelocity : public TensorFunction<1, dim> { public: - ConvectionVelocity() : TensorFunction<1, dim>() + ConvectionVelocity() + : TensorFunction<1, dim>() {} virtual Tensor<1, dim> @@ -222,7 +221,8 @@ namespace Step51 class RightHandSide : public Function, protected SolutionBase { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -323,13 +323,13 @@ namespace Step51 template - HDG::HDG(const unsigned int degree) : - fe_local(FE_DGQ(degree), dim + 1), - dof_handler_local(triangulation), - fe(degree), - dof_handler(triangulation), - fe_u_post(degree + 1), - dof_handler_u_post(triangulation) + HDG::HDG(const unsigned int degree) + : fe_local(FE_DGQ(degree), dim + 1) + , dof_handler_local(triangulation) + , fe(degree) + , dof_handler(triangulation) + , fe_u_post(degree + 1) + , dof_handler_u_post(triangulation) {} @@ -378,11 +378,11 @@ namespace Step51 bool trace_reconstruct; - PerTaskData(const unsigned int n_dofs, const bool trace_reconstruct) : - cell_matrix(n_dofs, n_dofs), - cell_vector(n_dofs), - dof_indices(n_dofs), - trace_reconstruct(trace_reconstruct) + PerTaskData(const unsigned int n_dofs, const bool trace_reconstruct) + : cell_matrix(n_dofs, n_dofs) + , cell_vector(n_dofs) + , dof_indices(n_dofs) + , trace_reconstruct(trace_reconstruct) {} }; @@ -422,24 +422,26 @@ namespace Step51 const QGauss & face_quadrature_formula, const UpdateFlags local_flags, const UpdateFlags local_face_flags, - const UpdateFlags flags) : - fe_values_local(fe_local, quadrature_formula, local_flags), - fe_face_values_local(fe_local, face_quadrature_formula, local_face_flags), - fe_face_values(fe, face_quadrature_formula, flags), - ll_matrix(fe_local.dofs_per_cell, fe_local.dofs_per_cell), - lf_matrix(fe_local.dofs_per_cell, fe.dofs_per_cell), - fl_matrix(fe.dofs_per_cell, fe_local.dofs_per_cell), - tmp_matrix(fe.dofs_per_cell, fe_local.dofs_per_cell), - l_rhs(fe_local.dofs_per_cell), - tmp_rhs(fe_local.dofs_per_cell), - q_phi(fe_local.dofs_per_cell), - q_phi_div(fe_local.dofs_per_cell), - u_phi(fe_local.dofs_per_cell), - u_phi_grad(fe_local.dofs_per_cell), - tr_phi(fe.dofs_per_cell), - trace_values(face_quadrature_formula.size()), - fe_local_support_on_face(GeometryInfo::faces_per_cell), - fe_support_on_face(GeometryInfo::faces_per_cell) + const UpdateFlags flags) + : fe_values_local(fe_local, quadrature_formula, local_flags) + , fe_face_values_local(fe_local, + face_quadrature_formula, + local_face_flags) + , fe_face_values(fe, face_quadrature_formula, flags) + , ll_matrix(fe_local.dofs_per_cell, fe_local.dofs_per_cell) + , lf_matrix(fe_local.dofs_per_cell, fe.dofs_per_cell) + , fl_matrix(fe.dofs_per_cell, fe_local.dofs_per_cell) + , tmp_matrix(fe.dofs_per_cell, fe_local.dofs_per_cell) + , l_rhs(fe_local.dofs_per_cell) + , tmp_rhs(fe_local.dofs_per_cell) + , q_phi(fe_local.dofs_per_cell) + , q_phi_div(fe_local.dofs_per_cell) + , u_phi(fe_local.dofs_per_cell) + , u_phi_grad(fe_local.dofs_per_cell) + , tr_phi(fe.dofs_per_cell) + , trace_values(face_quadrature_formula.size()) + , fe_local_support_on_face(GeometryInfo::faces_per_cell) + , fe_support_on_face(GeometryInfo::faces_per_cell) { for (unsigned int face = 0; face < GeometryInfo::faces_per_cell; ++face) @@ -462,30 +464,30 @@ namespace Step51 } } - ScratchData(const ScratchData &sd) : - fe_values_local(sd.fe_values_local.get_fe(), - sd.fe_values_local.get_quadrature(), - sd.fe_values_local.get_update_flags()), - fe_face_values_local(sd.fe_face_values_local.get_fe(), - sd.fe_face_values_local.get_quadrature(), - sd.fe_face_values_local.get_update_flags()), - fe_face_values(sd.fe_face_values.get_fe(), - sd.fe_face_values.get_quadrature(), - sd.fe_face_values.get_update_flags()), - ll_matrix(sd.ll_matrix), - lf_matrix(sd.lf_matrix), - fl_matrix(sd.fl_matrix), - tmp_matrix(sd.tmp_matrix), - l_rhs(sd.l_rhs), - tmp_rhs(sd.tmp_rhs), - q_phi(sd.q_phi), - q_phi_div(sd.q_phi_div), - u_phi(sd.u_phi), - u_phi_grad(sd.u_phi_grad), - tr_phi(sd.tr_phi), - trace_values(sd.trace_values), - fe_local_support_on_face(sd.fe_local_support_on_face), - fe_support_on_face(sd.fe_support_on_face) + ScratchData(const ScratchData &sd) + : fe_values_local(sd.fe_values_local.get_fe(), + sd.fe_values_local.get_quadrature(), + sd.fe_values_local.get_update_flags()) + , fe_face_values_local(sd.fe_face_values_local.get_fe(), + sd.fe_face_values_local.get_quadrature(), + sd.fe_face_values_local.get_update_flags()) + , fe_face_values(sd.fe_face_values.get_fe(), + sd.fe_face_values.get_quadrature(), + sd.fe_face_values.get_update_flags()) + , ll_matrix(sd.ll_matrix) + , lf_matrix(sd.lf_matrix) + , fl_matrix(sd.fl_matrix) + , tmp_matrix(sd.tmp_matrix) + , l_rhs(sd.l_rhs) + , tmp_rhs(sd.tmp_rhs) + , q_phi(sd.q_phi) + , q_phi_div(sd.q_phi_div) + , u_phi(sd.u_phi) + , u_phi_grad(sd.u_phi_grad) + , tr_phi(sd.tr_phi) + , trace_values(sd.trace_values) + , fe_local_support_on_face(sd.fe_local_support_on_face) + , fe_support_on_face(sd.fe_support_on_face) {} }; @@ -508,28 +510,28 @@ namespace Step51 const FiniteElement &fe_local, const QGauss & quadrature_formula, const UpdateFlags local_flags, - const UpdateFlags flags) : - fe_values_local(fe_local, quadrature_formula, local_flags), - fe_values(fe, quadrature_formula, flags), - u_values(quadrature_formula.size()), - u_gradients(quadrature_formula.size()), - cell_matrix(fe.dofs_per_cell, fe.dofs_per_cell), - cell_rhs(fe.dofs_per_cell), - cell_sol(fe.dofs_per_cell) + const UpdateFlags flags) + : fe_values_local(fe_local, quadrature_formula, local_flags) + , fe_values(fe, quadrature_formula, flags) + , u_values(quadrature_formula.size()) + , u_gradients(quadrature_formula.size()) + , cell_matrix(fe.dofs_per_cell, fe.dofs_per_cell) + , cell_rhs(fe.dofs_per_cell) + , cell_sol(fe.dofs_per_cell) {} - PostProcessScratchData(const PostProcessScratchData &sd) : - fe_values_local(sd.fe_values_local.get_fe(), - sd.fe_values_local.get_quadrature(), - sd.fe_values_local.get_update_flags()), - fe_values(sd.fe_values.get_fe(), - sd.fe_values.get_quadrature(), - sd.fe_values.get_update_flags()), - u_values(sd.u_values), - u_gradients(sd.u_gradients), - cell_matrix(sd.cell_matrix), - cell_rhs(sd.cell_rhs), - cell_sol(sd.cell_sol) + PostProcessScratchData(const PostProcessScratchData &sd) + : fe_values_local(sd.fe_values_local.get_fe(), + sd.fe_values_local.get_quadrature(), + sd.fe_values_local.get_update_flags()) + , fe_values(sd.fe_values.get_fe(), + sd.fe_values.get_quadrature(), + sd.fe_values.get_update_flags()) + , u_values(sd.u_values) + , u_gradients(sd.u_gradients) + , cell_matrix(sd.cell_matrix) + , cell_rhs(sd.cell_rhs) + , cell_sol(sd.cell_sol) {} }; @@ -577,8 +579,10 @@ namespace Step51 ScratchData & scratch, PerTaskData & task_data) { - typename DoFHandler::active_cell_iterator loc_cell( - &triangulation, cell->level(), cell->index(), &dof_handler_local); + typename DoFHandler::active_cell_iterator loc_cell(&triangulation, + cell->level(), + cell->index(), + &dof_handler_local); const unsigned int n_q_points = scratch.fe_values_local.get_quadrature().size(); @@ -769,8 +773,9 @@ namespace Step51 { scratch.fl_matrix.mmult(scratch.tmp_matrix, scratch.ll_matrix); scratch.tmp_matrix.vmult_add(task_data.cell_vector, scratch.l_rhs); - scratch.tmp_matrix.mmult( - task_data.cell_matrix, scratch.lf_matrix, true); + scratch.tmp_matrix.mmult(task_data.cell_matrix, + scratch.lf_matrix, + true); cell->get_dof_indices(task_data.dof_indices); } else @@ -891,8 +896,10 @@ namespace Step51 PostProcessScratchData & scratch, unsigned int &) { - typename DoFHandler::active_cell_iterator loc_cell( - &triangulation, cell->level(), cell->index(), &dof_handler_local); + typename DoFHandler::active_cell_iterator loc_cell(&triangulation, + cell->level(), + cell->index(), + &dof_handler_local); scratch.fe_values_local.reinit(loc_cell); scratch.fe_values.reinit(cell); diff --git a/tests/bits/step-51p.cc b/tests/bits/step-51p.cc index 364f60fa6d..5fc7060887 100644 --- a/tests/bits/step-51p.cc +++ b/tests/bits/step-51p.cc @@ -72,18 +72,14 @@ namespace Step51 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)}; + 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)}; 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)}; + 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)}; template <> const Point<3> @@ -100,7 +96,8 @@ namespace Step51 class Solution : public Function, protected SolutionBase { public: - Solution() : Function() + Solution() + : Function() {} virtual double @@ -156,7 +153,8 @@ namespace Step51 class SolutionAndGradient : public Function, protected SolutionBase { public: - SolutionAndGradient() : Function(dim + 1) + SolutionAndGradient() + : Function(dim + 1) {} virtual void @@ -182,7 +180,8 @@ namespace Step51 class ConvectionVelocity : public TensorFunction<1, dim> { public: - ConvectionVelocity() : TensorFunction<1, dim>() + ConvectionVelocity() + : TensorFunction<1, dim>() {} virtual Tensor<1, dim> @@ -222,7 +221,8 @@ namespace Step51 class RightHandSide : public Function, protected SolutionBase { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -323,13 +323,13 @@ namespace Step51 template - HDG::HDG(const unsigned int degree) : - fe_local(FE_DGP(degree), dim + 1), - dof_handler_local(triangulation), - fe(degree), - dof_handler(triangulation), - fe_u_post(degree + 1), - dof_handler_u_post(triangulation) + HDG::HDG(const unsigned int degree) + : fe_local(FE_DGP(degree), dim + 1) + , dof_handler_local(triangulation) + , fe(degree) + , dof_handler(triangulation) + , fe_u_post(degree + 1) + , dof_handler_u_post(triangulation) {} @@ -378,11 +378,11 @@ namespace Step51 bool trace_reconstruct; - PerTaskData(const unsigned int n_dofs, const bool trace_reconstruct) : - cell_matrix(n_dofs, n_dofs), - cell_vector(n_dofs), - dof_indices(n_dofs), - trace_reconstruct(trace_reconstruct) + PerTaskData(const unsigned int n_dofs, const bool trace_reconstruct) + : cell_matrix(n_dofs, n_dofs) + , cell_vector(n_dofs) + , dof_indices(n_dofs) + , trace_reconstruct(trace_reconstruct) {} }; @@ -422,24 +422,26 @@ namespace Step51 const QGauss & face_quadrature_formula, const UpdateFlags local_flags, const UpdateFlags local_face_flags, - const UpdateFlags flags) : - fe_values_local(fe_local, quadrature_formula, local_flags), - fe_face_values_local(fe_local, face_quadrature_formula, local_face_flags), - fe_face_values(fe, face_quadrature_formula, flags), - ll_matrix(fe_local.dofs_per_cell, fe_local.dofs_per_cell), - lf_matrix(fe_local.dofs_per_cell, fe.dofs_per_cell), - fl_matrix(fe.dofs_per_cell, fe_local.dofs_per_cell), - tmp_matrix(fe.dofs_per_cell, fe_local.dofs_per_cell), - l_rhs(fe_local.dofs_per_cell), - tmp_rhs(fe_local.dofs_per_cell), - q_phi(fe_local.dofs_per_cell), - q_phi_div(fe_local.dofs_per_cell), - u_phi(fe_local.dofs_per_cell), - u_phi_grad(fe_local.dofs_per_cell), - tr_phi(fe.dofs_per_cell), - trace_values(face_quadrature_formula.size()), - fe_local_support_on_face(GeometryInfo::faces_per_cell), - fe_support_on_face(GeometryInfo::faces_per_cell) + const UpdateFlags flags) + : fe_values_local(fe_local, quadrature_formula, local_flags) + , fe_face_values_local(fe_local, + face_quadrature_formula, + local_face_flags) + , fe_face_values(fe, face_quadrature_formula, flags) + , ll_matrix(fe_local.dofs_per_cell, fe_local.dofs_per_cell) + , lf_matrix(fe_local.dofs_per_cell, fe.dofs_per_cell) + , fl_matrix(fe.dofs_per_cell, fe_local.dofs_per_cell) + , tmp_matrix(fe.dofs_per_cell, fe_local.dofs_per_cell) + , l_rhs(fe_local.dofs_per_cell) + , tmp_rhs(fe_local.dofs_per_cell) + , q_phi(fe_local.dofs_per_cell) + , q_phi_div(fe_local.dofs_per_cell) + , u_phi(fe_local.dofs_per_cell) + , u_phi_grad(fe_local.dofs_per_cell) + , tr_phi(fe.dofs_per_cell) + , trace_values(face_quadrature_formula.size()) + , fe_local_support_on_face(GeometryInfo::faces_per_cell) + , fe_support_on_face(GeometryInfo::faces_per_cell) { for (unsigned int face = 0; face < GeometryInfo::faces_per_cell; ++face) @@ -462,30 +464,30 @@ namespace Step51 } } - ScratchData(const ScratchData &sd) : - fe_values_local(sd.fe_values_local.get_fe(), - sd.fe_values_local.get_quadrature(), - sd.fe_values_local.get_update_flags()), - fe_face_values_local(sd.fe_face_values_local.get_fe(), - sd.fe_face_values_local.get_quadrature(), - sd.fe_face_values_local.get_update_flags()), - fe_face_values(sd.fe_face_values.get_fe(), - sd.fe_face_values.get_quadrature(), - sd.fe_face_values.get_update_flags()), - ll_matrix(sd.ll_matrix), - lf_matrix(sd.lf_matrix), - fl_matrix(sd.fl_matrix), - tmp_matrix(sd.tmp_matrix), - l_rhs(sd.l_rhs), - tmp_rhs(sd.tmp_rhs), - q_phi(sd.q_phi), - q_phi_div(sd.q_phi_div), - u_phi(sd.u_phi), - u_phi_grad(sd.u_phi_grad), - tr_phi(sd.tr_phi), - trace_values(sd.trace_values), - fe_local_support_on_face(sd.fe_local_support_on_face), - fe_support_on_face(sd.fe_support_on_face) + ScratchData(const ScratchData &sd) + : fe_values_local(sd.fe_values_local.get_fe(), + sd.fe_values_local.get_quadrature(), + sd.fe_values_local.get_update_flags()) + , fe_face_values_local(sd.fe_face_values_local.get_fe(), + sd.fe_face_values_local.get_quadrature(), + sd.fe_face_values_local.get_update_flags()) + , fe_face_values(sd.fe_face_values.get_fe(), + sd.fe_face_values.get_quadrature(), + sd.fe_face_values.get_update_flags()) + , ll_matrix(sd.ll_matrix) + , lf_matrix(sd.lf_matrix) + , fl_matrix(sd.fl_matrix) + , tmp_matrix(sd.tmp_matrix) + , l_rhs(sd.l_rhs) + , tmp_rhs(sd.tmp_rhs) + , q_phi(sd.q_phi) + , q_phi_div(sd.q_phi_div) + , u_phi(sd.u_phi) + , u_phi_grad(sd.u_phi_grad) + , tr_phi(sd.tr_phi) + , trace_values(sd.trace_values) + , fe_local_support_on_face(sd.fe_local_support_on_face) + , fe_support_on_face(sd.fe_support_on_face) {} }; @@ -508,28 +510,28 @@ namespace Step51 const FiniteElement &fe_local, const QGauss & quadrature_formula, const UpdateFlags local_flags, - const UpdateFlags flags) : - fe_values_local(fe_local, quadrature_formula, local_flags), - fe_values(fe, quadrature_formula, flags), - u_values(quadrature_formula.size()), - u_gradients(quadrature_formula.size()), - cell_matrix(fe.dofs_per_cell, fe.dofs_per_cell), - cell_rhs(fe.dofs_per_cell), - cell_sol(fe.dofs_per_cell) + const UpdateFlags flags) + : fe_values_local(fe_local, quadrature_formula, local_flags) + , fe_values(fe, quadrature_formula, flags) + , u_values(quadrature_formula.size()) + , u_gradients(quadrature_formula.size()) + , cell_matrix(fe.dofs_per_cell, fe.dofs_per_cell) + , cell_rhs(fe.dofs_per_cell) + , cell_sol(fe.dofs_per_cell) {} - PostProcessScratchData(const PostProcessScratchData &sd) : - fe_values_local(sd.fe_values_local.get_fe(), - sd.fe_values_local.get_quadrature(), - sd.fe_values_local.get_update_flags()), - fe_values(sd.fe_values.get_fe(), - sd.fe_values.get_quadrature(), - sd.fe_values.get_update_flags()), - u_values(sd.u_values), - u_gradients(sd.u_gradients), - cell_matrix(sd.cell_matrix), - cell_rhs(sd.cell_rhs), - cell_sol(sd.cell_sol) + PostProcessScratchData(const PostProcessScratchData &sd) + : fe_values_local(sd.fe_values_local.get_fe(), + sd.fe_values_local.get_quadrature(), + sd.fe_values_local.get_update_flags()) + , fe_values(sd.fe_values.get_fe(), + sd.fe_values.get_quadrature(), + sd.fe_values.get_update_flags()) + , u_values(sd.u_values) + , u_gradients(sd.u_gradients) + , cell_matrix(sd.cell_matrix) + , cell_rhs(sd.cell_rhs) + , cell_sol(sd.cell_sol) {} }; @@ -577,8 +579,10 @@ namespace Step51 ScratchData & scratch, PerTaskData & task_data) { - typename DoFHandler::active_cell_iterator loc_cell( - &triangulation, cell->level(), cell->index(), &dof_handler_local); + typename DoFHandler::active_cell_iterator loc_cell(&triangulation, + cell->level(), + cell->index(), + &dof_handler_local); const unsigned int n_q_points = scratch.fe_values_local.get_quadrature().size(); @@ -769,8 +773,9 @@ namespace Step51 { scratch.fl_matrix.mmult(scratch.tmp_matrix, scratch.ll_matrix); scratch.tmp_matrix.vmult_add(task_data.cell_vector, scratch.l_rhs); - scratch.tmp_matrix.mmult( - task_data.cell_matrix, scratch.lf_matrix, true); + scratch.tmp_matrix.mmult(task_data.cell_matrix, + scratch.lf_matrix, + true); cell->get_dof_indices(task_data.dof_indices); } else @@ -889,8 +894,10 @@ namespace Step51 PostProcessScratchData & scratch, unsigned int &) { - typename DoFHandler::active_cell_iterator loc_cell( - &triangulation, cell->level(), cell->index(), &dof_handler_local); + typename DoFHandler::active_cell_iterator loc_cell(&triangulation, + cell->level(), + cell->index(), + &dof_handler_local); scratch.fe_values_local.reinit(loc_cell); scratch.fe_values.reinit(cell); diff --git a/tests/bits/step-6-racoptimize-2.cc b/tests/bits/step-6-racoptimize-2.cc index d7070e44d4..edb69dd0ef 100644 --- a/tests/bits/step-6-racoptimize-2.cc +++ b/tests/bits/step-6-racoptimize-2.cc @@ -100,7 +100,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -151,7 +152,9 @@ Coefficient::value_list(const std::vector> &points, template -LaplaceProblem::LaplaceProblem() : dof_handler(triangulation), fe(2) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) + , fe(2) {} @@ -246,8 +249,9 @@ LaplaceProblem::assemble_system() 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -257,10 +261,14 @@ LaplaceProblem::assemble_system() hanging_node_constraints.condense(system_rhs); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } @@ -294,8 +302,9 @@ LaplaceProblem::refine_grid() solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_optimize( - triangulation, estimated_error_per_cell, 5); + GridRefinement::refine_and_coarsen_optimize(triangulation, + estimated_error_per_cell, + 5); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/bits/step-6-racoptimize.cc b/tests/bits/step-6-racoptimize.cc index 7c3abca776..e159bdfd52 100644 --- a/tests/bits/step-6-racoptimize.cc +++ b/tests/bits/step-6-racoptimize.cc @@ -100,7 +100,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -151,7 +152,9 @@ Coefficient::value_list(const std::vector> &points, template -LaplaceProblem::LaplaceProblem() : dof_handler(triangulation), fe(2) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) + , fe(2) {} @@ -246,8 +249,9 @@ LaplaceProblem::assemble_system() 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -257,10 +261,14 @@ LaplaceProblem::assemble_system() hanging_node_constraints.condense(system_rhs); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/tests/bits/step-6.cc b/tests/bits/step-6.cc index 7953cfd233..17b8ed9564 100644 --- a/tests/bits/step-6.cc +++ b/tests/bits/step-6.cc @@ -95,7 +95,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -146,7 +147,9 @@ Coefficient::value_list(const std::vector> &points, template -LaplaceProblem::LaplaceProblem() : dof_handler(triangulation), fe(2) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) + , fe(2) {} @@ -241,8 +244,9 @@ LaplaceProblem::assemble_system() 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -252,10 +256,14 @@ LaplaceProblem::assemble_system() hanging_node_constraints.condense(system_rhs); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } @@ -289,8 +297,10 @@ LaplaceProblem::refine_grid() solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/bits/step-7.cc b/tests/bits/step-7.cc index fe2f140303..6705327d77 100644 --- a/tests/bits/step-7.cc +++ b/tests/bits/step-7.cc @@ -73,17 +73,13 @@ protected: 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)}; + 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)}; 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)}; + 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)}; template const double SolutionBase::width = 1. / 3.; @@ -94,7 +90,8 @@ template class Solution : public Function, protected SolutionBase { public: - Solution() : Function() + Solution() + : Function() {} virtual double @@ -146,7 +143,8 @@ template class RightHandSide : public Function, protected SolutionBase { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -229,10 +227,10 @@ private: template HelmholtzProblem::HelmholtzProblem(const FiniteElement &fe, - const RefinementMode refinement_mode) : - dof_handler(triangulation), - fe(&fe), - refinement_mode(refinement_mode) + const RefinementMode refinement_mode) + : dof_handler(triangulation) + , fe(&fe) + , refinement_mode(refinement_mode) {} @@ -359,8 +357,9 @@ HelmholtzProblem::assemble_system() 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -370,10 +369,14 @@ HelmholtzProblem::assemble_system() hanging_node_constraints.condense(system_rhs); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Solution(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Solution(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/tests/bits/step-8.cc b/tests/bits/step-8.cc index 76a05ebb23..e86fb66beb 100644 --- a/tests/bits/step-8.cc +++ b/tests/bits/step-8.cc @@ -110,7 +110,8 @@ public: template -RightHandSide::RightHandSide() : Function(dim) +RightHandSide::RightHandSide() + : Function(dim) {} @@ -158,9 +159,9 @@ RightHandSide::vector_value_list( template -ElasticProblem::ElasticProblem() : - dof_handler(triangulation), - fe(FE_Q(1), dim) +ElasticProblem::ElasticProblem() + : dof_handler(triangulation) + , fe(FE_Q(1), dim) {} @@ -288,8 +289,9 @@ ElasticProblem::assemble_system() 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -299,10 +301,14 @@ ElasticProblem::assemble_system() hanging_node_constraints.condense(system_rhs); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(dim), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(dim), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } @@ -337,8 +343,10 @@ ElasticProblem::refine_grid() solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/bits/subface_interpolation.cc b/tests/bits/subface_interpolation.cc index 1400ea0e7d..bab3490bef 100644 --- a/tests/bits/subface_interpolation.cc +++ b/tests/bits/subface_interpolation.cc @@ -61,8 +61,9 @@ check_this(const FiniteElement &fe1, const FiniteElement &fe2) try { face_constraints.reinit(fe2.dofs_per_face, fe1.dofs_per_face); - fe1.get_subface_interpolation_matrix( - fe2, subface, face_constraints); + fe1.get_subface_interpolation_matrix(fe2, + subface, + face_constraints); deallog << fe1.get_name() << " vs. " << fe2.get_name() << std::endl; @@ -75,8 +76,9 @@ check_this(const FiniteElement &fe1, const FiniteElement &fe2) try { face_constraints.reinit(fe1.dofs_per_face, fe2.dofs_per_face); - fe2.get_subface_interpolation_matrix( - fe1, subface, face_constraints); + fe2.get_subface_interpolation_matrix(fe1, + subface, + face_constraints); deallog << fe2.get_name() << " vs. " << fe1.get_name() << std::endl; diff --git a/tests/bits/volume_1.cc b/tests/bits/volume_1.cc index ad3024ff3b..3bf273f633 100644 --- a/tests/bits/volume_1.cc +++ b/tests/bits/volume_1.cc @@ -45,14 +45,16 @@ check(const Triangulation &tria) QGauss q_face(3); - FEFaceValues fe_face_values( - fe, - q_face, - update_normal_vectors | update_quadrature_points | update_JxW_values); - FESubfaceValues fe_subface_values( - fe, - q_face, - update_normal_vectors | update_quadrature_points | update_JxW_values); + FEFaceValues fe_face_values(fe, + q_face, + update_normal_vectors | + update_quadrature_points | + update_JxW_values); + FESubfaceValues fe_subface_values(fe, + q_face, + update_normal_vectors | + update_quadrature_points | + update_JxW_values); double v1 = 0, v2 = 0; for (typename DoFHandler::active_cell_iterator cell = diff --git a/tests/bits/volume_2.cc b/tests/bits/volume_2.cc index 24afebfd5b..c4425a1049 100644 --- a/tests/bits/volume_2.cc +++ b/tests/bits/volume_2.cc @@ -54,16 +54,18 @@ check(const Triangulation &tria, const unsigned int order) QGauss q_face(3); - FEFaceValues fe_face_values( - mapping, - fe, - q_face, - update_normal_vectors | update_quadrature_points | update_JxW_values); - FESubfaceValues fe_subface_values( - mapping, - fe, - q_face, - update_normal_vectors | update_quadrature_points | update_JxW_values); + FEFaceValues fe_face_values(mapping, + fe, + q_face, + update_normal_vectors | + update_quadrature_points | + update_JxW_values); + FESubfaceValues fe_subface_values(mapping, + fe, + q_face, + update_normal_vectors | + update_quadrature_points | + update_JxW_values); double v1 = 0, v2 = 0; for (typename DoFHandler::active_cell_iterator cell = diff --git a/tests/bits/volume_3.cc b/tests/bits/volume_3.cc index 6d33b2a043..ad3c4e620d 100644 --- a/tests/bits/volume_3.cc +++ b/tests/bits/volume_3.cc @@ -51,16 +51,18 @@ check(const Triangulation &tria) QGauss q_face(3); - FEFaceValues fe_face_values( - mapping, - fe, - q_face, - update_normal_vectors | update_quadrature_points | update_JxW_values); - FESubfaceValues fe_subface_values( - mapping, - fe, - q_face, - update_normal_vectors | update_quadrature_points | update_JxW_values); + FEFaceValues fe_face_values(mapping, + fe, + q_face, + update_normal_vectors | + update_quadrature_points | + update_JxW_values); + FESubfaceValues fe_subface_values(mapping, + fe, + q_face, + update_normal_vectors | + update_quadrature_points | + update_JxW_values); double v1 = 0, v2 = 0; for (typename DoFHandler::active_cell_iterator cell = diff --git a/tests/bits/volume_4.cc b/tests/bits/volume_4.cc index f597865a20..3ee17d2eb0 100644 --- a/tests/bits/volume_4.cc +++ b/tests/bits/volume_4.cc @@ -51,16 +51,18 @@ check(const Triangulation &tria) QGauss q_face(3); - FEFaceValues fe_face_values( - mapping, - fe, - q_face, - update_normal_vectors | update_quadrature_points | update_JxW_values); - FESubfaceValues fe_subface_values( - mapping, - fe, - q_face, - update_normal_vectors | update_quadrature_points | update_JxW_values); + FEFaceValues fe_face_values(mapping, + fe, + q_face, + update_normal_vectors | + update_quadrature_points | + update_JxW_values); + FESubfaceValues fe_subface_values(mapping, + fe, + q_face, + update_normal_vectors | + update_quadrature_points | + update_JxW_values); double v1 = 0, v2 = 0; for (typename DoFHandler::active_cell_iterator cell = diff --git a/tests/codim_one/bem.cc b/tests/codim_one/bem.cc index a5b5c92cf5..add33ca06d 100644 --- a/tests/codim_one/bem.cc +++ b/tests/codim_one/bem.cc @@ -101,7 +101,11 @@ private: }; template -BEM::BEM() : fe(0), dof_handler(tria), fe_q(1), dof_handler_q(tria) +BEM::BEM() + : fe(0) + , dof_handler(tria) + , fe_q(1) + , dof_handler_q(tria) { velocity[0] = 1.; } @@ -176,10 +180,11 @@ BEM::assemble_system() { const QGauss quadrature_formula(2); const QGaussLog<1> qlog(1); - FEValues fe_values_i( - fe, - quadrature_formula, - update_JxW_values | update_normal_vectors | update_quadrature_points), + FEValues fe_values_i(fe, + quadrature_formula, + update_JxW_values | + update_normal_vectors | + update_quadrature_points), fe_values_j(fe, quadrature_formula, update_JxW_values | update_normal_vectors | diff --git a/tests/codim_one/boundary_indicator_01.cc b/tests/codim_one/boundary_indicator_01.cc index 02155fa864..1117ca9811 100644 --- a/tests/codim_one/boundary_indicator_01.cc +++ b/tests/codim_one/boundary_indicator_01.cc @@ -93,8 +93,9 @@ main() // surface faces std::set boundary_ids; boundary_ids.insert(0); - GridGenerator::extract_boundary_mesh( - volume_mesh, boundary_mesh, boundary_ids); + GridGenerator::extract_boundary_mesh(volume_mesh, + boundary_mesh, + boundary_ids); deallog << volume_mesh.n_active_cells() << std::endl; deallog << boundary_mesh.n_active_cells() << std::endl; diff --git a/tests/codim_one/data_out_03.cc b/tests/codim_one/data_out_03.cc index 0f39696eba..4f65e6b2b4 100644 --- a/tests/codim_one/data_out_03.cc +++ b/tests/codim_one/data_out_03.cc @@ -45,7 +45,8 @@ template class Identity : public Function { public: - Identity() : Function(dim) + Identity() + : Function(dim) {} diff --git a/tests/codim_one/error_estimator_01.cc b/tests/codim_one/error_estimator_01.cc index 8bb2fba3ef..e35d6e6812 100644 --- a/tests/codim_one/error_estimator_01.cc +++ b/tests/codim_one/error_estimator_01.cc @@ -45,7 +45,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(2) + MySquareFunction() + : Function(2) {} virtual double diff --git a/tests/codim_one/error_estimator_02.cc b/tests/codim_one/error_estimator_02.cc index cfc8e3758e..86fa469423 100644 --- a/tests/codim_one/error_estimator_02.cc +++ b/tests/codim_one/error_estimator_02.cc @@ -48,7 +48,8 @@ template class MyFunction : public Function { public: - MyFunction() : Function(1) + MyFunction() + : Function(1) {} virtual double @@ -70,7 +71,8 @@ template class MyNormalDerivative : public Function { public: - MyNormalDerivative() : Function(1) + MyNormalDerivative() + : Function(1) {} virtual double diff --git a/tests/codim_one/extract_boundary_mesh_00.cc b/tests/codim_one/extract_boundary_mesh_00.cc index 478ffe02e7..2439ece779 100644 --- a/tests/codim_one/extract_boundary_mesh_00.cc +++ b/tests/codim_one/extract_boundary_mesh_00.cc @@ -120,8 +120,10 @@ main() set boundary_ids; boundary_ids.insert(0); - surface_to_volume_mapping = GridGenerator::extract_boundary_mesh( - volume_mesh, boundary_mesh, boundary_ids); + surface_to_volume_mapping = + GridGenerator::extract_boundary_mesh(volume_mesh, + boundary_mesh, + boundary_ids); save_mesh(boundary_mesh); } diff --git a/tests/codim_one/extract_boundary_mesh_04.cc b/tests/codim_one/extract_boundary_mesh_04.cc index fcb014dbdb..d4609b479c 100644 --- a/tests/codim_one/extract_boundary_mesh_04.cc +++ b/tests/codim_one/extract_boundary_mesh_04.cc @@ -130,8 +130,10 @@ main() set boundary_ids; boundary_ids.insert(1); - surface_to_volume_mapping = GridGenerator::extract_boundary_mesh( - volume_mesh, boundary_mesh, boundary_ids); + surface_to_volume_mapping = + GridGenerator::extract_boundary_mesh(volume_mesh, + boundary_mesh, + boundary_ids); deallog << volume_mesh.n_active_cells() << std::endl; deallog << boundary_mesh.n_active_cells() << std::endl; diff --git a/tests/codim_one/extract_boundary_mesh_07.cc b/tests/codim_one/extract_boundary_mesh_07.cc index bac6065411..c39085fe29 100644 --- a/tests/codim_one/extract_boundary_mesh_07.cc +++ b/tests/codim_one/extract_boundary_mesh_07.cc @@ -70,11 +70,11 @@ namespace Step38 template - Extract_Mesh_Test::Extract_Mesh_Test() : - space_fe(spacedim), - boundary_fe(1), - space_dof_handler(volume_mesh_triangulation), - contact_dof_handler(boundary_triangulation) + Extract_Mesh_Test::Extract_Mesh_Test() + : space_fe(spacedim) + , boundary_fe(1) + , space_dof_handler(volume_mesh_triangulation) + , contact_dof_handler(boundary_triangulation) {} template @@ -89,8 +89,10 @@ namespace Step38 std::map::cell_iterator, typename DoFHandler::face_iterator> - element_assignment = GridGenerator::extract_boundary_mesh( - space_dof_handler, contact_dof_handler, boundary_ids); + element_assignment = + GridGenerator::extract_boundary_mesh(space_dof_handler, + contact_dof_handler, + boundary_ids); contact_dof_handler.distribute_dofs(boundary_fe); diff --git a/tests/codim_one/gradients.cc b/tests/codim_one/gradients.cc index 8d3e438ac4..e84f768995 100644 --- a/tests/codim_one/gradients.cc +++ b/tests/codim_one/gradients.cc @@ -84,8 +84,9 @@ test(std::string filename) const FE_DGQ fe_help(0); DoFHandler dof_handler_help(triangulation); dof_handler_help.distribute_dofs(fe_help); - FEValues fe_values_help( - fe_help, q_midpoint, update_normal_vectors); + FEValues fe_values_help(fe_help, + q_midpoint, + update_normal_vectors); deallog << "no. of cells " << triangulation.n_cells() << std::endl; deallog << "no. of dofs " << dof_handler.n_dofs() << std::endl; diff --git a/tests/codim_one/hanging_nodes_01.cc b/tests/codim_one/hanging_nodes_01.cc index 120cf8500a..8079bc0489 100644 --- a/tests/codim_one/hanging_nodes_01.cc +++ b/tests/codim_one/hanging_nodes_01.cc @@ -57,8 +57,9 @@ main() cell->face(0)->set_all_boundary_ids(1); std::set boundary_ids; boundary_ids.insert(0); - GridGenerator::extract_boundary_mesh( - volume_mesh, boundary_mesh, boundary_ids); + GridGenerator::extract_boundary_mesh(volume_mesh, + boundary_mesh, + boundary_ids); } boundary_mesh.begin_active()->set_refine_flag(); boundary_mesh.execute_coarsening_and_refinement(); diff --git a/tests/codim_one/hanging_nodes_02.cc b/tests/codim_one/hanging_nodes_02.cc index 06b9e41d8a..d5c010aecc 100644 --- a/tests/codim_one/hanging_nodes_02.cc +++ b/tests/codim_one/hanging_nodes_02.cc @@ -54,8 +54,9 @@ main() cell->face(0)->set_all_boundary_ids(1); std::set boundary_ids; boundary_ids.insert(0); - GridGenerator::extract_boundary_mesh( - volume_mesh, boundary_mesh, boundary_ids); + GridGenerator::extract_boundary_mesh(volume_mesh, + boundary_mesh, + boundary_ids); } boundary_mesh.begin_active()->set_refine_flag(); boundary_mesh.execute_coarsening_and_refinement(); diff --git a/tests/codim_one/hanging_nodes_03.cc b/tests/codim_one/hanging_nodes_03.cc index 10f6cc188b..f29e9bd849 100644 --- a/tests/codim_one/hanging_nodes_03.cc +++ b/tests/codim_one/hanging_nodes_03.cc @@ -48,8 +48,9 @@ main() cell->face(0)->set_all_boundary_ids(1); std::set boundary_ids; boundary_ids.insert(0); - GridGenerator::extract_boundary_mesh( - volume_mesh, boundary_mesh, boundary_ids); + GridGenerator::extract_boundary_mesh(volume_mesh, + boundary_mesh, + boundary_ids); } Triangulation::active_cell_iterator cell = diff --git a/tests/codim_one/integrate_log.cc b/tests/codim_one/integrate_log.cc index 457fd10a4c..645b990a81 100644 --- a/tests/codim_one/integrate_log.cc +++ b/tests/codim_one/integrate_log.cc @@ -65,8 +65,9 @@ test(const unsigned int n, DoFHandler<1> dh(tria); - FEValues<1> fe_values( - feq, qlog, update_JxW_values | update_quadrature_points), + FEValues<1> fe_values(feq, + qlog, + update_JxW_values | update_quadrature_points), fev_help(feq, qgauss, update_JxW_values | update_quadrature_points); diff --git a/tests/codim_one/integrate_log_2.cc b/tests/codim_one/integrate_log_2.cc index 5b6e6162e0..e72874b152 100644 --- a/tests/codim_one/integrate_log_2.cc +++ b/tests/codim_one/integrate_log_2.cc @@ -93,8 +93,10 @@ main() for (unsigned int nq = 2; nq < 13; ++nq) { QGaussLogR<1> quad(nq, origins[nos], alphas[nas]); - QGaussLogR<1> factored_quad( - nq, origins[nos], alphas[nas], true); + QGaussLogR<1> factored_quad(nq, + origins[nos], + alphas[nas], + true); double approx_integral = 0; double approx_integral_factored = 0; diff --git a/tests/codim_one/interpolate_boundary_values_01_vector_valued.cc b/tests/codim_one/interpolate_boundary_values_01_vector_valued.cc index 74335030e2..d05a913552 100644 --- a/tests/codim_one/interpolate_boundary_values_01_vector_valued.cc +++ b/tests/codim_one/interpolate_boundary_values_01_vector_valued.cc @@ -40,7 +40,8 @@ template class X : public Function { public: - X() : Function(dim) + X() + : Function(dim) {} double diff --git a/tests/codim_one/interpolate_boundary_values_02_vector_valued.cc b/tests/codim_one/interpolate_boundary_values_02_vector_valued.cc index d3dc4c9e86..449ed1d838 100644 --- a/tests/codim_one/interpolate_boundary_values_02_vector_valued.cc +++ b/tests/codim_one/interpolate_boundary_values_02_vector_valued.cc @@ -40,7 +40,8 @@ template class X : public Function { public: - X() : Function(dim) + X() + : Function(dim) {} double @@ -71,8 +72,10 @@ test() for (unsigned int boundary_id = 0; boundary_id < 2; ++boundary_id) { std::map bv; - VectorTools::interpolate_boundary_values( - dof_handler, boundary_id, X(), bv); + VectorTools::interpolate_boundary_values(dof_handler, + boundary_id, + X(), + bv); deallog << bv.size() << " boundary degrees of freedom" << std::endl; for (std::map::const_iterator i = @@ -95,10 +98,10 @@ test() AssertThrow(bv.find(cell->face(f)->vertex_dof_index(v, i)) != bv.end(), ExcInternalError()); - AssertThrow( - bv[cell->face(f)->vertex_dof_index(v, i)] == - X().value(cell->face(f)->vertex(v), i), - ExcInternalError()); + AssertThrow(bv[cell->face(f)->vertex_dof_index(v, i)] == + X().value(cell->face(f)->vertex(v), + i), + ExcInternalError()); } } } diff --git a/tests/codim_one/mapping_01.cc b/tests/codim_one/mapping_01.cc index c6ec6ab0e2..a55fdbca04 100644 --- a/tests/codim_one/mapping_01.cc +++ b/tests/codim_one/mapping_01.cc @@ -56,8 +56,10 @@ test() MappingQGeneric mapping(1); FE_Q fe(1); - FEValues fe_values( - mapping, fe, quadrature, update_normal_vectors); + FEValues fe_values(mapping, + fe, + quadrature, + update_normal_vectors); for (typename Triangulation::active_cell_iterator cell = boundary_mesh.begin_active(); diff --git a/tests/codim_one/mapping_02.cc b/tests/codim_one/mapping_02.cc index e40f73ae38..0c5403be49 100644 --- a/tests/codim_one/mapping_02.cc +++ b/tests/codim_one/mapping_02.cc @@ -53,8 +53,10 @@ test() MappingQ mapping(2); FE_Q fe(1); - FEValues fe_values( - mapping, fe, quadrature, update_normal_vectors); + FEValues fe_values(mapping, + fe, + quadrature, + update_normal_vectors); for (typename Triangulation::active_cell_iterator cell = boundary_mesh.begin_active(); diff --git a/tests/codim_one/mapping_q_eulerian.cc b/tests/codim_one/mapping_q_eulerian.cc index 01e18e31a2..cf442e89b0 100644 --- a/tests/codim_one/mapping_q_eulerian.cc +++ b/tests/codim_one/mapping_q_eulerian.cc @@ -67,8 +67,9 @@ test(std::string filename, unsigned int degree) grid_out.write_ucd(tria, logfile); QTrapez quad; - MappingQEulerian, spacedim> mapping( - degree, shift_dh, shift); + MappingQEulerian, spacedim> mapping(degree, + shift_dh, + shift); typename Triangulation::active_cell_iterator cell = tria.begin_active(), diff --git a/tests/codim_one/normal_vectors_01.cc b/tests/codim_one/normal_vectors_01.cc index 3da4b844ff..26672c8f10 100644 --- a/tests/codim_one/normal_vectors_01.cc +++ b/tests/codim_one/normal_vectors_01.cc @@ -50,8 +50,10 @@ test() dh.distribute_dofs(fe); - FEFaceValues fe_face_values( - mapping, fe, QTrapez(), update_normal_vectors); + FEFaceValues fe_face_values(mapping, + fe, + QTrapez(), + update_normal_vectors); for (typename DoFHandler::active_cell_iterator cell = dh.begin_active(); diff --git a/tests/codim_one/transform_01.cc b/tests/codim_one/transform_01.cc index a9ae929067..f1f6c66165 100644 --- a/tests/codim_one/transform_01.cc +++ b/tests/codim_one/transform_01.cc @@ -73,8 +73,9 @@ main() std::set boundary_ids; boundary_ids.insert(0); - GridGenerator::extract_boundary_mesh( - volume_mesh, triangulation, boundary_ids); + GridGenerator::extract_boundary_mesh(volume_mesh, + triangulation, + boundary_ids); triangulation.reset_manifold(0); GridTools::transform(&warp<3>, triangulation); diff --git a/tests/cuda/matrix_vector_common.h b/tests/cuda/matrix_vector_common.h index 3ab620fa2e..b84809e387 100644 --- a/tests/cuda/matrix_vector_common.h +++ b/tests/cuda/matrix_vector_common.h @@ -132,8 +132,9 @@ do_test(const DoFHandler &dof, const ConstraintMatrix &constraints) } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } for (unsigned i = 0; i < n_dofs; ++i) diff --git a/tests/cuda/matrix_vector_mf.h b/tests/cuda/matrix_vector_mf.h index 68e814d941..39f7ac0fce 100644 --- a/tests/cuda/matrix_vector_mf.h +++ b/tests/cuda/matrix_vector_mf.h @@ -98,8 +98,8 @@ template &data_in) : - data(data_in){}; + MatrixFreeTest(const CUDAWrappers::MatrixFree &data_in) + : data(data_in){}; void vmult(LinearAlgebra::CUDAWrappers::Vector & dst, diff --git a/tests/cuda/solver_02.cu b/tests/cuda/solver_02.cu index 95284b6623..cdf9d8a8dd 100644 --- a/tests/cuda/solver_02.cu +++ b/tests/cuda/solver_02.cu @@ -43,8 +43,10 @@ test(Utilities::CUDA::Handle &cuda_handle) for (unsigned int j = j_min; j < j_max; ++j) column_indices[i].emplace_back(j); } - sparsity_pattern.copy_from( - size, size, column_indices.begin(), column_indices.end()); + sparsity_pattern.copy_from(size, + size, + column_indices.begin(), + column_indices.end()); matrix.reinit(sparsity_pattern); for (unsigned int i = 0; i < size; ++i) { @@ -72,8 +74,9 @@ test(Utilities::CUDA::Handle &cuda_handle) rhs_dev.import(rhs_host, VectorOperation::insert); LinearAlgebra::CUDAWrappers::Vector solution_dev(size); - const std::array solver_names{ - "Cholesky", "LU_dense", "LU_host"}; + const std::array solver_names{"Cholesky", + "LU_dense", + "LU_host"}; for (auto solver_type : solver_names) { @@ -81,8 +84,9 @@ test(Utilities::CUDA::Handle &cuda_handle) CUDAWrappers::SolverDirect::AdditionalData data(solver_type); SolverControl solver_control; - CUDAWrappers::SolverDirect solver( - cuda_handle, solver_control, data); + CUDAWrappers::SolverDirect solver(cuda_handle, + solver_control, + data); solver.solve(matrix_dev, solution_dev, rhs_dev); // Move the result back to the host diff --git a/tests/cuda/sparse_matrix_01.cu b/tests/cuda/sparse_matrix_01.cu index 83120cb710..1d7db49acb 100644 --- a/tests/cuda/sparse_matrix_01.cu +++ b/tests/cuda/sparse_matrix_01.cu @@ -39,8 +39,10 @@ check_matrix(SparseMatrix const & A, int nnz = A_dev.n_nonzero_elements(); std::vector val_host(nnz); - cuda_error_code = cudaMemcpy( - &val_host[0], val_dev, nnz * sizeof(double), cudaMemcpyDeviceToHost); + cuda_error_code = cudaMemcpy(&val_host[0], + val_dev, + nnz * sizeof(double), + cudaMemcpyDeviceToHost); AssertCuda(cuda_error_code); std::vector column_index_host(nnz); diff --git a/tests/data_out/data_out.cc b/tests/data_out/data_out.cc index 76a052edf2..15bbb60877 100644 --- a/tests/data_out/data_out.cc +++ b/tests/data_out/data_out.cc @@ -73,7 +73,9 @@ private: template -LaplaceProblem::LaplaceProblem() : fe(1), dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : fe(1) + , dof_handler(triangulation) {} diff --git a/tests/data_out/data_out_08.cc b/tests/data_out/data_out_08.cc index 643895fa12..3157b81c4f 100644 --- a/tests/data_out/data_out_08.cc +++ b/tests/data_out/data_out_08.cc @@ -63,7 +63,8 @@ template class FilteredDataOut : public DataOut { public: - FilteredDataOut(const unsigned int subdomain_id) : subdomain_id(subdomain_id) + FilteredDataOut(const unsigned int subdomain_id) + : subdomain_id(subdomain_id) {} virtual typename DataOut::cell_iterator @@ -125,8 +126,9 @@ check() FilteredDataOut data_out(0); data_out.attach_dof_handler(dof_handler); - data_out.add_data_vector( - cell_data, "cell_data", DataOut::type_cell_data); + data_out.add_data_vector(cell_data, + "cell_data", + DataOut::type_cell_data); data_out.build_patches(); data_out.write_deal_II_intermediate(deallog.get_file_stream()); diff --git a/tests/data_out/data_out_11.cc b/tests/data_out/data_out_11.cc index 442c0b78c8..a9ae8e49f3 100644 --- a/tests/data_out/data_out_11.cc +++ b/tests/data_out/data_out_11.cc @@ -61,8 +61,10 @@ test() DataOut data_out; try { - data_out.add_data_vector( - dof_handler, vec, names, component_interpretation); + data_out.add_data_vector(dof_handler, + vec, + names, + component_interpretation); data_out.build_patches(mapping, 2); } catch (ExceptionBase &exc) @@ -77,8 +79,10 @@ test() data_out.attach_dof_handler(dof_handler); try { - data_out.add_data_vector( - vec, names, DataOut::type_automatic, component_interpretation); + data_out.add_data_vector(vec, + names, + DataOut::type_automatic, + component_interpretation); data_out.build_patches(mapping, 2); } catch (ExceptionBase &exc) diff --git a/tests/data_out/data_out_base_gnuplot_labels_02.cc b/tests/data_out/data_out_base_gnuplot_labels_02.cc index b07d21801a..ed6c5eac6d 100644 --- a/tests/data_out/data_out_base_gnuplot_labels_02.cc +++ b/tests/data_out/data_out_base_gnuplot_labels_02.cc @@ -38,9 +38,9 @@ class DataOutX : public DataOutInterface { public: DataOutX(const std::vector<::DataOutBase::Patch> &patches, - const std::vector & names) : - patches(patches), - names(names) + const std::vector & names) + : patches(patches) + , names(names) {} virtual const std::vector<::DataOutBase::Patch> & diff --git a/tests/data_out/data_out_complex_03_mixed.cc b/tests/data_out/data_out_complex_03_mixed.cc index 0a9acd48e0..0da569cead 100644 --- a/tests/data_out/data_out_complex_03_mixed.cc +++ b/tests/data_out/data_out_complex_03_mixed.cc @@ -73,8 +73,9 @@ check() DataOut data_out; data_out.attach_dof_handler(dof_handler); data_out.add_data_vector(v, std::vector{"field_a", "field_b"}); - data_out.add_data_vector( - w, std::vector{"real_field_a", "real_field_b"}); + data_out.add_data_vector(w, + std::vector{"real_field_a", + "real_field_b"}); data_out.build_patches(); data_out.write_gnuplot(deallog.get_file_stream()); diff --git a/tests/data_out/data_out_curved_cells.cc b/tests/data_out/data_out_curved_cells.cc index 0f268af751..e9828e42c6 100644 --- a/tests/data_out/data_out_curved_cells.cc +++ b/tests/data_out/data_out_curved_cells.cc @@ -132,8 +132,9 @@ curved_grid(std::ofstream &out) } // create triangulation Triangulation<2> triangulation; - triangulation.create_triangulation_compatibility( - vertices, cells, SubCellData()); + triangulation.create_triangulation_compatibility(vertices, + cells, + SubCellData()); // now provide everything that is // needed for solving a Laplace // equation. diff --git a/tests/data_out/data_out_faces_01.cc b/tests/data_out/data_out_faces_01.cc index 8950e7f17d..ac972ed4e5 100644 --- a/tests/data_out/data_out_faces_01.cc +++ b/tests/data_out/data_out_faces_01.cc @@ -40,10 +40,12 @@ my_check_this(const DoFHandler &dof_handler, { DataOutFaces data_out_faces; data_out_faces.attach_dof_handler(dof_handler); - data_out_faces.add_data_vector( - v_node, "node_data", DataOutFaces::type_dof_data); - data_out_faces.add_data_vector( - v_cell, "cell_data", DataOutFaces::type_cell_data); + data_out_faces.add_data_vector(v_node, + "node_data", + DataOutFaces::type_dof_data); + data_out_faces.add_data_vector(v_cell, + "cell_data", + DataOutFaces::type_cell_data); data_out_faces.build_patches(); data_out_faces.write_dx(deallog.get_file_stream()); diff --git a/tests/data_out/data_out_faces_02.cc b/tests/data_out/data_out_faces_02.cc index adb1951c1a..94d3ac3e00 100644 --- a/tests/data_out/data_out_faces_02.cc +++ b/tests/data_out/data_out_faces_02.cc @@ -46,10 +46,12 @@ my_check_this(const DoFHandler &dof_handler, DataOutFaces data_out_faces; data_out_faces.attach_dof_handler(dof_handler); - data_out_faces.add_data_vector( - v_node, "node_data", DataOutFaces::type_dof_data); - data_out_faces.add_data_vector( - v_cell, "cell_data", DataOutFaces::type_cell_data); + data_out_faces.add_data_vector(v_node, + "node_data", + DataOutFaces::type_dof_data); + data_out_faces.add_data_vector(v_cell, + "cell_data", + DataOutFaces::type_cell_data); data_out_faces.build_patches(); data_out_faces.write_dx(deallog.get_file_stream()); diff --git a/tests/data_out/data_out_faces_postprocessor_scalar_02.cc b/tests/data_out/data_out_faces_postprocessor_scalar_02.cc index 1ab77b3991..c889916ccf 100644 --- a/tests/data_out/data_out_faces_postprocessor_scalar_02.cc +++ b/tests/data_out/data_out_faces_postprocessor_scalar_02.cc @@ -49,7 +49,8 @@ template class MyPostprocessor : public DataPostprocessorScalar { public: - MyPostprocessor() : DataPostprocessorScalar("data", update_values) + MyPostprocessor() + : DataPostprocessorScalar("data", update_values) {} virtual void diff --git a/tests/data_out/data_out_faces_postprocessor_vector_02.cc b/tests/data_out/data_out_faces_postprocessor_vector_02.cc index 0be9e8b105..50cf1cdbbc 100644 --- a/tests/data_out/data_out_faces_postprocessor_vector_02.cc +++ b/tests/data_out/data_out_faces_postprocessor_vector_02.cc @@ -49,7 +49,8 @@ template class MyPostprocessor : public DataPostprocessorVector { public: - MyPostprocessor() : DataPostprocessorVector("data", update_values) + MyPostprocessor() + : DataPostprocessorVector("data", update_values) {} virtual void diff --git a/tests/data_out/data_out_hdf5_02.cc b/tests/data_out/data_out_hdf5_02.cc index c122a0e0db..33826730c3 100644 --- a/tests/data_out/data_out_hdf5_02.cc +++ b/tests/data_out/data_out_hdf5_02.cc @@ -101,8 +101,10 @@ check() std::string output_basename = std::to_string(dim) + std::to_string(spacedim); - DataOutBase::write_hdf5_parallel( - patches, data_filter, output_basename + ".h5", MPI_COMM_SELF); + DataOutBase::write_hdf5_parallel(patches, + data_filter, + output_basename + ".h5", + MPI_COMM_SELF); const double current_time = 0.0; XDMFEntry entry(output_basename + ".h5", diff --git a/tests/data_out/data_out_postprocessor_01-new.cc b/tests/data_out/data_out_postprocessor_01-new.cc index 2352ab19bb..853affb962 100644 --- a/tests/data_out/data_out_postprocessor_01-new.cc +++ b/tests/data_out/data_out_postprocessor_01-new.cc @@ -71,9 +71,9 @@ private: template -LaplaceProblem::LaplaceProblem() : - fe(FE_Q(1), 2), - dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : fe(FE_Q(1), 2) + , dof_handler(triangulation) {} @@ -97,7 +97,8 @@ template class SinesAndCosines : public Function { public: - SinesAndCosines() : Function(2) + SinesAndCosines() + : Function(2) {} double diff --git a/tests/data_out/data_out_postprocessor_scalar_01-new.cc b/tests/data_out/data_out_postprocessor_scalar_01-new.cc index 915b7543e5..7a848ee36c 100644 --- a/tests/data_out/data_out_postprocessor_scalar_01-new.cc +++ b/tests/data_out/data_out_postprocessor_scalar_01-new.cc @@ -74,9 +74,9 @@ private: template -LaplaceProblem::LaplaceProblem() : - fe(FE_Q(1), 2), - dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : fe(FE_Q(1), 2) + , dof_handler(triangulation) {} @@ -100,7 +100,8 @@ template class SinesAndCosines : public Function { public: - SinesAndCosines() : Function(2) + SinesAndCosines() + : Function(2) {} double @@ -136,7 +137,8 @@ template class MyPostprocessor : public DataPostprocessorScalar { public: - MyPostprocessor() : DataPostprocessorScalar("magnitude", update_values) + MyPostprocessor() + : DataPostprocessorScalar("magnitude", update_values) {} virtual void diff --git a/tests/data_out/data_out_postprocessor_scalar_02.cc b/tests/data_out/data_out_postprocessor_scalar_02.cc index c19bfaec51..3b794c3626 100644 --- a/tests/data_out/data_out_postprocessor_scalar_02.cc +++ b/tests/data_out/data_out_postprocessor_scalar_02.cc @@ -49,7 +49,8 @@ template class MyPostprocessor : public DataPostprocessorScalar { public: - MyPostprocessor() : DataPostprocessorScalar("data", update_values) + MyPostprocessor() + : DataPostprocessorScalar("data", update_values) {} virtual void diff --git a/tests/data_out/data_out_postprocessor_tensor_01.cc b/tests/data_out/data_out_postprocessor_tensor_01.cc index 4f685ab9fa..2ccc13d8ac 100644 --- a/tests/data_out/data_out_postprocessor_tensor_01.cc +++ b/tests/data_out/data_out_postprocessor_tensor_01.cc @@ -128,9 +128,9 @@ namespace Step8 template - ElasticProblem::ElasticProblem() : - dof_handler(triangulation), - fe(FE_Q(1), dim) + ElasticProblem::ElasticProblem() + : dof_handler(triangulation) + , fe(FE_Q(1), dim) {} @@ -252,8 +252,9 @@ namespace Step8 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -263,10 +264,14 @@ namespace Step8 hanging_node_constraints.condense(system_rhs); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(dim), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(dim), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } @@ -300,8 +305,10 @@ namespace Step8 solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } @@ -312,8 +319,8 @@ namespace Step8 class StrainPostprocessor : public DataPostprocessorTensor { public: - StrainPostprocessor() : - DataPostprocessorTensor("strain", update_gradients) + StrainPostprocessor() + : DataPostprocessorTensor("strain", update_gradients) {} virtual void diff --git a/tests/data_out/data_out_postprocessor_vector_01-new.cc b/tests/data_out/data_out_postprocessor_vector_01-new.cc index 40353d8087..3fa33c223f 100644 --- a/tests/data_out/data_out_postprocessor_vector_01-new.cc +++ b/tests/data_out/data_out_postprocessor_vector_01-new.cc @@ -74,9 +74,9 @@ private: template -LaplaceProblem::LaplaceProblem() : - fe(FE_Q(1), 2), - dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : fe(FE_Q(1), 2) + , dof_handler(triangulation) {} @@ -100,7 +100,8 @@ template class SinesAndCosines : public Function { public: - SinesAndCosines() : Function(2) + SinesAndCosines() + : Function(2) {} double @@ -136,8 +137,8 @@ template class MyPostprocessor : public DataPostprocessorVector { public: - MyPostprocessor() : - DataPostprocessorVector("magnitude_times_d", update_values) + MyPostprocessor() + : DataPostprocessorVector("magnitude_times_d", update_values) {} virtual void diff --git a/tests/data_out/data_out_postprocessor_vector_02.cc b/tests/data_out/data_out_postprocessor_vector_02.cc index 3bd4724d48..16f53594ab 100644 --- a/tests/data_out/data_out_postprocessor_vector_02.cc +++ b/tests/data_out/data_out_postprocessor_vector_02.cc @@ -49,7 +49,8 @@ template class MyPostprocessor : public DataPostprocessorVector { public: - MyPostprocessor() : DataPostprocessorVector("data", update_values) + MyPostprocessor() + : DataPostprocessorVector("data", update_values) {} virtual void diff --git a/tests/data_out/data_out_postprocessor_vector_03.cc b/tests/data_out/data_out_postprocessor_vector_03.cc index 297016da93..8cdb9a0975 100644 --- a/tests/data_out/data_out_postprocessor_vector_03.cc +++ b/tests/data_out/data_out_postprocessor_vector_03.cc @@ -111,7 +111,9 @@ coefficient(const Point &p) template -Step6::Step6() : dof_handler(triangulation), fe(2) +Step6::Step6() + : dof_handler(triangulation) + , fe(2) {} @@ -138,8 +140,10 @@ Step6::setup_system() DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + ZeroFunction(), + constraints); constraints.close(); @@ -239,8 +243,10 @@ Step6::refine_grid() solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } @@ -250,9 +256,9 @@ template class HeatFluxPostprocessor : public DataPostprocessorVector { public: - HeatFluxPostprocessor() : - // like above, but now also make sure that DataOut provides - // us with coordinates of the evaluation points: + HeatFluxPostprocessor() + : // like above, but now also make sure that DataOut provides + // us with coordinates of the evaluation points: DataPostprocessorVector("heatflux", update_gradients | update_quadrature_points) {} diff --git a/tests/data_out/data_out_rotation_01.cc b/tests/data_out/data_out_rotation_01.cc index 0fd35635a4..e3bb241c81 100644 --- a/tests/data_out/data_out_rotation_01.cc +++ b/tests/data_out/data_out_rotation_01.cc @@ -40,10 +40,12 @@ my_check_this(const DoFHandler &dof_handler, { DataOutRotation data_out_rotation; data_out_rotation.attach_dof_handler(dof_handler); - data_out_rotation.add_data_vector( - v_node, "node_data", DataOutRotation::type_dof_data); - data_out_rotation.add_data_vector( - v_cell, "cell_data", DataOutRotation::type_cell_data); + data_out_rotation.add_data_vector(v_node, + "node_data", + DataOutRotation::type_dof_data); + data_out_rotation.add_data_vector(v_cell, + "cell_data", + DataOutRotation::type_cell_data); data_out_rotation.build_patches(4); data_out_rotation.write_dx(deallog.get_file_stream()); diff --git a/tests/data_out/data_out_rotation_02.cc b/tests/data_out/data_out_rotation_02.cc index 38b342480d..4ecfb8e9cd 100644 --- a/tests/data_out/data_out_rotation_02.cc +++ b/tests/data_out/data_out_rotation_02.cc @@ -47,10 +47,12 @@ my_check_this(const DoFHandler &dof_handler, DataOutRotation data_out_rotation; data_out_rotation.attach_dof_handler(dof_handler); - data_out_rotation.add_data_vector( - v_node, "node_data", DataOutRotation::type_dof_data); - data_out_rotation.add_data_vector( - v_cell, "cell_data", DataOutRotation::type_cell_data); + data_out_rotation.add_data_vector(v_node, + "node_data", + DataOutRotation::type_dof_data); + data_out_rotation.add_data_vector(v_cell, + "cell_data", + DataOutRotation::type_cell_data); data_out_rotation.build_patches(4); data_out_rotation.write_dx(deallog.get_file_stream()); diff --git a/tests/data_out/data_out_rotation_postprocessor_scalar_02.cc b/tests/data_out/data_out_rotation_postprocessor_scalar_02.cc index ef85c43a09..e1e0c50fb3 100644 --- a/tests/data_out/data_out_rotation_postprocessor_scalar_02.cc +++ b/tests/data_out/data_out_rotation_postprocessor_scalar_02.cc @@ -49,7 +49,8 @@ template class MyPostprocessor : public DataPostprocessorScalar { public: - MyPostprocessor() : DataPostprocessorScalar("data", update_values) + MyPostprocessor() + : DataPostprocessorScalar("data", update_values) {} virtual void diff --git a/tests/distributed_grids/2d_refinement_10.cc b/tests/distributed_grids/2d_refinement_10.cc index 468c84509f..638f9988e1 100644 --- a/tests/distributed_grids/2d_refinement_10.cc +++ b/tests/distributed_grids/2d_refinement_10.cc @@ -82,7 +82,8 @@ template class Location : public Point { public: - Location(const Point &in) : Point(in) + Location(const Point &in) + : Point(in) {} inline bool @@ -194,12 +195,12 @@ main(int argc, char *argv[]) template TriaTest::TriaTest( - const typename dealii::Triangulation::MeshSmoothing smoothing_option) : - mpi_communicator(MPI_COMM_WORLD), - triangulation(mpi_communicator, smoothing_option), - myid(Utilities::MPI::this_mpi_process(mpi_communicator)), - I_am_host(myid == 0), - case_name(smoothing_option ? "smooth-" : "no_smooth-") + const typename dealii::Triangulation::MeshSmoothing smoothing_option) + : mpi_communicator(MPI_COMM_WORLD) + , triangulation(mpi_communicator, smoothing_option) + , myid(Utilities::MPI::this_mpi_process(mpi_communicator)) + , I_am_host(myid == 0) + , case_name(smoothing_option ? "smooth-" : "no_smooth-") { std::vector repetitions; Point p1; @@ -315,8 +316,9 @@ TriaTest::write_vtu(const unsigned int counter) const data_out.attach_triangulation(triangulation); { const std::string data_name("refine_flag"); - data_out.add_data_vector( - refine_mark, data_name, DataOut::type_cell_data); + data_out.add_data_vector(refine_mark, + data_name, + DataOut::type_cell_data); } data_out.build_patches(); diff --git a/tests/distributed_grids/3d_refinement_07.cc b/tests/distributed_grids/3d_refinement_07.cc index 02315a041e..c024d42eb2 100644 --- a/tests/distributed_grids/3d_refinement_07.cc +++ b/tests/distributed_grids/3d_refinement_07.cc @@ -44,8 +44,10 @@ test(std::ostream & /*out*/) std::vector subdivisions(3, 2); subdivisions[2] = 1; - GridGenerator::subdivided_hyper_rectangle( - tr, subdivisions, Point<3>(0, 0, 0), Point<3>(2, 2, 1)); + GridGenerator::subdivided_hyper_rectangle(tr, + subdivisions, + Point<3>(0, 0, 0), + Point<3>(2, 2, 1)); tr.begin_active()->set_refine_flag(); tr.execute_coarsening_and_refinement(); for (unsigned int c = 0; c < 8; ++c) diff --git a/tests/distributed_grids/3d_refinement_12.cc b/tests/distributed_grids/3d_refinement_12.cc index 6a11c6c67c..2760a0a33a 100644 --- a/tests/distributed_grids/3d_refinement_12.cc +++ b/tests/distributed_grids/3d_refinement_12.cc @@ -82,7 +82,8 @@ template class Location : public Point { public: - Location(const Point &in) : Point(in) + Location(const Point &in) + : Point(in) {} inline bool @@ -194,12 +195,12 @@ main(int argc, char *argv[]) template TriaTest::TriaTest( - const typename dealii::Triangulation::MeshSmoothing smoothing_option) : - mpi_communicator(MPI_COMM_WORLD), - triangulation(mpi_communicator, smoothing_option), - myid(Utilities::MPI::this_mpi_process(mpi_communicator)), - I_am_host(myid == 0), - case_name(smoothing_option ? "smooth-" : "no_smooth-") + const typename dealii::Triangulation::MeshSmoothing smoothing_option) + : mpi_communicator(MPI_COMM_WORLD) + , triangulation(mpi_communicator, smoothing_option) + , myid(Utilities::MPI::this_mpi_process(mpi_communicator)) + , I_am_host(myid == 0) + , case_name(smoothing_option ? "smooth-" : "no_smooth-") { std::vector repetitions; Point p1; @@ -315,8 +316,9 @@ TriaTest::write_vtu(const unsigned int counter) const data_out.attach_triangulation(triangulation); { const std::string data_name("refine_flag"); - data_out.add_data_vector( - refine_mark, data_name, DataOut::type_cell_data); + data_out.add_data_vector(refine_mark, + data_name, + DataOut::type_cell_data); } data_out.build_patches(); diff --git a/tests/distributed_grids/solution_transfer_02.cc b/tests/distributed_grids/solution_transfer_02.cc index 3db7cd6735..a29640225e 100644 --- a/tests/distributed_grids/solution_transfer_02.cc +++ b/tests/distributed_grids/solution_transfer_02.cc @@ -44,7 +44,8 @@ template class MyFunction : public Function { public: - MyFunction() : Function(){}; + MyFunction() + : Function(){}; virtual double value(const Point &p, const unsigned int) const diff --git a/tests/distributed_grids/solution_transfer_03.cc b/tests/distributed_grids/solution_transfer_03.cc index 5c52f28900..3c17d5fe05 100644 --- a/tests/distributed_grids/solution_transfer_03.cc +++ b/tests/distributed_grids/solution_transfer_03.cc @@ -43,7 +43,8 @@ template class MyFunction : public Function { public: - MyFunction() : Function(){}; + MyFunction() + : Function(){}; virtual double value(const Point &p, const unsigned int) const diff --git a/tests/dofs/block_list_04.cc b/tests/dofs/block_list_04.cc index b26e3389a4..b0903e0766 100644 --- a/tests/dofs/block_list_04.cc +++ b/tests/dofs/block_list_04.cc @@ -30,8 +30,9 @@ test_block_list(const Triangulation &tr, const FiniteElement &fe) { deallog.push("ff"); - SparsityPattern bl( - tr.n_cells(level - 1), dof.n_dofs(level), (1 << dim) * fe.dofs_per_cell); + SparsityPattern bl(tr.n_cells(level - 1), + dof.n_dofs(level), + (1 << dim) * fe.dofs_per_cell); ; DoFTools::make_child_patches(bl, dof, level, false, false); bl.compress(); @@ -41,8 +42,9 @@ test_block_list(const Triangulation &tr, const FiniteElement &fe) } { deallog.push("tf"); - SparsityPattern bl( - tr.n_cells(level - 1), dof.n_dofs(level), (1 << dim) * fe.dofs_per_cell); + SparsityPattern bl(tr.n_cells(level - 1), + dof.n_dofs(level), + (1 << dim) * fe.dofs_per_cell); ; DoFTools::make_child_patches(bl, dof, level, true, false); bl.compress(); @@ -52,8 +54,9 @@ test_block_list(const Triangulation &tr, const FiniteElement &fe) } { deallog.push("tt"); - SparsityPattern bl( - tr.n_cells(level - 1), dof.n_dofs(level), (1 << dim) * fe.dofs_per_cell); + SparsityPattern bl(tr.n_cells(level - 1), + dof.n_dofs(level), + (1 << dim) * fe.dofs_per_cell); ; DoFTools::make_child_patches(bl, dof, level, true, true); bl.compress(); diff --git a/tests/dofs/block_list_05.cc b/tests/dofs/block_list_05.cc index 978993b85d..60f7e2c3ce 100644 --- a/tests/dofs/block_list_05.cc +++ b/tests/dofs/block_list_05.cc @@ -154,8 +154,10 @@ test_global_refinement(void (*test_block_list)(const Triangulation &tr, GridGenerator::hyper_L(trl); trl.refine_global(1); - FESystem fe1( - FESystem(FE_Q(2), dim), 1, FE_Q(1), 1); + FESystem fe1(FESystem(FE_Q(2), dim), + 1, + FE_Q(1), + 1); deallog.push("Square"); test_block_list(trc, fe1); diff --git a/tests/dofs/block_relaxation_01.cc b/tests/dofs/block_relaxation_01.cc index dd0fb73eb7..cf99c60d95 100644 --- a/tests/dofs/block_relaxation_01.cc +++ b/tests/dofs/block_relaxation_01.cc @@ -93,8 +93,9 @@ make_stokes_matrix(const DoFHandler &dof_handler, fe_values.JxW(q); } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - local_matrix, local_dof_indices, system_matrix); + constraints.distribute_local_to_global(local_matrix, + local_dof_indices, + system_matrix); } } @@ -130,8 +131,10 @@ check() Smoother::AdditionalData smoother_data; Smoother smoother; - DoFTools::make_vertex_patches( - smoother_data.block_list, dof, tr.n_levels() - 1, exclude_boundary_dofs); + DoFTools::make_vertex_patches(smoother_data.block_list, + dof, + tr.n_levels() - 1, + exclude_boundary_dofs); smoother_data.block_list.compress(); smoother_data.inversion = PreconditionBlockBase::svd; smoother_data.threshold = 1.e-8; @@ -143,8 +146,10 @@ check() Smoother::AdditionalData smoother_data; Smoother smoother; - DoFTools::make_vertex_patches( - smoother_data.block_list, dof, tr.n_levels() - 1, exclude_boundary_dofs); + DoFTools::make_vertex_patches(smoother_data.block_list, + dof, + tr.n_levels() - 1, + exclude_boundary_dofs); smoother_data.block_list.compress(); smoother_data.inversion = PreconditionBlockBase::svd; smoother_data.kernel_size = 1; diff --git a/tests/dofs/dof_test.cc b/tests/dofs/dof_test.cc index 6c3b3eb5e1..2c00552506 100644 --- a/tests/dofs/dof_test.cc +++ b/tests/dofs/dof_test.cc @@ -200,7 +200,9 @@ private: template -TestCases::TestCases() : tria(nullptr), dof(nullptr) +TestCases::TestCases() + : tria(nullptr) + , dof(nullptr) {} diff --git a/tests/dofs/dof_tools_00a.cc b/tests/dofs/dof_tools_00a.cc index a9cbfd3e73..14d8e1689f 100644 --- a/tests/dofs/dof_tools_00a.cc +++ b/tests/dofs/dof_tools_00a.cc @@ -48,16 +48,20 @@ check_this(const DoFHandler &dof_handler) { std::vector target_component(n_components, 0U); dofs_per_component.resize(1); - DoFTools::count_dofs_per_component( - dof_handler, dofs_per_component, false, target_component); + 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]; deallog << std::endl; - DoFTools::count_dofs_per_component( - dof_handler, dofs_per_component, true, target_component); + 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) @@ -68,15 +72,19 @@ check_this(const DoFHandler &dof_handler) target_component[i] = 1; dofs_per_component.resize(2); - DoFTools::count_dofs_per_component( - dof_handler, dofs_per_component, false, target_component); + 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]; deallog << std::endl; - DoFTools::count_dofs_per_component( - dof_handler, dofs_per_component, true, target_component); + 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) diff --git a/tests/dofs/dof_tools_05.cc b/tests/dofs/dof_tools_05.cc index 7492613649..66c7e92f58 100644 --- a/tests/dofs/dof_tools_05.cc +++ b/tests/dofs/dof_tools_05.cc @@ -31,8 +31,9 @@ check_this(const DoFHandler &dof_handler) // first with all components { - DoFTools::extract_boundary_dofs( - dof_handler, component_select, boundary_dofs); + DoFTools::extract_boundary_dofs(dof_handler, + component_select, + boundary_dofs); output_bool_vector(boundary_dofs); } @@ -41,8 +42,9 @@ check_this(const DoFHandler &dof_handler) for (unsigned int i = 1; i < component_select.size(); i += 2) component_select[i] = false; { - DoFTools::extract_boundary_dofs( - dof_handler, component_select, boundary_dofs); + DoFTools::extract_boundary_dofs(dof_handler, + component_select, + boundary_dofs); output_bool_vector(boundary_dofs); } @@ -51,8 +53,10 @@ check_this(const DoFHandler &dof_handler) { std::set boundary_ids; boundary_ids.insert(0); - DoFTools::extract_boundary_dofs( - dof_handler, component_select, boundary_dofs, boundary_ids); + DoFTools::extract_boundary_dofs(dof_handler, + component_select, + boundary_dofs, + boundary_ids); output_bool_vector(boundary_dofs); } } diff --git a/tests/dofs/dof_tools_13a.cc b/tests/dofs/dof_tools_13a.cc index 06f3600dc8..0a5009aeea 100644 --- a/tests/dofs/dof_tools_13a.cc +++ b/tests/dofs/dof_tools_13a.cc @@ -56,8 +56,9 @@ check_this(const DoFHandler &dof_handler) std::vector component_mask(dof_handler.get_fe().n_components(), false); component_mask[0] = true; - DoFTools::extract_dofs( - dof_handler, ComponentMask(component_mask), component_dofs); + 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) @@ -90,8 +91,9 @@ check_this(const DoFHandler &dof_handler) std::vector component_mask(dof_handler.get_fe().n_components(), false); component_mask.back() = true; - DoFTools::extract_dofs( - dof_handler, ComponentMask(component_mask), component_dofs); + 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; diff --git a/tests/dofs/dof_tools_15c.cc b/tests/dofs/dof_tools_15c.cc index 15d8a5b4b3..11a9b0db38 100644 --- a/tests/dofs/dof_tools_15c.cc +++ b/tests/dofs/dof_tools_15c.cc @@ -39,9 +39,9 @@ check_this(const DoFHandler &dof_handler) std::vector map(dof_handler.n_dofs()); DoFTools::map_dof_to_boundary_indices(dof_handler, map); - const unsigned int n_blocks = std::min( - static_cast(dof_handler.get_fe().n_components()), - dof_handler.n_boundary_dofs()); + const unsigned int n_blocks = std::min(static_cast( + dof_handler.get_fe().n_components()), + dof_handler.n_boundary_dofs()); BlockSparsityPattern sp(n_blocks, n_blocks); // split dofs almost arbitrarily to // blocks diff --git a/tests/dofs/dof_tools_15d.cc b/tests/dofs/dof_tools_15d.cc index 23d7068a9d..fac72cc922 100644 --- a/tests/dofs/dof_tools_15d.cc +++ b/tests/dofs/dof_tools_15d.cc @@ -39,9 +39,9 @@ check_this(const DoFHandler &dof_handler) std::vector map(dof_handler.n_dofs()); DoFTools::map_dof_to_boundary_indices(dof_handler, map); - const unsigned int n_blocks = std::min( - static_cast(dof_handler.get_fe().n_components()), - dof_handler.n_boundary_dofs()); + const unsigned int n_blocks = std::min(static_cast( + dof_handler.get_fe().n_components()), + dof_handler.n_boundary_dofs()); BlockDynamicSparsityPattern sp(n_blocks, n_blocks); // split dofs almost arbitrarily to // blocks diff --git a/tests/dofs/dof_tools_16d.cc b/tests/dofs/dof_tools_16d.cc index 947028c4f5..ef63eda919 100644 --- a/tests/dofs/dof_tools_16d.cc +++ b/tests/dofs/dof_tools_16d.cc @@ -46,9 +46,9 @@ check_this(const DoFHandler &dof_handler) boundary_ids[0] = nullptr; const types::global_dof_index n_boundary_dofs = dof_handler.n_boundary_dofs(boundary_ids); - const unsigned int n_blocks = std::min( - static_cast(dof_handler.get_fe().n_components()), - n_boundary_dofs); + const unsigned int n_blocks = std::min(static_cast( + dof_handler.get_fe().n_components()), + n_boundary_dofs); BlockDynamicSparsityPattern sp(n_blocks, n_blocks); // split dofs almost arbitrarily to // blocks diff --git a/tests/dofs/dof_tools_20.cc b/tests/dofs/dof_tools_20.cc index 846798cfca..2d43226b84 100644 --- a/tests/dofs/dof_tools_20.cc +++ b/tests/dofs/dof_tools_20.cc @@ -31,8 +31,9 @@ check_this(const DoFHandler &dof_handler) // first with all components { - DoFTools::extract_dofs_with_support_on_boundary( - dof_handler, component_select, boundary_dofs); + DoFTools::extract_dofs_with_support_on_boundary(dof_handler, + component_select, + boundary_dofs); output_bool_vector(boundary_dofs); } @@ -41,8 +42,9 @@ check_this(const DoFHandler &dof_handler) 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); + DoFTools::extract_dofs_with_support_on_boundary(dof_handler, + component_select, + boundary_dofs); output_bool_vector(boundary_dofs); } @@ -51,8 +53,10 @@ check_this(const DoFHandler &dof_handler) { std::set boundary_ids; boundary_ids.insert(0); - DoFTools::extract_dofs_with_support_on_boundary( - dof_handler, component_select, boundary_dofs, boundary_ids); + DoFTools::extract_dofs_with_support_on_boundary(dof_handler, + component_select, + boundary_dofs, + boundary_ids); output_bool_vector(boundary_dofs); } } diff --git a/tests/dofs/dof_tools_21.cc b/tests/dofs/dof_tools_21.cc index 7fffb72195..a2ea145a0c 100644 --- a/tests/dofs/dof_tools_21.cc +++ b/tests/dofs/dof_tools_21.cc @@ -54,8 +54,9 @@ check_this(const DoFHandler &dof_handler) // Apply periodic boundary conditions only in the one direction where // we can match the (locally refined) faces: - DoFTools::make_periodicity_constraints( - dof_handler.begin(0)->face(0), dof_handler.begin(0)->face(1), cm); + DoFTools::make_periodicity_constraints(dof_handler.begin(0)->face(0), + dof_handler.begin(0)->face(1), + cm); cm.close(); deallog << cm.n_constraints() << std::endl; diff --git a/tests/dofs/dof_tools_21_b.cc b/tests/dofs/dof_tools_21_b.cc index 00fde3a032..961d93528f 100644 --- a/tests/dofs/dof_tools_21_b.cc +++ b/tests/dofs/dof_tools_21_b.cc @@ -197,8 +197,9 @@ print_matching(DoFHandler &dof_handler, ConstraintMatrix constraint_matrix; ConstraintMatrix constraint_matrix_reverse; std::vector> support_points(dof_handler.n_dofs()); - DoFTools::map_dofs_to_support_points( - mapping, dof_handler, support_points); + DoFTools::map_dofs_to_support_points(mapping, + dof_handler, + support_points); FEValuesExtractors::Vector v(0); FEValuesExtractors::Scalar v_1(0); @@ -284,14 +285,15 @@ print_matching(DoFHandler &dof_handler, constraint_matrix.print(deallog.get_file_stream()); constraint_matrix.close(); - DoFTools::make_periodicity_constraints( - face_2, - face_1, - constraint_matrix_reverse, - velocity_mask, - orientation[0], - orientation[0] ? orientation[1] ^ orientation[2] : orientation[1], - orientation[2]); + DoFTools::make_periodicity_constraints(face_2, + face_1, + constraint_matrix_reverse, + velocity_mask, + orientation[0], + orientation[0] ? + orientation[1] ^ orientation[2] : + orientation[1], + orientation[2]); deallog << "Reverse Matching:" << std::endl; constraint_matrix_reverse.print(deallog.get_file_stream()); constraint_matrix_reverse.close(); diff --git a/tests/dofs/dof_tools_21_b_x.cc b/tests/dofs/dof_tools_21_b_x.cc index ec9309d13d..1c656424bc 100644 --- a/tests/dofs/dof_tools_21_b_x.cc +++ b/tests/dofs/dof_tools_21_b_x.cc @@ -123,8 +123,9 @@ print_matching(DoFHandler &dof_handler) ConstraintMatrix constraint_matrix; std::vector> support_points(dof_handler.n_dofs()); - DoFTools::map_dofs_to_support_points( - mapping, dof_handler, support_points); + DoFTools::map_dofs_to_support_points(mapping, + dof_handler, + support_points); // Look for the two outermost faces: typename DoFHandler::face_iterator face_1 = diff --git a/tests/dofs/dof_tools_21_b_x_q3.cc b/tests/dofs/dof_tools_21_b_x_q3.cc index 4c0a84ca53..958044ab1c 100644 --- a/tests/dofs/dof_tools_21_b_x_q3.cc +++ b/tests/dofs/dof_tools_21_b_x_q3.cc @@ -157,8 +157,9 @@ print_matching(DoFHandler &dof_handler) ConstraintMatrix constraint_matrix; std::vector> support_points(dof_handler.n_dofs()); - DoFTools::map_dofs_to_support_points( - mapping, dof_handler, support_points); + DoFTools::map_dofs_to_support_points(mapping, + dof_handler, + support_points); // Look for the two outermost faces: typename DoFHandler::face_iterator face_1 = diff --git a/tests/dofs/dof_tools_21_b_y.cc b/tests/dofs/dof_tools_21_b_y.cc index f49fd84e48..f68ac9cd54 100644 --- a/tests/dofs/dof_tools_21_b_y.cc +++ b/tests/dofs/dof_tools_21_b_y.cc @@ -122,8 +122,9 @@ print_matching(DoFHandler &dof_handler) ConstraintMatrix constraint_matrix; std::vector> support_points(dof_handler.n_dofs()); - DoFTools::map_dofs_to_support_points( - mapping, dof_handler, support_points); + DoFTools::map_dofs_to_support_points(mapping, + dof_handler, + support_points); // Look for the two outermost faces: typename DoFHandler::face_iterator face_1 = diff --git a/tests/dofs/dof_tools_21_c.cc b/tests/dofs/dof_tools_21_c.cc index dc7c0102d6..67ab4f7db1 100644 --- a/tests/dofs/dof_tools_21_c.cc +++ b/tests/dofs/dof_tools_21_c.cc @@ -202,8 +202,9 @@ print_matching(DoFHandler &dof_handler, ConstraintMatrix constraint_matrix; ConstraintMatrix constraint_matrix_reverse; std::vector> support_points(dof_handler.n_dofs()); - DoFTools::map_dofs_to_support_points( - mapping, dof_handler, support_points); + DoFTools::map_dofs_to_support_points(mapping, + dof_handler, + support_points); FEValuesExtractors::Vector v(0); FEValuesExtractors::Scalar v_1(0); @@ -289,14 +290,15 @@ print_matching(DoFHandler &dof_handler, constraint_matrix.print(deallog.get_file_stream()); constraint_matrix.close(); - DoFTools::make_periodicity_constraints( - face_2, - face_1, - constraint_matrix_reverse, - velocity_mask, - orientation[0], - orientation[0] ? orientation[1] ^ orientation[2] : orientation[1], - orientation[2]); + DoFTools::make_periodicity_constraints(face_2, + face_1, + constraint_matrix_reverse, + velocity_mask, + orientation[0], + orientation[0] ? + orientation[1] ^ orientation[2] : + orientation[1], + orientation[2]); deallog << "Reverse Matching:" << std::endl; constraint_matrix_reverse.print(deallog.get_file_stream()); constraint_matrix_reverse.close(); diff --git a/tests/dofs/dof_tools_22a.cc b/tests/dofs/dof_tools_22a.cc index 0b7b698aa2..d157ab433a 100644 --- a/tests/dofs/dof_tools_22a.cc +++ b/tests/dofs/dof_tools_22a.cc @@ -53,8 +53,10 @@ test() dealii::parallel::distributed::Triangulation triangulation( MPI_COMM_WORLD); - GridGenerator::hyper_rectangle( - triangulation, Point(0, 0), Point(1, 1), true); + GridGenerator::hyper_rectangle(triangulation, + Point(0, 0), + Point(1, 1), + true); triangulation.refine_global(1); // Extra refinement to generate hanging nodes @@ -102,14 +104,14 @@ test() // Generate sparsity pattern DynamicSparsityPattern sp(relevant_partitioning); - DoFTools::make_flux_sparsity_pattern( - dh, - sp, - constraints, - false, - coupling, - flux_coupling, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_flux_sparsity_pattern(dh, + sp, + constraints, + false, + coupling, + flux_coupling, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); SparsityTools::distribute_sparsity_pattern( sp, dh.n_locally_owned_dofs_per_processor(), diff --git a/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_01.cc b/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_01.cc index 57bc504664..d5cbbbd5a4 100644 --- a/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_01.cc +++ b/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_01.cc @@ -50,8 +50,9 @@ test(const unsigned int flag) // Setup system Triangulation triangulation; - GridGenerator::hyper_rectangle( - triangulation, Point(0, 0), Point(1, 1)); + GridGenerator::hyper_rectangle(triangulation, + Point(0, 0), + Point(1, 1)); if (flag == 0) triangulation.refine_global(2); diff --git a/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_02.cc b/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_02.cc index d7032947a1..89fc0cb3c5 100644 --- a/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_02.cc +++ b/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_02.cc @@ -67,8 +67,9 @@ test(const unsigned int flag) // Setup system parallel::distributed::Triangulation triangulation(MPI_COMM_WORLD); - GridGenerator::hyper_rectangle( - triangulation, Point(0, 0), Point(1, 1)); + GridGenerator::hyper_rectangle(triangulation, + Point(0, 0), + Point(1, 1)); if (flag == 0) triangulation.refine_global(2); @@ -132,8 +133,9 @@ test(const unsigned int flag) for (unsigned int i = 0; i < dh.n_dofs(); ++i) { LinearAlgebra::distributed::Vector &s = shape_functions[i]; - s.reinit( - dh.locally_owned_dofs(), locally_relevant_set, MPI_COMM_WORLD); + s.reinit(dh.locally_owned_dofs(), + locally_relevant_set, + MPI_COMM_WORLD); s = 0.; if (dh.locally_owned_dofs().is_element(i)) s[i] = 1.0; @@ -141,8 +143,9 @@ test(const unsigned int flag) cm.distribute(s); s.update_ghost_values(); - data_out.add_data_vector( - s, std::string("N_") + Utilities::int_to_string(i)); + data_out.add_data_vector(s, + std::string("N_") + + Utilities::int_to_string(i)); } Vector subdomain(triangulation.n_active_cells()); diff --git a/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_03.cc b/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_03.cc index 7b54c026e4..99ac9dde05 100644 --- a/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_03.cc +++ b/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_03.cc @@ -69,8 +69,9 @@ test(const bool left = true) // Setup system Triangulation triangulation; - GridGenerator::hyper_rectangle( - triangulation, Point(0, 0), Point(1, 1)); + GridGenerator::hyper_rectangle(triangulation, + Point(0, 0), + Point(1, 1)); triangulation.refine_global(1); diff --git a/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_04.cc b/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_04.cc index c864d680ba..8ca30ea8cc 100644 --- a/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_04.cc +++ b/tests/dofs/dof_tools_extract_dofs_with_support_contained_within_04.cc @@ -75,8 +75,9 @@ test() // Setup system parallel::distributed::Triangulation triangulation(MPI_COMM_WORLD); - GridGenerator::hyper_rectangle( - triangulation, Point(0, 0), Point(1, 1)); + GridGenerator::hyper_rectangle(triangulation, + Point(0, 0), + Point(1, 1)); triangulation.refine_global(1); @@ -266,8 +267,9 @@ test() s = 0.; s = sl; - data_out.add_data_vector( - s, std::string("N_") + dealii::Utilities::int_to_string(i)); + data_out.add_data_vector(s, + std::string("N_") + + dealii::Utilities::int_to_string(i)); } Vector subdomain(triangulation.n_active_cells()); @@ -301,12 +303,12 @@ test() { const unsigned int ind = locally_owned_set.nth_index_in_set(i); const double v = rhs[ind]; - AssertThrow( - std::abs(v) < 1e-12, - ExcMessage("Element " + std::to_string(ind) + " has an error " + - std::to_string(v) + " on the process " + - std::to_string(dealii::Utilities::MPI::this_mpi_process( - MPI_COMM_WORLD)))); + AssertThrow(std::abs(v) < 1e-12, + ExcMessage( + "Element " + std::to_string(ind) + " has an error " + + std::to_string(v) + " on the process " + + std::to_string(dealii::Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)))); } if (dealii::Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) diff --git a/tests/dofs/dof_tools_write_gnuplot_dof_support_point_info_01.cc b/tests/dofs/dof_tools_write_gnuplot_dof_support_point_info_01.cc index 61088cb492..c7cd595d3b 100644 --- a/tests/dofs/dof_tools_write_gnuplot_dof_support_point_info_01.cc +++ b/tests/dofs/dof_tools_write_gnuplot_dof_support_point_info_01.cc @@ -41,10 +41,14 @@ test() std::vector rep(dim, 1); rep[0] = 2; - GridGenerator::subdivided_hyper_rectangle( - triangulation, rep, Point(), Point(2.0, 1.0)); - FESystem fe( - FE_Q(velocity_degree), dim, FE_Q(velocity_degree - 1), 1); + GridGenerator::subdivided_hyper_rectangle(triangulation, + rep, + Point(), + Point(2.0, 1.0)); + FESystem fe(FE_Q(velocity_degree), + dim, + FE_Q(velocity_degree - 1), + 1); DoFHandler dof_handler(triangulation); dof_handler.distribute_dofs(fe); @@ -55,8 +59,9 @@ test() out << "e" << std::endl; std::map> support_points; - DoFTools::map_dofs_to_support_points( - MappingQ1(), dof_handler, support_points); + DoFTools::map_dofs_to_support_points(MappingQ1(), + dof_handler, + support_points); DoFTools::write_gnuplot_dof_support_point_info(deallog.get_file_stream(), support_points); out << "e" << std::endl; diff --git a/tests/dofs/extract_dofs_by_component_01_mg.cc b/tests/dofs/extract_dofs_by_component_01_mg.cc index 0ece8b4950..c7226df7b0 100644 --- a/tests/dofs/extract_dofs_by_component_01_mg.cc +++ b/tests/dofs/extract_dofs_by_component_01_mg.cc @@ -70,8 +70,10 @@ check() deallog << "level=" << level << std::endl; std::vector dofs(dof.n_dofs(level)); - DoFTools::extract_level_dofs( - level, dof, ComponentMask(component_mask), dofs); + DoFTools::extract_level_dofs(level, + dof, + ComponentMask(component_mask), + dofs); for (unsigned int d = 0; d < dofs.size(); ++d) deallog << dofs[d]; diff --git a/tests/dofs/extract_dofs_by_component_02_mg.cc b/tests/dofs/extract_dofs_by_component_02_mg.cc index f0fa2fb74e..e02bc21c46 100644 --- a/tests/dofs/extract_dofs_by_component_02_mg.cc +++ b/tests/dofs/extract_dofs_by_component_02_mg.cc @@ -71,8 +71,10 @@ check() deallog << "level=" << level << std::endl; std::vector dofs(dof.n_dofs(level)); - DoFTools::extract_level_dofs( - level, dof, BlockMask(component_mask), dofs); + DoFTools::extract_level_dofs(level, + dof, + BlockMask(component_mask), + dofs); for (unsigned int d = 0; d < dofs.size(); ++d) deallog << dofs[d]; diff --git a/tests/dofs/interpolate_based_on_material_id_01.cc b/tests/dofs/interpolate_based_on_material_id_01.cc index a1c6ea4b82..21aeeef7e7 100644 --- a/tests/dofs/interpolate_based_on_material_id_01.cc +++ b/tests/dofs/interpolate_based_on_material_id_01.cc @@ -46,7 +46,8 @@ template class F : public Function { public: - F(const unsigned int q) : q(q) + F(const unsigned int q) + : q(q) {} virtual double @@ -91,8 +92,10 @@ test() dof_handler.distribute_dofs(fe); Vector interpolant(dof_handler.n_dofs()); - VectorTools::interpolate_based_on_material_id( - MappingQGeneric(1), dof_handler, functions, interpolant); + VectorTools::interpolate_based_on_material_id(MappingQGeneric(1), + dof_handler, + functions, + interpolant); for (typename DoFHandler::active_cell_iterator cell = dof_handler.begin_active(); cell != dof_handler.end(); diff --git a/tests/dofs/interpolate_boundary_values_01.cc b/tests/dofs/interpolate_boundary_values_01.cc index b3155b3418..b08951f0f1 100644 --- a/tests/dofs/interpolate_boundary_values_01.cc +++ b/tests/dofs/interpolate_boundary_values_01.cc @@ -57,7 +57,8 @@ public: }; template -VectorBoundaryValues::VectorBoundaryValues() : Function(dim + 1) +VectorBoundaryValues::VectorBoundaryValues() + : Function(dim + 1) {} template @@ -99,9 +100,9 @@ private: // first component: Q1-Element, // second component: lowest order DG_Element template -FindBug::FindBug() : - fe(FE_RaviartThomas(0), 1, FE_Q(1), 1), - dof_handler(triangulation) +FindBug::FindBug() + : fe(FE_RaviartThomas(0), 1, FE_Q(1), 1) + , dof_handler(triangulation) {} @@ -156,8 +157,10 @@ FindBug::dirichlet_conditions() // get a list of those boundary DoFs which // we want to be fixed: - DoFTools::extract_boundary_dofs( - dof_handler, component_mask, fixed_dofs, boundary_ids); + DoFTools::extract_boundary_dofs(dof_handler, + component_mask, + fixed_dofs, + boundary_ids); // (Primitive) Check if the DoFs // where adjusted correctly (note diff --git a/tests/dofs/interpolate_boundary_values_02.cc b/tests/dofs/interpolate_boundary_values_02.cc index 645cfdda13..ce7ab917d4 100644 --- a/tests/dofs/interpolate_boundary_values_02.cc +++ b/tests/dofs/interpolate_boundary_values_02.cc @@ -61,10 +61,14 @@ test() dof_handler.distribute_dofs(fe); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 10, Functions::SquareFunction(), boundary_values); - VectorTools::interpolate_boundary_values( - dof_handler, 20, Functions::SquareFunction(), boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 10, + Functions::SquareFunction(), + boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 20, + Functions::SquareFunction(), + boundary_values); deallog << boundary_values.size() << std::endl; for (std::map::const_iterator p = boundary_values.begin(); diff --git a/tests/dofs/interpolate_dgq_01.cc b/tests/dofs/interpolate_dgq_01.cc index 7ebd95d490..18ea80fa96 100644 --- a/tests/dofs/interpolate_dgq_01.cc +++ b/tests/dofs/interpolate_dgq_01.cc @@ -47,7 +47,8 @@ template class F : public Function { public: - F(const unsigned int q) : q(q) + F(const unsigned int q) + : q(q) {} virtual double diff --git a/tests/dofs/interpolate_dgq_02.cc b/tests/dofs/interpolate_dgq_02.cc index 7c5fb823f7..a47bc1c8df 100644 --- a/tests/dofs/interpolate_dgq_02.cc +++ b/tests/dofs/interpolate_dgq_02.cc @@ -48,7 +48,8 @@ template class F : public Function { public: - F(const unsigned int q) : q(q) + F(const unsigned int q) + : q(q) {} virtual double diff --git a/tests/dofs/interpolate_q_01.cc b/tests/dofs/interpolate_q_01.cc index bfaa27fefe..c01fd7b006 100644 --- a/tests/dofs/interpolate_q_01.cc +++ b/tests/dofs/interpolate_q_01.cc @@ -47,7 +47,8 @@ template class F : public Function { public: - F(const unsigned int q) : q(q) + F(const unsigned int q) + : q(q) {} virtual double diff --git a/tests/dofs/interpolate_q_02.cc b/tests/dofs/interpolate_q_02.cc index 192a419b4f..92da9401e4 100644 --- a/tests/dofs/interpolate_q_02.cc +++ b/tests/dofs/interpolate_q_02.cc @@ -48,7 +48,8 @@ template class F : public Function { public: - F(const unsigned int q) : q(q) + F(const unsigned int q) + : q(q) {} virtual double diff --git a/tests/dofs/interpolate_q_system_01.cc b/tests/dofs/interpolate_q_system_01.cc index 5e4f523ff4..775e82a15b 100644 --- a/tests/dofs/interpolate_q_system_01.cc +++ b/tests/dofs/interpolate_q_system_01.cc @@ -48,7 +48,9 @@ template class F : public Function { public: - F(const unsigned int q) : Function(3), q(q) + F(const unsigned int q) + : Function(3) + , q(q) {} virtual void diff --git a/tests/dofs/interpolate_q_system_02.cc b/tests/dofs/interpolate_q_system_02.cc index 17d69b8d55..91bf61c674 100644 --- a/tests/dofs/interpolate_q_system_02.cc +++ b/tests/dofs/interpolate_q_system_02.cc @@ -49,7 +49,9 @@ template class F : public Function { public: - F(const unsigned int q) : Function(3), q(q) + F(const unsigned int q) + : Function(3) + , q(q) {} virtual void diff --git a/tests/dofs/interpolate_q_system_mask_01.cc b/tests/dofs/interpolate_q_system_mask_01.cc index 84596cacdf..e7f8d72f1b 100644 --- a/tests/dofs/interpolate_q_system_mask_01.cc +++ b/tests/dofs/interpolate_q_system_mask_01.cc @@ -49,7 +49,10 @@ template class F : public Function { public: - F(const unsigned int q, const double adj) : Function(3), q(q), adj(adj) + F(const unsigned int q, const double adj) + : Function(3) + , q(q) + , adj(adj) {} virtual void @@ -104,12 +107,16 @@ test() for (unsigned int q = 0; q <= p + 2; ++q) { // interpolate the function with mask 1 - VectorTools::interpolate( - dof_handler, F(q, adj1), interpolant, mask1); + VectorTools::interpolate(dof_handler, + F(q, adj1), + interpolant, + mask1); // interpolate the function with mask 2 - VectorTools::interpolate( - dof_handler, F(q, adj2), interpolant, mask2); + VectorTools::interpolate(dof_handler, + F(q, adj2), + interpolant, + mask2); // then compute the interpolation error for mask 1 VectorTools::integrate_difference(dof_handler, diff --git a/tests/dofs/interpolate_q_system_mask_02.cc b/tests/dofs/interpolate_q_system_mask_02.cc index 8867d9e104..956f9d9bc8 100644 --- a/tests/dofs/interpolate_q_system_mask_02.cc +++ b/tests/dofs/interpolate_q_system_mask_02.cc @@ -50,7 +50,10 @@ template class F : public Function { public: - F(const unsigned int q, const double adj) : Function(3), q(q), adj(adj) + F(const unsigned int q, const double adj) + : Function(3) + , q(q) + , adj(adj) {} virtual void @@ -111,10 +114,14 @@ test() for (unsigned int q = 0; q <= p + 2; ++q) { // interpolate the function - VectorTools::interpolate( - dof_handler, F(q, adj1), interpolant, mask1); - VectorTools::interpolate( - dof_handler, F(q, adj2), interpolant, mask2); + VectorTools::interpolate(dof_handler, + F(q, adj1), + interpolant, + mask1); + VectorTools::interpolate(dof_handler, + F(q, adj2), + interpolant, + mask2); constraints.distribute(interpolant); diff --git a/tests/dofs/n_boundary_dofs_02.cc b/tests/dofs/n_boundary_dofs_02.cc index 4cee83c5f4..1aee450065 100644 --- a/tests/dofs/n_boundary_dofs_02.cc +++ b/tests/dofs/n_boundary_dofs_02.cc @@ -50,8 +50,9 @@ test() GridGenerator::hyper_cube(triangulation_2, 2, 3); Triangulation<1, spacedim> triangulation; - GridGenerator::merge_triangulations( - triangulation_1, triangulation_2, triangulation); + GridGenerator::merge_triangulations(triangulation_1, + triangulation_2, + triangulation); FESystem<1, spacedim> fe(FE_Q<1, spacedim>(1), 1, FE_DGQ<1, spacedim>(1), 1); diff --git a/tests/dofs/n_boundary_dofs_03.cc b/tests/dofs/n_boundary_dofs_03.cc index 624f8b72aa..9d300baccc 100644 --- a/tests/dofs/n_boundary_dofs_03.cc +++ b/tests/dofs/n_boundary_dofs_03.cc @@ -53,8 +53,9 @@ test() GridGenerator::hyper_cube(triangulation_2, 2, 3); Triangulation<1, spacedim> triangulation; - GridGenerator::merge_triangulations( - triangulation_1, triangulation_2, triangulation); + GridGenerator::merge_triangulations(triangulation_1, + triangulation_2, + triangulation); // assign boundary ids triangulation.begin()->face(0)->set_boundary_id(12); diff --git a/tests/dofs/range_based_for_step-6.cc b/tests/dofs/range_based_for_step-6.cc index b81d6f830a..524ec2a60b 100644 --- a/tests/dofs/range_based_for_step-6.cc +++ b/tests/dofs/range_based_for_step-6.cc @@ -99,7 +99,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -150,7 +151,9 @@ Coefficient::value_list(const std::vector> &points, template -Step6::Step6() : dof_handler(triangulation), fe(2) +Step6::Step6() + : dof_handler(triangulation) + , fe(2) {} @@ -177,8 +180,10 @@ Step6::setup_system() DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); @@ -278,8 +283,10 @@ Step6::refine_grid() solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/dofs/sparsity_pattern.cc b/tests/dofs/sparsity_pattern.cc index 5548646c0b..5a4ab36469 100644 --- a/tests/dofs/sparsity_pattern.cc +++ b/tests/dofs/sparsity_pattern.cc @@ -70,8 +70,9 @@ check_boundary(const DoFHandler &dof) // first way: direct generation SparsityPattern sparsity_1(dof.n_boundary_dofs(), dof.max_couplings_between_boundary_dofs()); - DoFTools::make_boundary_sparsity_pattern( - dof, dof_to_boundary_mapping, sparsity_1); + DoFTools::make_boundary_sparsity_pattern(dof, + dof_to_boundary_mapping, + sparsity_1); sparsity_1.compress(); // second way: via a DynamicSparsityPattern diff --git a/tests/dofs/sparsity_pattern_01.cc b/tests/dofs/sparsity_pattern_01.cc index bc509f2344..e0a7871850 100644 --- a/tests/dofs/sparsity_pattern_01.cc +++ b/tests/dofs/sparsity_pattern_01.cc @@ -70,8 +70,9 @@ check_boundary(const DoFHandler &dof) // first way: direct generation SparsityPattern sparsity_1(dof.n_boundary_dofs(), dof.max_couplings_between_boundary_dofs()); - DoFTools::make_boundary_sparsity_pattern( - dof, dof_to_boundary_mapping, sparsity_1); + DoFTools::make_boundary_sparsity_pattern(dof, + dof_to_boundary_mapping, + sparsity_1); sparsity_1.compress(); // second way: via a DynamicSparsityPattern diff --git a/tests/dofs/sparsity_pattern_02.cc b/tests/dofs/sparsity_pattern_02.cc index 7ca4af6df0..46a152cb0a 100644 --- a/tests/dofs/sparsity_pattern_02.cc +++ b/tests/dofs/sparsity_pattern_02.cc @@ -82,8 +82,9 @@ check() 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())); + SparsityPattern sparsity(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(); diff --git a/tests/dofs/sparsity_pattern_03.cc b/tests/dofs/sparsity_pattern_03.cc index 773c9c2e97..55858cb686 100644 --- a/tests/dofs/sparsity_pattern_03.cc +++ b/tests/dofs/sparsity_pattern_03.cc @@ -84,8 +84,9 @@ check() 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())); + SparsityPattern sparsity(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(); diff --git a/tests/dofs/sparsity_pattern_04.cc b/tests/dofs/sparsity_pattern_04.cc index f0acf59e83..77fc6cd283 100644 --- a/tests/dofs/sparsity_pattern_04.cc +++ b/tests/dofs/sparsity_pattern_04.cc @@ -86,8 +86,9 @@ check() 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())); + SparsityPattern sparsity(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(); diff --git a/tests/fail/abf_approximation_01.cc b/tests/fail/abf_approximation_01.cc index d829014317..bb432ba78f 100644 --- a/tests/fail/abf_approximation_01.cc +++ b/tests/fail/abf_approximation_01.cc @@ -71,7 +71,8 @@ template class TestMap1 : public Function { public: - TestMap1(const unsigned int n_components) : Function(n_components) + TestMap1(const unsigned int n_components) + : Function(n_components) {} virtual ~TestMap1() @@ -126,9 +127,9 @@ private: const double phi; public: - TestDef1(const unsigned int n_components, const double ph) : - Function(n_components), - phi(ph) + TestDef1(const unsigned int n_components, const double ph) + : Function(n_components) + , phi(ph) {} virtual ~TestDef1() @@ -182,9 +183,9 @@ private: const double scale; public: - TestDef2(const unsigned int n_components, const double sc) : - Function(n_components), - scale(sc) + TestDef2(const unsigned int n_components, const double sc) + : Function(n_components) + , scale(sc) {} virtual ~TestDef2() @@ -234,9 +235,9 @@ private: const double scale; public: - TestDef3(const unsigned int n_components, const double sc) : - Function(n_components), - scale(sc) + TestDef3(const unsigned int n_components, const double sc) + : Function(n_components) + , scale(sc) {} virtual ~TestDef3() @@ -283,7 +284,8 @@ private: std::vector> polys; public: - TestPoly(unsigned int deg) : Function(2) + TestPoly(unsigned int deg) + : Function(2) { std::vector coeff(deg, 0.0); for (unsigned int p = 0; p < 4; ++p) diff --git a/tests/fail/circular_01.cc b/tests/fail/circular_01.cc index b2778307bb..ecd170f928 100644 --- a/tests/fail/circular_01.cc +++ b/tests/fail/circular_01.cc @@ -113,7 +113,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -135,7 +136,8 @@ RightHandSide::value(const Point &p, template -LaplaceProblem::LaplaceProblem() : dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) { for (unsigned int degree = 2; degree < (dim == 2 ? 8 : 5); ++degree) { @@ -252,8 +254,9 @@ LaplaceProblem::assemble_system() 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -264,10 +267,14 @@ LaplaceProblem::assemble_system() hanging_node_constraints.condense(system_rhs); condense.stop(); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } template @@ -334,8 +341,9 @@ LaplaceProblem::estimate_smoothness( if (!((i == 0) && (j == 0) && (k == 0)) && (i * i + j * j + k * k < N * N)) { - k_vectors.push_back(Point( - numbers::PI * i, numbers::PI * j, numbers::PI * k)); + k_vectors.push_back(Point(numbers::PI * i, + numbers::PI * j, + numbers::PI * k)); k_vectors_magnitude.push_back(i * i + j * j + k * k); } @@ -469,8 +477,10 @@ LaplaceProblem::refine_grid() Vector 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); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); float max_smoothness = 0, min_smoothness = smoothness_indicators.linfty_norm(); @@ -528,8 +538,9 @@ LaplaceProblem::output_results(const unsigned int cycle) const estimate_smoothness(smoothness_indicators); Vector smoothness_field(dof_handler.n_dofs()); - DoFTools::distribute_cell_to_dof_vector( - dof_handler, smoothness_indicators, smoothness_field); + DoFTools::distribute_cell_to_dof_vector(dof_handler, + smoothness_indicators, + smoothness_field); Vector fe_indices(triangulation.n_active_cells()); { @@ -626,18 +637,24 @@ LaplaceProblem<3>::create_coarse_grid() static const Point<3> vertices_1[] = { // points on the lower surface Point(0, 0, -4), - Point( - std::cos(0 * numbers::PI / 6), std::sin(0 * numbers::PI / 6), -4), - Point( - std::cos(2 * numbers::PI / 6), std::sin(2 * numbers::PI / 6), -4), - Point( - std::cos(4 * numbers::PI / 6), std::sin(4 * numbers::PI / 6), -4), - Point( - std::cos(6 * numbers::PI / 6), std::sin(6 * numbers::PI / 6), -4), - Point( - std::cos(8 * numbers::PI / 6), std::sin(8 * numbers::PI / 6), -4), - Point( - std::cos(10 * numbers::PI / 6), std::sin(10 * numbers::PI / 6), -4), + Point(std::cos(0 * numbers::PI / 6), + std::sin(0 * numbers::PI / 6), + -4), + Point(std::cos(2 * numbers::PI / 6), + std::sin(2 * numbers::PI / 6), + -4), + Point(std::cos(4 * numbers::PI / 6), + std::sin(4 * numbers::PI / 6), + -4), + Point(std::cos(6 * numbers::PI / 6), + std::sin(6 * numbers::PI / 6), + -4), + Point(std::cos(8 * numbers::PI / 6), + std::sin(8 * numbers::PI / 6), + -4), + Point(std::cos(10 * numbers::PI / 6), + std::sin(10 * numbers::PI / 6), + -4), // same points on the top // of the stem, with @@ -648,8 +665,9 @@ LaplaceProblem<3>::create_coarse_grid() Point(std::cos(4 * numbers::PI / 6), std::sin(4 * numbers::PI / 6), 4), Point(std::cos(6 * numbers::PI / 6), std::sin(6 * numbers::PI / 6), 4), Point(std::cos(8 * numbers::PI / 6), std::sin(8 * numbers::PI / 6), 4), - Point( - std::cos(10 * numbers::PI / 6), std::sin(10 * numbers::PI / 6), 4), + Point(std::cos(10 * numbers::PI / 6), + std::sin(10 * numbers::PI / 6), + 4), // point at top of chevron Point(0, 0, 4 + std::sqrt(2.) / 2), @@ -661,20 +679,26 @@ LaplaceProblem<3>::create_coarse_grid() std::sin(2 * numbers::PI / 6), 0) * 4, - Point( - std::cos(0 * numbers::PI / 6), std::sin(0 * numbers::PI / 6), 7) + - Point( - std::cos(2 * numbers::PI / 6), std::sin(2 * numbers::PI / 6), 0) * + Point(std::cos(0 * numbers::PI / 6), + std::sin(0 * numbers::PI / 6), + 7) + + Point(std::cos(2 * numbers::PI / 6), + std::sin(2 * numbers::PI / 6), + 0) * 4, - Point( - std::cos(2 * numbers::PI / 6), std::sin(2 * numbers::PI / 6), 7) + - Point( - std::cos(2 * numbers::PI / 6), std::sin(2 * numbers::PI / 6), 0) * + Point(std::cos(2 * numbers::PI / 6), + std::sin(2 * numbers::PI / 6), + 7) + + Point(std::cos(2 * numbers::PI / 6), + std::sin(2 * numbers::PI / 6), + 0) * 4, - Point( - std::cos(4 * numbers::PI / 6), std::sin(4 * numbers::PI / 6), 7) + - Point( - std::cos(2 * numbers::PI / 6), std::sin(2 * numbers::PI / 6), 0) * + Point(std::cos(4 * numbers::PI / 6), + std::sin(4 * numbers::PI / 6), + 7) + + Point(std::cos(2 * numbers::PI / 6), + std::sin(2 * numbers::PI / 6), + 0) * 4, // points at the top of the @@ -684,20 +708,26 @@ LaplaceProblem<3>::create_coarse_grid() std::sin(6 * numbers::PI / 6), 0) * 4, - Point( - std::cos(4 * numbers::PI / 6), std::sin(4 * numbers::PI / 6), 7) + - Point( - std::cos(6 * numbers::PI / 6), std::sin(6 * numbers::PI / 6), 0) * + Point(std::cos(4 * numbers::PI / 6), + std::sin(4 * numbers::PI / 6), + 7) + + Point(std::cos(6 * numbers::PI / 6), + std::sin(6 * numbers::PI / 6), + 0) * 4, - Point( - std::cos(6 * numbers::PI / 6), std::sin(6 * numbers::PI / 6), 7) + - Point( - std::cos(6 * numbers::PI / 6), std::sin(6 * numbers::PI / 6), 0) * + Point(std::cos(6 * numbers::PI / 6), + std::sin(6 * numbers::PI / 6), + 7) + + Point(std::cos(6 * numbers::PI / 6), + std::sin(6 * numbers::PI / 6), + 0) * 4, - Point( - std::cos(8 * numbers::PI / 6), std::sin(8 * numbers::PI / 6), 7) + - Point( - std::cos(6 * numbers::PI / 6), std::sin(6 * numbers::PI / 6), 0) * + Point(std::cos(8 * numbers::PI / 6), + std::sin(8 * numbers::PI / 6), + 7) + + Point(std::cos(6 * numbers::PI / 6), + std::sin(6 * numbers::PI / 6), + 0) * 4, // points at the top of the @@ -707,20 +737,26 @@ LaplaceProblem<3>::create_coarse_grid() std::sin(10 * numbers::PI / 6), 0) * 4, - Point( - std::cos(8 * numbers::PI / 6), std::sin(8 * numbers::PI / 6), 7) + - Point( - std::cos(10 * numbers::PI / 6), std::sin(10 * numbers::PI / 6), 0) * + Point(std::cos(8 * numbers::PI / 6), + std::sin(8 * numbers::PI / 6), + 7) + + Point(std::cos(10 * numbers::PI / 6), + std::sin(10 * numbers::PI / 6), + 0) * 4, - Point( - std::cos(10 * numbers::PI / 6), std::sin(10 * numbers::PI / 6), 7) + - Point( - std::cos(10 * numbers::PI / 6), std::sin(10 * numbers::PI / 6), 0) * + Point(std::cos(10 * numbers::PI / 6), + std::sin(10 * numbers::PI / 6), + 7) + + Point(std::cos(10 * numbers::PI / 6), + std::sin(10 * numbers::PI / 6), + 0) * 4, - Point( - std::cos(0 * numbers::PI / 6), std::sin(0 * numbers::PI / 6), 7) + - Point( - std::cos(10 * numbers::PI / 6), std::sin(10 * numbers::PI / 6), 0) * + Point(std::cos(0 * numbers::PI / 6), + std::sin(0 * numbers::PI / 6), + 7) + + Point(std::cos(10 * numbers::PI / 6), + std::sin(10 * numbers::PI / 6), + 0) * 4, }; diff --git a/tests/fail/hp-step-14.cc b/tests/fail/hp-step-14.cc index f090da3607..0aae5f009c 100644 --- a/tests/fail/hp-step-14.cc +++ b/tests/fail/hp-step-14.cc @@ -118,8 +118,8 @@ namespace Evaluation template PointValueEvaluation::PointValueEvaluation( - const Point &evaluation_point) : - evaluation_point(evaluation_point) + const Point &evaluation_point) + : evaluation_point(evaluation_point) {} @@ -178,8 +178,8 @@ namespace Evaluation template PointXDerivativeEvaluation::PointXDerivativeEvaluation( - const Point &evaluation_point) : - evaluation_point(evaluation_point) + const Point &evaluation_point) + : evaluation_point(evaluation_point) {} @@ -249,8 +249,8 @@ namespace Evaluation template - GridOutput::GridOutput(const std::string &output_name_base) : - output_name_base(output_name_base) + GridOutput::GridOutput(const std::string &output_name_base) + : output_name_base(output_name_base) {} @@ -307,7 +307,8 @@ namespace LaplaceSolver template - Base::Base(Triangulation &coarse_grid) : triangulation(&coarse_grid) + Base::Base(Triangulation &coarse_grid) + : triangulation(&coarse_grid) {} @@ -389,13 +390,13 @@ namespace LaplaceSolver const hp::FECollection & fe, const hp::QCollection & quadrature, const hp::QCollection &face_quadrature, - const Function & boundary_values) : - Base(triangulation), - fe(&fe), - quadrature(&quadrature), - face_quadrature(&face_quadrature), - dof_handler(triangulation), - boundary_values(&boundary_values) + const Function & boundary_values) + : Base(triangulation) + , fe(&fe) + , quadrature(&quadrature) + , face_quadrature(&face_quadrature) + , dof_handler(triangulation) + , boundary_values(&boundary_values) {} @@ -445,8 +446,10 @@ namespace LaplaceSolver const unsigned int n_threads = MultithreadInfo::n_threads(); std::vector> - thread_ranges = Threads::split_range( - dof_handler.begin_active(), dof_handler.end(), n_threads); + thread_ranges = + Threads::split_range(dof_handler.begin_active(), + dof_handler.end(), + n_threads); Threads::Mutex mutex; Threads::ThreadGroup<> threads; @@ -462,14 +465,18 @@ namespace LaplaceSolver linear_system.hanging_node_constraints.condense(linear_system.rhs); std::map boundary_value_map; - VectorTools::interpolate_boundary_values( - dof_handler, 0, *boundary_values, boundary_value_map); + VectorTools::interpolate_boundary_values(dof_handler, + 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); + MatrixTools::apply_boundary_values(boundary_value_map, + linear_system.matrix, + solution, + linear_system.rhs); } @@ -481,8 +488,9 @@ namespace LaplaceSolver const typename hp::DoFHandler::active_cell_iterator &end_cell, Threads::Mutex & mutex) const { - hp::FEValues fe_values( - *fe, *quadrature, update_gradients | update_JxW_values); + hp::FEValues 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(); @@ -512,8 +520,9 @@ namespace LaplaceSolver Threads::Mutex::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)); + linear_system.matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); }; } @@ -602,14 +611,14 @@ namespace LaplaceSolver const hp::QCollection & quadrature, const hp::QCollection &face_quadrature, const Function & rhs_function, - const Function & boundary_values) : - Base(triangulation), - Solver(triangulation, - fe, - quadrature, - face_quadrature, - boundary_values), - rhs_function(&rhs_function) + const Function & boundary_values) + : Base(triangulation) + , Solver(triangulation, + fe, + quadrature, + face_quadrature, + boundary_values) + , rhs_function(&rhs_function) {} @@ -724,14 +733,14 @@ namespace LaplaceSolver const hp::QCollection & quadrature, const hp::QCollection &face_quadrature, const Function & rhs_function, - const Function & boundary_values) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - fe, - quadrature, - face_quadrature, - rhs_function, - boundary_values) + const Function & boundary_values) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + fe, + quadrature, + face_quadrature, + rhs_function, + boundary_values) {} @@ -769,14 +778,14 @@ namespace LaplaceSolver const hp::QCollection & quadrature, const hp::QCollection &face_quadrature, const Function & rhs_function, - const Function & boundary_values) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - fe, - quadrature, - face_quadrature, - rhs_function, - boundary_values) + const Function & boundary_values) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + fe, + quadrature, + face_quadrature, + rhs_function, + boundary_values) {} @@ -792,8 +801,10 @@ namespace LaplaceSolver typename FunctionMap::type(), this->solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - *this->triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(*this->triangulation, + estimated_error_per_cell, + 0.3, + 0.03); this->triangulation->execute_coarsening_and_refinement(); } @@ -828,15 +839,15 @@ namespace LaplaceSolver const hp::QCollection &face_quadrature, const Function & rhs_function, const Function & boundary_values, - const Function & weighting_function) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - fe, - quadrature, - face_quadrature, - rhs_function, - boundary_values), - weighting_function(&weighting_function) + const Function & weighting_function) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + fe, + quadrature, + face_quadrature, + rhs_function, + boundary_values) + , weighting_function(&weighting_function) {} @@ -858,8 +869,10 @@ namespace LaplaceSolver for (unsigned int cell_index = 0; cell != endc; ++cell, ++cell_index) estimated_error(cell_index) *= weighting_function->value(cell->center()); - GridRefinement::refine_and_coarsen_fixed_number( - *this->triangulation, estimated_error, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(*this->triangulation, + estimated_error, + 0.3, + 0.03); this->triangulation->execute_coarsening_and_refinement(); } @@ -939,7 +952,8 @@ namespace Data class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -950,7 +964,8 @@ namespace Data class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -1021,7 +1036,8 @@ namespace Data class RightHandSide : public Functions::ConstantFunction { public: - RightHandSide() : Functions::ConstantFunction(1.) + RightHandSide() + : Functions::ConstantFunction(1.) {} }; @@ -1126,8 +1142,8 @@ namespace DualFunctional template PointValueEvaluation::PointValueEvaluation( - const Point &evaluation_point) : - evaluation_point(evaluation_point) + const Point &evaluation_point) + : evaluation_point(evaluation_point) {} @@ -1180,8 +1196,8 @@ namespace DualFunctional template PointXDerivativeEvaluation::PointXDerivativeEvaluation( - const Point &evaluation_point) : - evaluation_point(evaluation_point) + const Point &evaluation_point) + : evaluation_point(evaluation_point) {} @@ -1280,14 +1296,14 @@ namespace LaplaceSolver const hp::FECollection & fe, const hp::QCollection & quadrature, const hp::QCollection & face_quadrature, - const DualFunctional::DualFunctionalBase &dual_functional) : - Base(triangulation), - Solver(triangulation, - fe, - quadrature, - face_quadrature, - boundary_values), - dual_functional(&dual_functional) + const DualFunctional::DualFunctionalBase &dual_functional) + : Base(triangulation) + , Solver(triangulation, + fe, + quadrature, + face_quadrature, + boundary_values) + , dual_functional(&dual_functional) {} @@ -1440,12 +1456,12 @@ namespace LaplaceSolver WeightedResidual::CellData::CellData( const hp::FECollection &fe, const hp::QCollection & quadrature, - const Function & right_hand_side) : - fe_values(fe, - quadrature, - update_values | update_hessians | update_quadrature_points | - update_JxW_values), - right_hand_side(&right_hand_side) + const Function & right_hand_side) + : fe_values(fe, + quadrature, + update_values | update_hessians | update_quadrature_points | + update_JxW_values) + , right_hand_side(&right_hand_side) { const unsigned int n_q_points = quadrature[0].size(); @@ -1460,16 +1476,16 @@ namespace LaplaceSolver template WeightedResidual::FaceData::FaceData( const hp::FECollection & fe, - const hp::QCollection &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 &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(); @@ -1490,19 +1506,19 @@ namespace LaplaceSolver const hp::QCollection & face_quadrature, const Function & rhs_function, const Function & bv, - const DualFunctional::DualFunctionalBase &dual_functional) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - primal_fe, + const DualFunctional::DualFunctionalBase &dual_functional) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + primal_fe, + quadrature, + face_quadrature, + rhs_function, + bv) + , DualSolver(coarse_grid, + dual_fe, quadrature, face_quadrature, - rhs_function, - bv), - DualSolver(coarse_grid, - dual_fe, - quadrature, - face_quadrature, - dual_functional) + dual_functional) {} @@ -1564,8 +1580,10 @@ namespace LaplaceSolver ++i) *i = std::fabs(*i); - GridRefinement::refine_and_coarsen_fixed_fraction( - *this->triangulation, error_indicators, 0.8, 0.02); + GridRefinement::refine_and_coarsen_fixed_fraction(*this->triangulation, + error_indicators, + 0.8, + 0.02); this->triangulation->execute_coarsening_and_refinement(); } @@ -1675,8 +1693,9 @@ namespace LaplaceSolver 0.5 * face_integrals[cell->face(face_no)]; }; deallog << " Estimated error=" - << std::accumulate( - error_indicators.begin(), error_indicators.end(), 0.) + << std::accumulate(error_indicators.begin(), + error_indicators.end(), + 0.) << std::endl; } @@ -1694,8 +1713,9 @@ namespace LaplaceSolver const PrimalSolver &primal_solver = *this; const DualSolver & dual_solver = *this; - CellData cell_data( - *dual_solver.fe, *dual_solver.quadrature, *primal_solver.rhs_function); + CellData cell_data(*dual_solver.fe, + *dual_solver.quadrature, + *primal_solver.rhs_function); FaceData face_data(*dual_solver.fe, *dual_solver.face_quadrature); active_cell_iterator cell = dual_solver.dof_handler.begin_active(); @@ -1961,11 +1981,11 @@ public: template -Framework::ProblemDescription::ProblemDescription() : - primal_fe_degree(1), - dual_fe_degree(2), - refinement_criterion(dual_weighted_error_estimator), - max_degrees_of_freedom(5000) +Framework::ProblemDescription::ProblemDescription() + : primal_fe_degree(1) + , dual_fe_degree(2) + , refinement_criterion(dual_weighted_error_estimator) + , max_degrees_of_freedom(5000) {} diff --git a/tests/fail/hp-step-15.cc b/tests/fail/hp-step-15.cc index 0ddac8faef..c51512cbe1 100644 --- a/tests/fail/hp-step-15.cc +++ b/tests/fail/hp-step-15.cc @@ -73,7 +73,8 @@ gradient_power(const Tensor<1, dim> &v, const unsigned int n) class InitializationValues : public Function<1> { public: - InitializationValues() : Function<1>() + InitializationValues() + : Function<1>() {} virtual double @@ -140,10 +141,10 @@ private: template -MinimizationProblem::MinimizationProblem(const unsigned int run_number) : - run_number(run_number), - fe(FE_Q(1)), - dof_handler(triangulation) +MinimizationProblem::MinimizationProblem(const unsigned int run_number) + : run_number(run_number) + , fe(FE_Q(1)) + , dof_handler(triangulation) {} @@ -152,8 +153,9 @@ void MinimizationProblem<1>::initialize_solution() { present_solution.reinit(dof_handler.n_dofs()); - VectorTools::interpolate( - dof_handler, InitializationValues(), present_solution); + VectorTools::interpolate(dof_handler, + InitializationValues(), + present_solution); hp::DoFHandler<1>::cell_iterator cell; cell = dof_handler.begin(0); @@ -266,8 +268,9 @@ MinimizationProblem::assemble_step() 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)); + matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); residual(local_dof_indices[i]) += cell_rhs(i); } @@ -277,11 +280,15 @@ MinimizationProblem::assemble_step() hanging_node_constraints.condense(residual); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + boundary_values); if (dim == 1) - VectorTools::interpolate_boundary_values( - dof_handler, 1, Functions::ZeroFunction(), boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 1, + Functions::ZeroFunction(), + boundary_values); Vector dummy(residual.size()); MatrixTools::apply_boundary_values(boundary_values, matrix, dummy, residual); } @@ -489,8 +496,10 @@ MinimizationProblem<1>::refine_grid() } } - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, error_indicators, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + error_indicators, + 0.3, + 0.03); triangulation.prepare_coarsening_and_refinement(); SolutionTransfer solution_transfer(dof_handler); diff --git a/tests/fail/rt_distorted_01.cc b/tests/fail/rt_distorted_01.cc index 73acd030ad..31b134bcd0 100644 --- a/tests/fail/rt_distorted_01.cc +++ b/tests/fail/rt_distorted_01.cc @@ -66,7 +66,8 @@ template class TestMap1 : public Function { public: - TestMap1(const unsigned int n_components) : Function(n_components) + TestMap1(const unsigned int n_components) + : Function(n_components) {} virtual ~TestMap1() @@ -112,9 +113,9 @@ private: const double phi; public: - TestDef1(const unsigned int n_components, const double ph) : - Function(n_components), - phi(ph) + TestDef1(const unsigned int n_components, const double ph) + : Function(n_components) + , phi(ph) {} virtual ~TestDef1() @@ -168,9 +169,9 @@ private: const double scale; public: - TestDef2(const unsigned int n_components, const double sc) : - Function(n_components), - scale(sc) + TestDef2(const unsigned int n_components, const double sc) + : Function(n_components) + , scale(sc) {} virtual ~TestDef2() @@ -220,9 +221,9 @@ private: const double scale; public: - TestDef3(const unsigned int n_components, const double sc) : - Function(n_components), - scale(sc) + TestDef3(const unsigned int n_components, const double sc) + : Function(n_components) + , scale(sc) {} virtual ~TestDef3() @@ -272,11 +273,11 @@ double EvaluateArea(Mapping<2> & mapping, { // Use a high order quadrature. QGauss<2> quad(6); - FEValues<2> fe_values( - mapping, - dof_handler->get_fe(), - quad, - UpdateFlags(update_values | update_quadrature_points | update_JxW_values)); + FEValues<2> fe_values(mapping, + dof_handler->get_fe(), + quad, + UpdateFlags(update_values | update_quadrature_points | + update_JxW_values)); const unsigned int n_q_points = quad.size(); const unsigned int n_components = dof_handler->get_fe().n_components(); diff --git a/tests/fail/rt_distorted_02.cc b/tests/fail/rt_distorted_02.cc index d3f3442478..a51b400f61 100644 --- a/tests/fail/rt_distorted_02.cc +++ b/tests/fail/rt_distorted_02.cc @@ -68,7 +68,8 @@ template class TestMap1 : public Function { public: - TestMap1(const unsigned int n_components) : Function(n_components) + TestMap1(const unsigned int n_components) + : Function(n_components) {} virtual ~TestMap1() @@ -123,9 +124,9 @@ private: const double phi; public: - TestDef1(const unsigned int n_components, const double ph) : - Function(n_components), - phi(ph) + TestDef1(const unsigned int n_components, const double ph) + : Function(n_components) + , phi(ph) {} virtual ~TestDef1() @@ -179,9 +180,9 @@ private: const double scale; public: - TestDef2(const unsigned int n_components, const double sc) : - Function(n_components), - scale(sc) + TestDef2(const unsigned int n_components, const double sc) + : Function(n_components) + , scale(sc) {} virtual ~TestDef2() @@ -231,9 +232,9 @@ private: const double scale; public: - TestDef3(const unsigned int n_components, const double sc) : - Function(n_components), - scale(sc) + TestDef3(const unsigned int n_components, const double sc) + : Function(n_components) + , scale(sc) {} virtual ~TestDef3() diff --git a/tests/fail/step-15.cc b/tests/fail/step-15.cc index 2b5e0f9191..7dc8194dc0 100644 --- a/tests/fail/step-15.cc +++ b/tests/fail/step-15.cc @@ -71,7 +71,8 @@ gradient_power(const Tensor<1, dim> &v, const unsigned int n) class InitializationValues : public Function<1> { public: - InitializationValues() : Function<1>() + InitializationValues() + : Function<1>() {} virtual double @@ -137,10 +138,10 @@ private: template -MinimizationProblem::MinimizationProblem(const unsigned int run_number) : - run_number(run_number), - fe(1), - dof_handler(triangulation) +MinimizationProblem::MinimizationProblem(const unsigned int run_number) + : run_number(run_number) + , fe(1) + , dof_handler(triangulation) {} @@ -149,8 +150,9 @@ void MinimizationProblem<1>::initialize_solution() { present_solution.reinit(dof_handler.n_dofs()); - VectorTools::interpolate( - dof_handler, InitializationValues(), present_solution); + VectorTools::interpolate(dof_handler, + InitializationValues(), + present_solution); DoFHandler<1>::cell_iterator cell; cell = dof_handler.begin(0); @@ -257,8 +259,9 @@ MinimizationProblem::assemble_step() 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)); + matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); residual(local_dof_indices[i]) += cell_rhs(i); } @@ -268,11 +271,15 @@ MinimizationProblem::assemble_step() hanging_node_constraints.condense(residual); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + boundary_values); if (dim == 1) - VectorTools::interpolate_boundary_values( - dof_handler, 1, Functions::ZeroFunction(), boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 1, + Functions::ZeroFunction(), + boundary_values); Vector dummy(residual.size()); MatrixTools::apply_boundary_values(boundary_values, matrix, dummy, residual); } @@ -472,8 +479,10 @@ MinimizationProblem<1>::refine_grid() } } - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, error_indicators, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + error_indicators, + 0.3, + 0.03); triangulation.prepare_coarsening_and_refinement(); SolutionTransfer solution_transfer(dof_handler); diff --git a/tests/fail/vectors_boundary_rhs_hp_02.cc b/tests/fail/vectors_boundary_rhs_hp_02.cc index 6ecb5d33ec..a8fb71b8b8 100644 --- a/tests/fail/vectors_boundary_rhs_hp_02.cc +++ b/tests/fail/vectors_boundary_rhs_hp_02.cc @@ -54,7 +54,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(dim) + MySquareFunction() + : Function(dim) {} virtual double @@ -115,8 +116,10 @@ check() quadrature.push_back(QGauss(3 + i)); Vector rhs(dof.n_dofs()); - VectorTools::create_boundary_right_hand_side( - dof, quadrature, MySquareFunction(), rhs); + VectorTools::create_boundary_right_hand_side(dof, + quadrature, + MySquareFunction(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/fail/vectors_rhs_hp_02.cc b/tests/fail/vectors_rhs_hp_02.cc index 9be4d0bd09..57b183b258 100644 --- a/tests/fail/vectors_rhs_hp_02.cc +++ b/tests/fail/vectors_rhs_hp_02.cc @@ -53,7 +53,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(dim) + MySquareFunction() + : Function(dim) {} virtual double @@ -114,8 +115,10 @@ check() quadrature.push_back(QGauss(3 + i)); Vector rhs(dof.n_dofs()); - VectorTools::create_right_hand_side( - dof, quadrature, MySquareFunction(), rhs); + VectorTools::create_right_hand_side(dof, + quadrature, + MySquareFunction(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/fe/abf_01.cc b/tests/fe/abf_01.cc index d2219ec940..cae1e00bd3 100644 --- a/tests/fe/abf_01.cc +++ b/tests/fe/abf_01.cc @@ -510,8 +510,9 @@ project(const Mapping & mapping, // 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()); + SparsityPattern sparsity(dof.n_dofs(), + dof.n_dofs(), + dof.max_couplings_between_dofs()); DoFTools::make_sparsity_pattern(dof, sparsity); constraints.condense(sparsity); @@ -535,8 +536,10 @@ project(const Mapping & mapping, PreconditionSSOR<> prec; prec.initialize(mass_matrix, 1.2); // solve - check_solver_within_range( - cg.solve(mass_matrix, vec, tmp, prec), control.last_step(), 16, 17); + check_solver_within_range(cg.solve(mass_matrix, vec, tmp, prec), + control.last_step(), + 16, + 17); // distribute solution constraints.distribute(vec); diff --git a/tests/fe/abf_02.cc b/tests/fe/abf_02.cc index e5d9bdd8f9..0c7b4175e4 100644 --- a/tests/fe/abf_02.cc +++ b/tests/fe/abf_02.cc @@ -474,8 +474,9 @@ project(const Mapping & mapping, // 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()); + SparsityPattern sparsity(dof.n_dofs(), + dof.n_dofs(), + dof.max_couplings_between_dofs()); DoFTools::make_sparsity_pattern(dof, sparsity); constraints.condense(sparsity); diff --git a/tests/fe/cell_similarity_11.cc b/tests/fe/cell_similarity_11.cc index b0ec63e48f..32f58e843f 100644 --- a/tests/fe/cell_similarity_11.cc +++ b/tests/fe/cell_similarity_11.cc @@ -66,8 +66,10 @@ test(const Triangulation &tr) points[1][d] = 0.85; const Quadrature quadrature(points); - FEValues fe_values( - mapping, fe, quadrature, update_gradients | update_jacobians); + FEValues fe_values(mapping, + fe, + quadrature, + update_gradients | update_jacobians); for (typename DoFHandler::active_cell_iterator cell = dof.begin_active(); cell != dof.end(); diff --git a/tests/fe/curl_curl_01.cc b/tests/fe/curl_curl_01.cc index 21d15ad5ee..363730cbfc 100644 --- a/tests/fe/curl_curl_01.cc +++ b/tests/fe/curl_curl_01.cc @@ -111,7 +111,8 @@ template class ExactSolution : public Function { public: - ExactSolution() : Function(2) + ExactSolution() + : Function(2) {} virtual double value(const Point &p, const unsigned int component) const; @@ -223,7 +224,8 @@ ExactSolution::vector_value_list(const std::vector> &points, // DEFINE RIGHT HAND SIDE MEMBERS template -RightHandSide::RightHandSide() : Function(dim) +RightHandSide::RightHandSide() + : Function(dim) {} template inline void @@ -258,9 +260,9 @@ RightHandSide::vector_value_list( // END RIGHT HAND SIDE MEMBERS template -MaxwellProblem::MaxwellProblem(const unsigned int order) : - dof_handler(triangulation), - fe(order) +MaxwellProblem::MaxwellProblem(const unsigned int order) + : dof_handler(triangulation) + , fe(order) { p_order = order; quad_order = p_order + 2; diff --git a/tests/fe/deformed_projection.h b/tests/fe/deformed_projection.h index eaa17ae412..3024bc3ec5 100644 --- a/tests/fe/deformed_projection.h +++ b/tests/fe/deformed_projection.h @@ -71,7 +71,8 @@ template class TestMap1 : public Function { public: - TestMap1(const unsigned int n_components) : Function(n_components) + TestMap1(const unsigned int n_components) + : Function(n_components) {} virtual ~TestMap1() @@ -564,8 +565,9 @@ project(const Mapping & mapping, // 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()); + SparsityPattern sparsity(dof.n_dofs(), + dof.n_dofs(), + dof.max_couplings_between_dofs()); DoFTools::make_sparsity_pattern(dof, sparsity); constraints.condense(sparsity); diff --git a/tests/fe/derivatives.cc b/tests/fe/derivatives.cc index c4ea3fc36c..58a110b9d3 100644 --- a/tests/fe/derivatives.cc +++ b/tests/fe/derivatives.cc @@ -54,8 +54,10 @@ plot_derivatives(Mapping & mapping, QTrapez q; // QIterated q(q_trapez, div); - FEValues fe( - mapping, finel, q, UpdateFlags(update_gradients | update_hessians)); + FEValues fe(mapping, + finel, + q, + UpdateFlags(update_gradients | update_hessians)); fe.reinit(c); unsigned int k = 0; diff --git a/tests/fe/derivatives_bernstein.cc b/tests/fe/derivatives_bernstein.cc index ba44967798..3fd77acff8 100644 --- a/tests/fe/derivatives_bernstein.cc +++ b/tests/fe/derivatives_bernstein.cc @@ -53,8 +53,10 @@ plot_derivatives(Mapping & mapping, QTrapez q; // QIterated q(q_trapez, div); - FEValues fe( - mapping, finel, q, UpdateFlags(update_gradients | update_hessians)); + FEValues fe(mapping, + finel, + q, + UpdateFlags(update_gradients | update_hessians)); fe.reinit(c); unsigned int k = 0; diff --git a/tests/fe/derivatives_face.cc b/tests/fe/derivatives_face.cc index 8a85fa2e73..7529a18f22 100644 --- a/tests/fe/derivatives_face.cc +++ b/tests/fe/derivatives_face.cc @@ -52,8 +52,10 @@ plot_derivatives(Mapping & mapping, QGauss q(1); // QIterated q(q_trapez, div); - FEFaceValues fe( - mapping, finel, q, UpdateFlags(update_gradients | update_hessians)); + FEFaceValues fe(mapping, + finel, + q, + UpdateFlags(update_gradients | update_hessians)); for (unsigned int face = 0; face < GeometryInfo::faces_per_cell; ++face) { fe.reinit(c, face); diff --git a/tests/fe/fe_dgq_hessian_divergence_theorem.cc b/tests/fe/fe_dgq_hessian_divergence_theorem.cc index df159a0c5e..e83c015e84 100644 --- a/tests/fe/fe_dgq_hessian_divergence_theorem.cc +++ b/tests/fe/fe_dgq_hessian_divergence_theorem.cc @@ -121,8 +121,9 @@ test(const Triangulation &tr, { Tensor<1, dim> gradient = fe_face_values[single_component].gradient(i, q); - Tensor<2, dim> gradient_normal_outer_prod = outer_product( - gradient, fe_face_values.normal_vector(q)); + Tensor<2, dim> gradient_normal_outer_prod = + outer_product(gradient, + fe_face_values.normal_vector(q)); boundary_integral += gradient_normal_outer_prod * fe_face_values.JxW(q); } diff --git a/tests/fe/fe_enriched_01.cc b/tests/fe/fe_enriched_01.cc index bdbcda518e..d79ea41315 100644 --- a/tests/fe/fe_enriched_01.cc +++ b/tests/fe/fe_enriched_01.cc @@ -51,7 +51,8 @@ template class EnrichmentFunction : public Function { public: - EnrichmentFunction() : Function(1) + EnrichmentFunction() + : Function(1) {} virtual double diff --git a/tests/fe/fe_enriched_02.cc b/tests/fe/fe_enriched_02.cc index b6bed57355..4bc345da3b 100644 --- a/tests/fe/fe_enriched_02.cc +++ b/tests/fe/fe_enriched_02.cc @@ -58,7 +58,8 @@ template class EnrichmentFunction : public Function { public: - EnrichmentFunction() : Function(1) + EnrichmentFunction() + : Function(1) {} virtual double @@ -95,8 +96,9 @@ test1() dof_handler.distribute_dofs(fe); QGauss quadrature(1); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_JxW_values); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_JxW_values); typename DoFHandler::active_cell_iterator cell = dof_handler.begin_active(), diff --git a/tests/fe/fe_enriched_03.cc b/tests/fe/fe_enriched_03.cc index b864778d5e..fd951fdce7 100644 --- a/tests/fe/fe_enriched_03.cc +++ b/tests/fe/fe_enriched_03.cc @@ -50,7 +50,8 @@ template class EnrichmentFunction : public Function { public: - EnrichmentFunction() : Function(1) + EnrichmentFunction() + : Function(1) {} virtual double diff --git a/tests/fe/fe_enriched_04.cc b/tests/fe/fe_enriched_04.cc index 902153d367..7d3f832e46 100644 --- a/tests/fe/fe_enriched_04.cc +++ b/tests/fe/fe_enriched_04.cc @@ -58,7 +58,8 @@ template class EnrichmentFunction : public Function { public: - EnrichmentFunction() : Function(1) + EnrichmentFunction() + : Function(1) {} virtual double @@ -96,8 +97,9 @@ test3() dof_handler.distribute_dofs(fe); QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_JxW_values); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_JxW_values); Vector solution_fe(dof_handler.n_dofs()), solution_pou(dof_handler.n_dofs()), solution(dof_handler.n_dofs()); diff --git a/tests/fe/fe_enriched_05.cc b/tests/fe/fe_enriched_05.cc index b0ba749dfc..5e9dbfd46f 100644 --- a/tests/fe/fe_enriched_05.cc +++ b/tests/fe/fe_enriched_05.cc @@ -58,7 +58,8 @@ template class EnrichmentFunction : public Function { public: - EnrichmentFunction() : Function(1) + EnrichmentFunction() + : Function(1) {} virtual double diff --git a/tests/fe/fe_enriched_06.cc b/tests/fe/fe_enriched_06.cc index bafd42f324..d0cad099b3 100644 --- a/tests/fe/fe_enriched_06.cc +++ b/tests/fe/fe_enriched_06.cc @@ -59,7 +59,8 @@ template class EnrichmentFunction : public Function { public: - EnrichmentFunction() : Function(1) + EnrichmentFunction() + : Function(1) {} virtual double diff --git a/tests/fe/fe_enriched_07.cc b/tests/fe/fe_enriched_07.cc index 2763e32b90..6bd3ee04e8 100644 --- a/tests/fe/fe_enriched_07.cc +++ b/tests/fe/fe_enriched_07.cc @@ -58,7 +58,8 @@ template class EnrichmentFunction : public Function { public: - EnrichmentFunction() : Function(1) + EnrichmentFunction() + : Function(1) {} virtual double diff --git a/tests/fe/fe_enriched_08.cc b/tests/fe/fe_enriched_08.cc index f21284931a..b0d8b33b64 100644 --- a/tests/fe/fe_enriched_08.cc +++ b/tests/fe/fe_enriched_08.cc @@ -59,7 +59,8 @@ template class EnrichmentFunction : public Function { public: - EnrichmentFunction() : Function(1) + EnrichmentFunction() + : Function(1) {} virtual double @@ -89,15 +90,18 @@ test2cells(const unsigned int p_feq = 2, const unsigned int p_feen = 1) { Triangulation triangulationL; Triangulation triangulationR; - GridGenerator::hyper_cube( - triangulationL, -1, 0); // create a square [-1,0]^d domain - GridGenerator::hyper_cube( - triangulationR, -1, 0); // create a square [-1,0]^d domain + GridGenerator::hyper_cube(triangulationL, + -1, + 0); // create a square [-1,0]^d domain + GridGenerator::hyper_cube(triangulationR, + -1, + 0); // create a square [-1,0]^d domain Point shift_vector; shift_vector[0] = 1.0; GridTools::shift(shift_vector, triangulationR); - GridGenerator::merge_triangulations( - triangulationL, triangulationR, triangulation); + GridGenerator::merge_triangulations(triangulationL, + triangulationR, + triangulation); } hp::DoFHandler dof_handler(triangulation); diff --git a/tests/fe/fe_enriched_08a.cc b/tests/fe/fe_enriched_08a.cc index 62f9693dc5..07d4796e25 100644 --- a/tests/fe/fe_enriched_08a.cc +++ b/tests/fe/fe_enriched_08a.cc @@ -57,15 +57,18 @@ test2cellsFESystem(const unsigned int p_feq = 2, const unsigned int p_feen = 1) { Triangulation triangulationL; Triangulation triangulationR; - GridGenerator::hyper_cube( - triangulationL, -1, 0); // create a square [-1,0]^d domain - GridGenerator::hyper_cube( - triangulationR, -1, 0); // create a square [-1,0]^d domain + GridGenerator::hyper_cube(triangulationL, + -1, + 0); // create a square [-1,0]^d domain + GridGenerator::hyper_cube(triangulationR, + -1, + 0); // create a square [-1,0]^d domain Point shift_vector; shift_vector[0] = 1.0; GridTools::shift(shift_vector, triangulationR); - GridGenerator::merge_triangulations( - triangulationL, triangulationR, triangulation); + GridGenerator::merge_triangulations(triangulationL, + triangulationR, + triangulation); } hp::DoFHandler dof_handler(triangulation); diff --git a/tests/fe/fe_enriched_compare_to_fe_system.cc b/tests/fe/fe_enriched_compare_to_fe_system.cc index 759d355e29..1bfaf32973 100644 --- a/tests/fe/fe_enriched_compare_to_fe_system.cc +++ b/tests/fe/fe_enriched_compare_to_fe_system.cc @@ -63,7 +63,8 @@ template class EnrichmentFunction : public Function { public: - EnrichmentFunction() : Function(1) + EnrichmentFunction() + : Function(1) {} virtual double @@ -179,8 +180,10 @@ test(const FiniteElement & fe1, p2[d] = 2.0; repetitions[d] = 3; } - GridGenerator::subdivided_hyper_rectangle( - triangulation, repetitions, p1, p2); + GridGenerator::subdivided_hyper_rectangle(triangulation, + repetitions, + p1, + p2); if (distort) GridTools::distort_random(0.1, triangulation); diff --git a/tests/fe/fe_enriched_compare_to_fe_system_2.cc b/tests/fe/fe_enriched_compare_to_fe_system_2.cc index dc96ffe8be..d9adfba7ab 100644 --- a/tests/fe/fe_enriched_compare_to_fe_system_2.cc +++ b/tests/fe/fe_enriched_compare_to_fe_system_2.cc @@ -65,9 +65,9 @@ template class EnrichmentFunction : public Function { public: - EnrichmentFunction(const Point &origin) : - Function(1), - origin(origin) + EnrichmentFunction(const Point &origin) + : Function(1) + , origin(origin) {} virtual double @@ -255,8 +255,10 @@ test(const FiniteElement & fe_base, p2[d] = 2.0; repetitions[d] = 3; } - GridGenerator::subdivided_hyper_rectangle( - triangulation, repetitions, p1, p2); + GridGenerator::subdivided_hyper_rectangle(triangulation, + repetitions, + p1, + p2); if (distort) GridTools::distort_random(0.1, triangulation); diff --git a/tests/fe/fe_enriched_step-36.cc b/tests/fe/fe_enriched_step-36.cc index 9eccfa4377..f6c32fc444 100644 --- a/tests/fe/fe_enriched_step-36.cc +++ b/tests/fe/fe_enriched_step-36.cc @@ -65,7 +65,8 @@ template class PotentialFunction : public Function { public: - PotentialFunction() : Function(1) + PotentialFunction() + : Function(1) {} virtual double @@ -86,11 +87,11 @@ class EnrichmentFunction : public Function public: EnrichmentFunction(const Point &origin, const double & Z, - const double & radius) : - Function(1), - origin(origin), - Z(Z), - radius(radius) + const double & radius) + : Function(1) + , origin(origin) + , Z(Z) + , radius(radius) {} virtual double @@ -207,23 +208,23 @@ namespace Step36 }; template - EigenvalueProblem::EigenvalueProblem() : - dof_handler(triangulation), - mpi_communicator(MPI_COMM_WORLD), - n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)), - this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)), - pcout(std::cout, (this_mpi_process == 0)), - number_of_eigenvalues(1), - enrichment( - Point(), - /*Z*/ 1.0, - /*radius*/ 2.5), // radius is set such that 8 cells are marked as enriched - fe_extractor(/*dofs start at...*/ 0), - fe_fe_index(0), - fe_material_id(0), - pou_extractor(/*dofs start at (scalar fields!)*/ 1), - pou_fe_index(1), - pou_material_id(1) + EigenvalueProblem::EigenvalueProblem() + : dof_handler(triangulation) + , mpi_communicator(MPI_COMM_WORLD) + , n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)) + , this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)) + , pcout(std::cout, (this_mpi_process == 0)) + , number_of_eigenvalues(1) + , enrichment(Point(), + /*Z*/ 1.0, + /*radius*/ 2.5) + , // radius is set such that 8 cells are marked as enriched + fe_extractor(/*dofs start at...*/ 0) + , fe_fe_index(0) + , fe_material_id(0) + , pou_extractor(/*dofs start at (scalar fields!)*/ 1) + , pou_fe_index(1) + , pou_material_id(1) { GridGenerator::hyper_cube(triangulation, -10, 10); triangulation.refine_global(2); // 64 cells @@ -293,8 +294,10 @@ namespace Step36 constraints.clear(); constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(1), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(1), + constraints); constraints.close(); // Initialise the stiffness and mass matrices @@ -309,14 +312,20 @@ namespace Step36 n_locally_owned_dofs[i] = locally_owned_dofs_per_processor[i].n_elements(); - SparsityTools::distribute_sparsity_pattern( - csp, n_locally_owned_dofs, mpi_communicator, locally_relevant_dofs); + SparsityTools::distribute_sparsity_pattern(csp, + n_locally_owned_dofs, + mpi_communicator, + locally_relevant_dofs); - stiffness_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + stiffness_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); - mass_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + mass_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); // reinit vectors eigenfunctions.resize(number_of_eigenvalues); @@ -326,8 +335,9 @@ namespace Step36 { eigenfunctions[i].reinit(locally_owned_dofs, mpi_communicator); // without ghost dofs - eigenfunctions_locally_relevant[i].reinit( - locally_owned_dofs, locally_relevant_dofs, mpi_communicator); + eigenfunctions_locally_relevant[i].reinit(locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); vec_estimated_error_per_cell[i].reinit(triangulation.n_active_cells()); } @@ -429,10 +439,12 @@ namespace Step36 cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_stiffness_matrix, local_dof_indices, stiffness_matrix); - constraints.distribute_local_to_global( - cell_mass_matrix, local_dof_indices, mass_matrix); + constraints.distribute_local_to_global(cell_stiffness_matrix, + local_dof_indices, + stiffness_matrix); + constraints.distribute_local_to_global(cell_mass_matrix, + local_dof_indices, + mass_matrix); } stiffness_matrix.compress(VectorOperation::add); diff --git a/tests/fe/fe_enriched_step-36b.cc b/tests/fe/fe_enriched_step-36b.cc index 82d0b67086..e56cb22beb 100644 --- a/tests/fe/fe_enriched_step-36b.cc +++ b/tests/fe/fe_enriched_step-36b.cc @@ -69,7 +69,8 @@ template class PotentialFunction : public dealii::Function { public: - PotentialFunction() : dealii::Function(1) + PotentialFunction() + : dealii::Function(1) {} virtual double @@ -91,11 +92,11 @@ class EnrichmentFunction : public Function public: EnrichmentFunction(const Point &origin, const double & Z, - const double & radius) : - Function(1), - origin(origin), - Z(Z), - radius(radius) + const double & radius) + : Function(1) + , origin(origin) + , Z(Z) + , radius(radius) {} virtual double @@ -215,26 +216,26 @@ namespace Step36 }; template - EigenvalueProblem::EigenvalueProblem() : - dof_handler(triangulation), - mpi_communicator(MPI_COMM_WORLD), - n_mpi_processes(dealii::Utilities::MPI::n_mpi_processes(mpi_communicator)), - this_mpi_process( - dealii::Utilities::MPI::this_mpi_process(mpi_communicator)), - pcout(std::cout, (this_mpi_process == 0)), - number_of_eigenvalues(1), - enrichment( - Point(), - /*Z*/ 1.0, - /*radius*/ 2.5), // radius is set such that 8 cells are marked as enriched - fe_extractor(/*dofs start at...*/ 0), - fe_group(/*in FE*/ 0), - fe_fe_index(0), - fe_material_id(0), - pou_extractor(/*dofs start at (scalar fields!)*/ 1), - pou_group(/*FE*/ 1), - pou_fe_index(1), - pou_material_id(1) + EigenvalueProblem::EigenvalueProblem() + : dof_handler(triangulation) + , mpi_communicator(MPI_COMM_WORLD) + , n_mpi_processes(dealii::Utilities::MPI::n_mpi_processes(mpi_communicator)) + , this_mpi_process( + dealii::Utilities::MPI::this_mpi_process(mpi_communicator)) + , pcout(std::cout, (this_mpi_process == 0)) + , number_of_eigenvalues(1) + , enrichment(Point(), + /*Z*/ 1.0, + /*radius*/ 2.5) + , // radius is set such that 8 cells are marked as enriched + fe_extractor(/*dofs start at...*/ 0) + , fe_group(/*in FE*/ 0) + , fe_fe_index(0) + , fe_material_id(0) + , pou_extractor(/*dofs start at (scalar fields!)*/ 1) + , pou_group(/*FE*/ 1) + , pou_fe_index(1) + , pou_material_id(1) { dealii::GridGenerator::hyper_cube(triangulation, -10, 10); triangulation.refine_global(2); // 64 cells @@ -303,8 +304,10 @@ namespace Step36 constraints.clear(); constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(2), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(2), + constraints); constrain_pou_dofs(); constraints.close(); @@ -320,14 +323,20 @@ namespace Step36 n_locally_owned_dofs[i] = locally_owned_dofs_per_processor[i].n_elements(); - SparsityTools::distribute_sparsity_pattern( - csp, n_locally_owned_dofs, mpi_communicator, locally_relevant_dofs); + SparsityTools::distribute_sparsity_pattern(csp, + n_locally_owned_dofs, + mpi_communicator, + locally_relevant_dofs); - stiffness_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + stiffness_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); - mass_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + mass_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); // reinit vectors eigenfunctions.resize(number_of_eigenvalues); @@ -337,8 +346,9 @@ namespace Step36 { eigenfunctions[i].reinit(locally_owned_dofs, mpi_communicator); // without ghost dofs - eigenfunctions_locally_relevant[i].reinit( - locally_owned_dofs, locally_relevant_dofs, mpi_communicator); + eigenfunctions_locally_relevant[i].reinit(locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); vec_estimated_error_per_cell[i].reinit(triangulation.n_active_cells()); } @@ -632,10 +642,12 @@ namespace Step36 cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_stiffness_matrix, local_dof_indices, stiffness_matrix); - constraints.distribute_local_to_global( - cell_mass_matrix, local_dof_indices, mass_matrix); + constraints.distribute_local_to_global(cell_stiffness_matrix, + local_dof_indices, + stiffness_matrix); + constraints.distribute_local_to_global(cell_mass_matrix, + local_dof_indices, + mass_matrix); } stiffness_matrix.compress(dealii::VectorOperation::add); @@ -646,8 +658,10 @@ namespace Step36 std::pair EigenvalueProblem::solve() { - dealii::SolverControl solver_control( - dof_handler.n_dofs(), 1e-9, false, false); + dealii::SolverControl solver_control(dof_handler.n_dofs(), + 1e-9, + false, + false); dealii::SLEPcWrappers::SolverKrylovSchur eigensolver(solver_control, mpi_communicator); @@ -745,10 +759,10 @@ namespace Step36 }; template - Postprocessor::Postprocessor(const EnrichmentFunction &enrichment) : - DataPostprocessorScalar("total_solution", - update_values | update_q_points), - enrichment(enrichment) + Postprocessor::Postprocessor(const EnrichmentFunction &enrichment) + : DataPostprocessorScalar("total_solution", + update_values | update_q_points) + , enrichment(enrichment) {} template @@ -893,8 +907,9 @@ main(int argc, char **argv) { try { - dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, 1); + dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, + argv, + 1); { Step36::EigenvalueProblem step36; dealii::PETScWrappers::set_option_value("-eps_target", "-1.0"); diff --git a/tests/fe/fe_face_orientation_nedelec.h b/tests/fe/fe_face_orientation_nedelec.h index 83063084cc..63b3f6253f 100644 --- a/tests/fe/fe_face_orientation_nedelec.h +++ b/tests/fe/fe_face_orientation_nedelec.h @@ -38,8 +38,10 @@ void create_reference_triangulation(Triangulation<3> &tria) std::vector 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)); + 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, @@ -194,10 +196,11 @@ evaluate(const FE_Nedelec<3> & fe, const QGauss<3> quadrature(2); const unsigned int n_q_points = quadrature.size(); Functions::FEFieldFunction<3> fe_field_function(dof_handler, u); - FEValues<3> fe_values( - fe, quadrature, update_quadrature_points | update_values); - std::vector> values(n_q_points, Vector(3)); - std::vector> values_ref(n_q_points); + FEValues<3> fe_values(fe, + quadrature, + update_quadrature_points | update_values); + std::vector> values(n_q_points, Vector(3)); + std::vector> values_ref(n_q_points); for (DoFHandler<3>::active_cell_iterator cell = dof_handler_ref.begin_active(); diff --git a/tests/fe/fe_face_orientation_nedelec_0.cc b/tests/fe/fe_face_orientation_nedelec_0.cc index c283953bf8..1d85e938d9 100644 --- a/tests/fe/fe_face_orientation_nedelec_0.cc +++ b/tests/fe/fe_face_orientation_nedelec_0.cc @@ -112,10 +112,11 @@ evaluate(const FE_Nedelec<3> & fe, const QGauss<3> quadrature(2); const unsigned int n_q_points = quadrature.size(); Functions::FEFieldFunction<3> fe_field_function(dof_handler, u); - FEValues<3> fe_values( - fe, quadrature, update_quadrature_points | update_values); - std::vector> values(n_q_points, Vector(3)); - std::vector> values_ref(n_q_points); + FEValues<3> fe_values(fe, + quadrature, + update_quadrature_points | update_values); + std::vector> values(n_q_points, Vector(3)); + std::vector> values_ref(n_q_points); for (DoFHandler<3>::active_cell_iterator cell = dof_handler_ref.begin_active(); diff --git a/tests/fe/fe_face_values_1d.cc b/tests/fe/fe_face_values_1d.cc index 3677425377..04732081e2 100644 --- a/tests/fe/fe_face_values_1d.cc +++ b/tests/fe/fe_face_values_1d.cc @@ -57,12 +57,13 @@ plot_faces(Mapping & mapping, QGauss q(4); Assert(q.size() == 1, ExcInternalError()); - FEFaceValues fe_values( - mapping, - fe, - q, - UpdateFlags(update_quadrature_points | update_JxW_values | update_values | - update_gradients | update_hessians | update_normal_vectors)); + FEFaceValues fe_values(mapping, + fe, + q, + UpdateFlags(update_quadrature_points | + update_JxW_values | update_values | + update_gradients | update_hessians | + update_normal_vectors)); for (unsigned int face_nr = 0; face_nr < GeometryInfo::faces_per_cell; ++face_nr) diff --git a/tests/fe/fe_nedelec_hessian_divergence_theorem.cc b/tests/fe/fe_nedelec_hessian_divergence_theorem.cc index b235f719c0..9fc681e1e1 100644 --- a/tests/fe/fe_nedelec_hessian_divergence_theorem.cc +++ b/tests/fe/fe_nedelec_hessian_divergence_theorem.cc @@ -121,8 +121,9 @@ test(const Triangulation &tr, { Tensor<1, dim> gradient = fe_face_values[single_component].gradient(i, q); - Tensor<2, dim> gradient_normal_outer_prod = outer_product( - gradient, fe_face_values.normal_vector(q)); + Tensor<2, dim> gradient_normal_outer_prod = + outer_product(gradient, + fe_face_values.normal_vector(q)); boundary_integral += gradient_normal_outer_prod * fe_face_values.JxW(q); } diff --git a/tests/fe/fe_nedelec_sz_face_orientation.cc b/tests/fe/fe_nedelec_sz_face_orientation.cc index e995454974..d1395486f5 100644 --- a/tests/fe/fe_nedelec_sz_face_orientation.cc +++ b/tests/fe/fe_nedelec_sz_face_orientation.cc @@ -39,8 +39,10 @@ void create_reference_triangulation(Triangulation<3> &tria) std::vector 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)); + 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, diff --git a/tests/fe/fe_nedelec_sz_non_rect_2d.cc b/tests/fe/fe_nedelec_sz_non_rect_2d.cc index 5cfa20d768..68f57c504c 100644 --- a/tests/fe/fe_nedelec_sz_non_rect_2d.cc +++ b/tests/fe/fe_nedelec_sz_non_rect_2d.cc @@ -79,7 +79,8 @@ namespace polytest class SimplePolynomial : public Function { public: - SimplePolynomial() : Function(2) + SimplePolynomial() + : Function(2) {} void vector_value_list(const std::vector> &points, @@ -161,11 +162,11 @@ namespace polytest }; template - polytest::polytest(unsigned int degree) : - p_order(degree), - quad_order(2 * degree + 3), - dof_handler(tria), - fe(degree) + polytest::polytest(unsigned int degree) + : p_order(degree) + , quad_order(2 * degree + 3) + , dof_handler(tria) + , fe(degree) {} template polytest::~polytest() @@ -189,8 +190,10 @@ namespace polytest dof_handler, 0, boundary_function, 0, constraints); constraints.close(); DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern( - dof_handler, c_sparsity, constraints, false); + DoFTools::make_sparsity_pattern(dof_handler, + c_sparsity, + constraints, + false); sparsity_pattern.copy_from(c_sparsity); system_matrix.reinit(sparsity_pattern); diff --git a/tests/fe/fe_nedelec_sz_non_rect_face.cc b/tests/fe/fe_nedelec_sz_non_rect_face.cc index 9a794d50e6..e633222ca2 100644 --- a/tests/fe/fe_nedelec_sz_non_rect_face.cc +++ b/tests/fe/fe_nedelec_sz_non_rect_face.cc @@ -97,7 +97,8 @@ namespace Maxwell }; template - ExactSolution::ExactSolution() : Function(dim) + ExactSolution::ExactSolution() + : Function(dim) {} template void @@ -184,11 +185,11 @@ namespace Maxwell }; template - MaxwellProblem::MaxwellProblem(const unsigned int order) : - mapping(1), - dof_handler(triangulation), - fe(order), - exact_solution() + MaxwellProblem::MaxwellProblem(const unsigned int order) + : mapping(1) + , dof_handler(triangulation) + , fe(order) + , exact_solution() { p_order = order; quad_order = 2 * (p_order + 1); @@ -302,8 +303,10 @@ namespace Maxwell constraints.close(); DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern( - dof_handler, c_sparsity, constraints, false); + DoFTools::make_sparsity_pattern(dof_handler, + c_sparsity, + constraints, + false); sparsity_pattern.copy_from(c_sparsity); system_matrix.reinit(sparsity_pattern); diff --git a/tests/fe/fe_nothing.cc b/tests/fe/fe_nothing.cc index 5a3c286344..cc7a452901 100644 --- a/tests/fe/fe_nothing.cc +++ b/tests/fe/fe_nothing.cc @@ -30,15 +30,18 @@ test2cells(const unsigned int p1 = 2, const unsigned int p2 = 1) { Triangulation triangulationL; Triangulation triangulationR; - GridGenerator::hyper_cube( - triangulationL, -1, 0); // create a square [-1,0]^d domain - GridGenerator::hyper_cube( - triangulationR, -1, 0); // create a square [-1,0]^d domain + GridGenerator::hyper_cube(triangulationL, + -1, + 0); // create a square [-1,0]^d domain + GridGenerator::hyper_cube(triangulationR, + -1, + 0); // create a square [-1,0]^d domain Point shift_vector; shift_vector[0] = 1.0; GridTools::shift(shift_vector, triangulationR); - GridGenerator::merge_triangulations( - triangulationL, triangulationR, triangulation); + GridGenerator::merge_triangulations(triangulationL, + triangulationR, + triangulation); } hp::DoFHandler dof_handler(triangulation); diff --git a/tests/fe/fe_project_2d.cc b/tests/fe/fe_project_2d.cc index da7845ba98..86d1cf1c26 100644 --- a/tests/fe/fe_project_2d.cc +++ b/tests/fe/fe_project_2d.cc @@ -99,7 +99,8 @@ template class VectorFunction : public Function { public: - VectorFunction() : Function(dim) + VectorFunction() + : Function(dim) {} virtual double value(const Point &p, const unsigned int component) const; @@ -237,8 +238,10 @@ test(const FiniteElement &fe, triangulation.refine_global(); else { - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, diff, 0.3, 0.0); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + diff, + 0.3, + 0.0); triangulation.prepare_coarsening_and_refinement(); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/fe/fe_project_3d.cc b/tests/fe/fe_project_3d.cc index 206e6d47b5..c0c9008c0e 100644 --- a/tests/fe/fe_project_3d.cc +++ b/tests/fe/fe_project_3d.cc @@ -113,7 +113,8 @@ template class VectorFunction : public Function { public: - VectorFunction() : Function(dim) + VectorFunction() + : Function(dim) {} virtual double value(const Point &p, const unsigned int component) const; @@ -287,13 +288,14 @@ test(const FiniteElement &fe, update_JxW_values | update_quadrature_points | update_values | update_gradients | update_hessians); - FEFaceValues fe_face_values( - mapping, - fe, - face_quadrature, - update_JxW_values | update_quadrature_points | update_values | - update_gradients | update_normal_vectors); - unsigned int cell_index = 0; + FEFaceValues fe_face_values(mapping, + fe, + face_quadrature, + update_JxW_values | + update_quadrature_points | + update_values | update_gradients | + update_normal_vectors); + unsigned int cell_index = 0; for (typename DoFHandler::active_cell_iterator cell = dof_handler.begin_active(); @@ -393,8 +395,10 @@ test(const FiniteElement &fe, triangulation.refine_global(); else { - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, diff, 0.3, 0.0); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + diff, + 0.3, + 0.0); triangulation.prepare_coarsening_and_refinement(); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/fe/fe_prolongation_sys_06.cc b/tests/fe/fe_prolongation_sys_06.cc index 8760865e6b..0069969a72 100644 --- a/tests/fe/fe_prolongation_sys_06.cc +++ b/tests/fe/fe_prolongation_sys_06.cc @@ -24,12 +24,12 @@ main() { initlog(); - CHECK_SYS3( - FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(), 3)), - 1, - FESystem<2>(FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(), 3)), 3), - 1, - FESystem<2>(FE_Q<2>(2), 3, FE_DGQ<2>(0), 1), - 2, - 2); + CHECK_SYS3(FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(), 3)), + 1, + FESystem<2>(FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(), 3)), + 3), + 1, + FESystem<2>(FE_Q<2>(2), 3, FE_DGQ<2>(0), 1), + 2, + 2); } diff --git a/tests/fe/fe_prolongation_sys_08.cc b/tests/fe/fe_prolongation_sys_08.cc index 56cc6a94fe..881c1eb7ef 100644 --- a/tests/fe/fe_prolongation_sys_08.cc +++ b/tests/fe/fe_prolongation_sys_08.cc @@ -24,12 +24,12 @@ main() { initlog(); - CHECK_SYS3( - FE_Nedelec<2>(0), - 1, - FESystem<2>(FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(), 3)), 3), - 1, - FESystem<2>(FE_Q<2>(2), 3, FE_Nedelec<2>(0), 2), - 2, - 2); + CHECK_SYS3(FE_Nedelec<2>(0), + 1, + FESystem<2>(FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(), 3)), + 3), + 1, + FESystem<2>(FE_Q<2>(2), 3, FE_Nedelec<2>(0), 2), + 2, + 2); } diff --git a/tests/fe/fe_q_bubbles.cc b/tests/fe/fe_q_bubbles.cc index 37b7b0b0e6..d989f220cc 100644 --- a/tests/fe/fe_q_bubbles.cc +++ b/tests/fe/fe_q_bubbles.cc @@ -71,11 +71,10 @@ private: }; template -BubbleFunction::BubbleFunction(unsigned int degree, - unsigned int direction) : - Function(), - m_degree(degree), - m_direction(direction) +BubbleFunction::BubbleFunction(unsigned int degree, unsigned int direction) + : Function() + , m_degree(degree) + , m_direction(direction) {} template @@ -157,10 +156,10 @@ private: }; template -Step3::Step3(FiniteElement *fe, const unsigned int degree) : - fe(fe), - dof_handler(triangulation), - m_degree(degree + 1) +Step3::Step3(FiniteElement *fe, const unsigned int degree) + : fe(fe) + , dof_handler(triangulation) + , m_degree(degree + 1) {} @@ -240,8 +239,9 @@ Step3::assemble_system(unsigned int i) 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_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); diff --git a/tests/fe/fe_q_dg0.cc b/tests/fe/fe_q_dg0.cc index 80854c0e2a..82a1f1cb9f 100644 --- a/tests/fe/fe_q_dg0.cc +++ b/tests/fe/fe_q_dg0.cc @@ -125,7 +125,8 @@ namespace Step22 class ExactSolution : public Function { public: - ExactSolution() : Function(dim + 1) + ExactSolution() + : Function(dim + 1) {} /*virtual*/ double @@ -259,7 +260,8 @@ namespace Step22 class JumpFunction : public Function { public: - JumpFunction() : Function(1) + JumpFunction() + : Function(1) {} double @@ -287,7 +289,8 @@ namespace Step22 class RightHandSide : public Function { public: - RightHandSide() : Function(dim + 1) + RightHandSide() + : Function(dim + 1) {} /*virtual*/ double @@ -329,9 +332,9 @@ namespace Step22 template InverseMatrix::InverseMatrix( const Matrix & m, - const Preconditioner &preconditioner) : - matrix(&m), - preconditioner(&preconditioner) + const Preconditioner &preconditioner) + : matrix(&m) + , preconditioner(&preconditioner) {} template @@ -377,11 +380,11 @@ namespace Step22 template SchurComplement::SchurComplement( const BlockSparseMatrix & system_matrix, - const InverseMatrix, 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()) + const InverseMatrix, 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()) {} @@ -397,11 +400,11 @@ namespace Step22 template StokesProblem::StokesProblem(const unsigned int degree, - FESystem & fe_) : - degree(degree), - triangulation(Triangulation::maximum_smoothing), - fe(fe_), - dof_handler(triangulation) + FESystem & fe_) + : degree(degree) + , triangulation(Triangulation::maximum_smoothing) + , fe(fe_) + , dof_handler(triangulation) {} template @@ -467,8 +470,9 @@ namespace Step22 constraints.close(); std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block( - dof_handler, dofs_per_block, block_component); + DoFTools::count_dofs_per_block(dof_handler, + dofs_per_block, + block_component); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; deallog << " Number of active cells: " << triangulation.n_active_cells() diff --git a/tests/fe/fe_q_hessian_divergence_theorem.cc b/tests/fe/fe_q_hessian_divergence_theorem.cc index b55e574635..68ed2b002a 100644 --- a/tests/fe/fe_q_hessian_divergence_theorem.cc +++ b/tests/fe/fe_q_hessian_divergence_theorem.cc @@ -121,8 +121,9 @@ test(const Triangulation &tr, { Tensor<1, dim> gradient = fe_face_values[single_component].gradient(i, q); - Tensor<2, dim> gradient_normal_outer_prod = outer_product( - gradient, fe_face_values.normal_vector(q)); + Tensor<2, dim> gradient_normal_outer_prod = + outer_product(gradient, + fe_face_values.normal_vector(q)); boundary_integral += gradient_normal_outer_prod * fe_face_values.JxW(q); } diff --git a/tests/fe/fe_rannacher_turek_02.cc b/tests/fe/fe_rannacher_turek_02.cc index 4af7dc6713..6a33ffbf46 100644 --- a/tests/fe/fe_rannacher_turek_02.cc +++ b/tests/fe/fe_rannacher_turek_02.cc @@ -44,8 +44,9 @@ test_values() dofh.initialize(tria, fe); QGauss<2> quadrature(8); - FEValues<2> fev( - fe, quadrature, update_values | update_gradients | update_JxW_values); + FEValues<2> fev(fe, + quadrature, + update_values | update_gradients | update_JxW_values); fev.reinit(dofh.begin_active()); for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) diff --git a/tests/fe/fe_restriction_sys_06.cc b/tests/fe/fe_restriction_sys_06.cc index 57cca8aae5..8e89cce533 100644 --- a/tests/fe/fe_restriction_sys_06.cc +++ b/tests/fe/fe_restriction_sys_06.cc @@ -24,12 +24,12 @@ main() { initlog(); - CHECK_SYS3( - FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(), 3)), - 1, - FESystem<2>(FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(), 3)), 3), - 1, - FESystem<2>(FE_Q<2>(2), 3, FE_DGQ<2>(0), 1), - 2, - 2); + CHECK_SYS3(FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(), 3)), + 1, + FESystem<2>(FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(), 3)), + 3), + 1, + FESystem<2>(FE_Q<2>(2), 3, FE_DGQ<2>(0), 1), + 2, + 2); } diff --git a/tests/fe/fe_restriction_sys_08.cc b/tests/fe/fe_restriction_sys_08.cc index d8150efd57..d53c2df335 100644 --- a/tests/fe/fe_restriction_sys_08.cc +++ b/tests/fe/fe_restriction_sys_08.cc @@ -24,12 +24,12 @@ main() { initlog(); - CHECK_SYS3( - FE_Nedelec<2>(0), - 1, - FESystem<2>(FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(), 3)), 3), - 1, - FESystem<2>(FE_Q<2>(2), 3, FE_Nedelec<2>(0), 2), - 2, - 2); + CHECK_SYS3(FE_Nedelec<2>(0), + 1, + FESystem<2>(FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(), 3)), + 3), + 1, + FESystem<2>(FE_Q<2>(2), 3, FE_Nedelec<2>(0), 2), + 2, + 2); } diff --git a/tests/fe/fe_restriction_sys_10.cc b/tests/fe/fe_restriction_sys_10.cc index 9ba9488ba2..1528088b43 100644 --- a/tests/fe/fe_restriction_sys_10.cc +++ b/tests/fe/fe_restriction_sys_10.cc @@ -23,12 +23,12 @@ main() { initlog(); - CHECK_SYS3( - FE_Nedelec<2>(1), - 1, - FESystem<2>(FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(), 3)), 3), - 1, - FESystem<2>(FE_Q<2>(2), 3, FE_Nedelec<2>(1), 2), - 2, - 2); + CHECK_SYS3(FE_Nedelec<2>(1), + 1, + FESystem<2>(FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(), 3)), + 3), + 1, + FESystem<2>(FE_Q<2>(2), 3, FE_Nedelec<2>(1), 2), + 2, + 2); } diff --git a/tests/fe/fe_rt_hessian_divergence_theorem.cc b/tests/fe/fe_rt_hessian_divergence_theorem.cc index 4e44e8552c..868108c432 100644 --- a/tests/fe/fe_rt_hessian_divergence_theorem.cc +++ b/tests/fe/fe_rt_hessian_divergence_theorem.cc @@ -115,8 +115,9 @@ test(const Triangulation &tr, { Tensor<1, dim> gradient = fe_face_values[single_component].gradient(i, q); - Tensor<2, dim> gradient_normal_outer_prod = outer_product( - gradient, fe_face_values.normal_vector(q)); + Tensor<2, dim> gradient_normal_outer_prod = + outer_product(gradient, + fe_face_values.normal_vector(q)); boundary_integral += gradient_normal_outer_prod * fe_face_values.JxW(q); } diff --git a/tests/fe/fe_series_01.cc b/tests/fe/fe_series_01.cc index db82b91ff6..2d29a4b53a 100644 --- a/tests/fe/fe_series_01.cc +++ b/tests/fe/fe_series_01.cc @@ -73,8 +73,9 @@ test_1d() Table> fourier_coefficients; fourier_coefficients.reinit(TableIndices<1>(N)); - fourier.calculate( - local_dof_values, cell_active_fe_index, fourier_coefficients); + fourier.calculate(local_dof_values, + cell_active_fe_index, + fourier_coefficients); deallog << "calculated:" << std::endl; for (unsigned int i = 0; i < N; i++) diff --git a/tests/fe/fe_series_02.cc b/tests/fe/fe_series_02.cc index 07062cae65..59c66cea37 100644 --- a/tests/fe/fe_series_02.cc +++ b/tests/fe/fe_series_02.cc @@ -47,9 +47,9 @@ template class LegendreFunction : public Function { public: - LegendreFunction(const std::vector coefficients) : - dealii::Function(1), - coefficients(coefficients) + LegendreFunction(const std::vector coefficients) + : dealii::Function(1) + , coefficients(coefficients) {} virtual double diff --git a/tests/fe/fe_series_04.cc b/tests/fe/fe_series_04.cc index 588b0b9315..cfc29d4008 100644 --- a/tests/fe/fe_series_04.cc +++ b/tests/fe/fe_series_04.cc @@ -61,7 +61,8 @@ template class LegendreFunction : public Function { public: - LegendreFunction() : Function(1) + LegendreFunction() + : Function(1) {} virtual double diff --git a/tests/fe/fe_series_05.cc b/tests/fe/fe_series_05.cc index 042644d2f5..8c825e8822 100644 --- a/tests/fe/fe_series_05.cc +++ b/tests/fe/fe_series_05.cc @@ -44,9 +44,9 @@ template class LegendreFunction : public Function { public: - LegendreFunction(const Table &coefficients) : - dealii::Function(1), - coefficients(coefficients) + LegendreFunction(const Table &coefficients) + : dealii::Function(1) + , coefficients(coefficients) {} virtual double diff --git a/tests/fe/fe_series_06.cc b/tests/fe/fe_series_06.cc index 39203a890f..958092bf3b 100644 --- a/tests/fe/fe_series_06.cc +++ b/tests/fe/fe_series_06.cc @@ -62,8 +62,9 @@ test_2d() local_dof_values[i] = dofs[i]; const unsigned int cell_active_fe_index = 0; - fourier.calculate( - local_dof_values, cell_active_fe_index, fourier_coefficients); + fourier.calculate(local_dof_values, + cell_active_fe_index, + fourier_coefficients); for (unsigned int i = 0; i < fourier_coefficients.size(0); i++) for (unsigned int j = 0; j < fourier_coefficients.size(1); j++) diff --git a/tests/fe/fe_system_components_base.cc b/tests/fe/fe_system_components_base.cc index e46b16519c..78d3c679bd 100644 --- a/tests/fe/fe_system_components_base.cc +++ b/tests/fe/fe_system_components_base.cc @@ -84,8 +84,9 @@ test(const bool renumber = false) { std::map> support_points; MappingQ1 mapping; - DoFTools::map_dofs_to_support_points( - mapping, dof_handler, support_points); + DoFTools::map_dofs_to_support_points(mapping, + dof_handler, + support_points); const std::string filename = "grid" + Utilities::int_to_string(dim) + Utilities::int_to_string(renumber) + ".gp"; diff --git a/tests/fe/fe_system_from_list.cc b/tests/fe/fe_system_from_list.cc index fdcaf276c8..13e319bfda 100644 --- a/tests/fe/fe_system_from_list.cc +++ b/tests/fe/fe_system_from_list.cc @@ -105,8 +105,8 @@ MySimulator::create_fe_multiplicities() template MySimulator::VectorElementDestroyer::VectorElementDestroyer( - const std::vector *> &pointers) : - data(pointers) + const std::vector *> &pointers) + : data(pointers) {} template @@ -128,9 +128,9 @@ MySimulator::VectorElementDestroyer::get_data() const template -MySimulator::MySimulator(const unsigned int polynomial_degree) : - fe(VectorElementDestroyer(create_fe_list(polynomial_degree)).get_data(), - create_fe_multiplicities()) +MySimulator::MySimulator(const unsigned int polynomial_degree) + : fe(VectorElementDestroyer(create_fe_list(polynomial_degree)).get_data(), + create_fe_multiplicities()) {} diff --git a/tests/fe/fe_tools.cc b/tests/fe/fe_tools.cc index 8d74cfbeca..99b7f5d4b4 100644 --- a/tests/fe/fe_tools.cc +++ b/tests/fe/fe_tools.cc @@ -78,8 +78,9 @@ test_embedding(const FiniteElement &fe) for (unsigned int i = 0; i < nc; ++i) { deallog << fe.get_name() << " embedding " << i << std::endl; - print_formatted( - P[RefinementCase::isotropic_refinement - 1][i], 8, 6); + print_formatted(P[RefinementCase::isotropic_refinement - 1][i], + 8, + 6); } } diff --git a/tests/fe/fe_values_function_manifold.cc b/tests/fe/fe_values_function_manifold.cc index 252c8812e0..4c16d1a6fa 100644 --- a/tests/fe/fe_values_function_manifold.cc +++ b/tests/fe/fe_values_function_manifold.cc @@ -112,7 +112,8 @@ template class PushForward : public Function { public: - PushForward() : Function(dim) + PushForward() + : Function(dim) {} double @@ -138,7 +139,8 @@ template class PullBack : public Function { public: - PullBack() : Function(dim) + PullBack() + : Function(dim) {} double @@ -183,7 +185,8 @@ class CubicRoofManifold : private CubicRoofFunctions, public FunctionManifold { public: - CubicRoofManifold() : FunctionManifold(this->forward, this->backward) + CubicRoofManifold() + : FunctionManifold(this->forward, this->backward) {} }; @@ -239,13 +242,13 @@ protected: template -JxWError::JxWError(const unsigned int n_global_refines) : - manufactured_solution(new HardManufacturedSolution()), - manufactured_forcing(new HardManufacturedForcing()), - finite_element(fe_order), - dof_handler(triangulation), - cell_quadrature(fe_order + 1), - cell_mapping(fe_order) +JxWError::JxWError(const unsigned int n_global_refines) + : manufactured_solution(new HardManufacturedSolution()) + , manufactured_forcing(new HardManufacturedForcing()) + , finite_element(fe_order) + , dof_handler(triangulation) + , cell_quadrature(fe_order + 1) + , cell_mapping(fe_order) { boundary_manifold = cubic_roof(triangulation); @@ -337,12 +340,12 @@ double JxWError::solve() { { - SolverControl solver_control( - std::max(types::global_dof_index(100), - static_cast(system_rhs.size())), - 1e-14 * system_rhs.l2_norm(), - false, - false); + SolverControl solver_control(std::max(types::global_dof_index(100), + static_cast( + system_rhs.size())), + 1e-14 * system_rhs.l2_norm(), + false, + false); SolverCG<> solver(solver_control); PreconditionSSOR<> preconditioner; preconditioner.initialize(system_matrix, 1.2); @@ -363,8 +366,10 @@ JxWError::solve() QIterated(QGauss<1>(finite_element.degree), 2), VectorTools::L2_norm); - const double l2_error = VectorTools::compute_global_error( - triangulation, cell_l2_error, VectorTools::L2_norm); + const double l2_error = + VectorTools::compute_global_error(triangulation, + cell_l2_error, + VectorTools::L2_norm); return l2_error; } diff --git a/tests/fe/fe_values_no_mapping.cc b/tests/fe/fe_values_no_mapping.cc index fb3f6cce82..01d5e7b453 100644 --- a/tests/fe/fe_values_no_mapping.cc +++ b/tests/fe/fe_values_no_mapping.cc @@ -34,7 +34,8 @@ template class F : public Function { public: - F(const unsigned int q) : q(q) + F(const unsigned int q) + : q(q) {} virtual double diff --git a/tests/fe/fe_values_view_01.cc b/tests/fe/fe_values_view_01.cc index 2136a222c7..5fe7fc6936 100644 --- a/tests/fe/fe_values_view_01.cc +++ b/tests/fe/fe_values_view_01.cc @@ -48,8 +48,9 @@ test(const Triangulation &tr, const FiniteElement &fe) deallog << "FE=" << fe.get_name() << std::endl; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); for (unsigned int c = 0; c < fe.n_components(); ++c) diff --git a/tests/fe/fe_values_view_02.cc b/tests/fe/fe_values_view_02.cc index b19ab6c70d..174f5436f8 100644 --- a/tests/fe/fe_values_view_02.cc +++ b/tests/fe/fe_values_view_02.cc @@ -49,8 +49,9 @@ test(const Triangulation &tr, const FiniteElement &fe) deallog << "FE=" << fe.get_name() << std::endl; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); for (unsigned int c = 0; c < fe.n_components(); ++c) @@ -72,9 +73,9 @@ test(const Triangulation &tr, const FiniteElement &fe) 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 + << 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) diff --git a/tests/fe/fe_values_view_03.cc b/tests/fe/fe_values_view_03.cc index b1fab482e1..04be84d071 100644 --- a/tests/fe/fe_values_view_03.cc +++ b/tests/fe/fe_values_view_03.cc @@ -50,8 +50,9 @@ test(const Triangulation &tr, const FiniteElement &fe) deallog << "FE=" << fe.get_name() << std::endl; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); for (typename DoFHandler::active_cell_iterator cell = dof.begin_active(); cell != dof.end(); ++cell) diff --git a/tests/fe/fe_values_view_04.cc b/tests/fe/fe_values_view_04.cc index 33db956281..cb20b91a01 100644 --- a/tests/fe/fe_values_view_04.cc +++ b/tests/fe/fe_values_view_04.cc @@ -50,8 +50,9 @@ test(const Triangulation &tr, const FiniteElement &fe) deallog << "FE=" << fe.get_name() << std::endl; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); for (typename DoFHandler::active_cell_iterator cell = dof.begin_active(); cell != dof.end(); ++cell) @@ -91,10 +92,11 @@ test(const Triangulation &tr, const FiniteElement &fe) for (unsigned int d = 0; d < dim; ++d) { - AssertThrow( - fe_values[vec_components].value(i, q)[d] == - fe_values.shape_value_component(i, q, c + d), - ExcInternalError()); + AssertThrow(fe_values[vec_components].value(i, q)[d] == + fe_values.shape_value_component(i, + q, + c + d), + ExcInternalError()); AssertThrow(fe_values[vec_components].gradient(i, q)[d] == fe_values.shape_grad_component(i, q, c + d), @@ -110,10 +112,11 @@ test(const Triangulation &tr, const FiniteElement &fe) 2), ExcInternalError()); - AssertThrow( - fe_values[vec_components].hessian(i, q)[d] == - fe_values.shape_hessian_component(i, q, c + d), - ExcInternalError()); + AssertThrow(fe_values[vec_components].hessian(i, q)[d] == + fe_values.shape_hessian_component(i, + q, + c + d), + ExcInternalError()); } } } diff --git a/tests/fe/fe_values_view_05.cc b/tests/fe/fe_values_view_05.cc index e60397e08b..8c07430b3a 100644 --- a/tests/fe/fe_values_view_05.cc +++ b/tests/fe/fe_values_view_05.cc @@ -52,8 +52,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector scalar_values(quadrature.size()); diff --git a/tests/fe/fe_values_view_06.cc b/tests/fe/fe_values_view_06.cc index e14ea0a408..d64e902b0b 100644 --- a/tests/fe/fe_values_view_06.cc +++ b/tests/fe/fe_values_view_06.cc @@ -52,8 +52,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector> scalar_values(quadrature.size()); diff --git a/tests/fe/fe_values_view_07.cc b/tests/fe/fe_values_view_07.cc index 76969f91e5..7a8644b5f0 100644 --- a/tests/fe/fe_values_view_07.cc +++ b/tests/fe/fe_values_view_07.cc @@ -52,8 +52,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector> scalar_values(quadrature.size()); diff --git a/tests/fe/fe_values_view_08.cc b/tests/fe/fe_values_view_08.cc index 716e8b0f2f..430470dc81 100644 --- a/tests/fe/fe_values_view_08.cc +++ b/tests/fe/fe_values_view_08.cc @@ -54,8 +54,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector scalar_values(quadrature.size()); diff --git a/tests/fe/fe_values_view_09.cc b/tests/fe/fe_values_view_09.cc index 76c4388767..eb5160772e 100644 --- a/tests/fe/fe_values_view_09.cc +++ b/tests/fe/fe_values_view_09.cc @@ -54,8 +54,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector> scalar_values(quadrature.size()); diff --git a/tests/fe/fe_values_view_10.cc b/tests/fe/fe_values_view_10.cc index 8426141cbb..2f7c5372af 100644 --- a/tests/fe/fe_values_view_10.cc +++ b/tests/fe/fe_values_view_10.cc @@ -54,8 +54,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector> scalar_values(quadrature.size()); diff --git a/tests/fe/fe_values_view_10_single_01.cc b/tests/fe/fe_values_view_10_single_01.cc index 9d9304d778..ae08ee47a1 100644 --- a/tests/fe/fe_values_view_10_single_01.cc +++ b/tests/fe/fe_values_view_10_single_01.cc @@ -57,8 +57,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector> scalar_values(quadrature.size()); diff --git a/tests/fe/fe_values_view_10_single_02.cc b/tests/fe/fe_values_view_10_single_02.cc index 15b87f294c..1817cff5da 100644 --- a/tests/fe/fe_values_view_10_single_02.cc +++ b/tests/fe/fe_values_view_10_single_02.cc @@ -57,8 +57,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector> scalar_values(quadrature.size()); diff --git a/tests/fe/fe_values_view_10_single_03.cc b/tests/fe/fe_values_view_10_single_03.cc index 3a5879706d..73d83d6815 100644 --- a/tests/fe/fe_values_view_10_single_03.cc +++ b/tests/fe/fe_values_view_10_single_03.cc @@ -57,8 +57,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector> scalar_values(quadrature.size()); diff --git a/tests/fe/fe_values_view_11.cc b/tests/fe/fe_values_view_11.cc index eb3ff62838..bff4488029 100644 --- a/tests/fe/fe_values_view_11.cc +++ b/tests/fe/fe_values_view_11.cc @@ -52,8 +52,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector> selected_vector_values(quadrature.size()); diff --git a/tests/fe/fe_values_view_12.cc b/tests/fe/fe_values_view_12.cc index c52a99a5ec..7f9caf36c8 100644 --- a/tests/fe/fe_values_view_12.cc +++ b/tests/fe/fe_values_view_12.cc @@ -52,8 +52,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector> selected_vector_values(quadrature.size()); diff --git a/tests/fe/fe_values_view_13.cc b/tests/fe/fe_values_view_13.cc index c4857bf317..6addbc0006 100644 --- a/tests/fe/fe_values_view_13.cc +++ b/tests/fe/fe_values_view_13.cc @@ -52,8 +52,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector> selected_vector_values(quadrature.size()); diff --git a/tests/fe/fe_values_view_14.cc b/tests/fe/fe_values_view_14.cc index 6769566eb5..cd388a8989 100644 --- a/tests/fe/fe_values_view_14.cc +++ b/tests/fe/fe_values_view_14.cc @@ -54,8 +54,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector> selected_vector_values(quadrature.size()); diff --git a/tests/fe/fe_values_view_15.cc b/tests/fe/fe_values_view_15.cc index 617326a059..d73f3c069d 100644 --- a/tests/fe/fe_values_view_15.cc +++ b/tests/fe/fe_values_view_15.cc @@ -54,8 +54,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector> selected_vector_values(quadrature.size()); diff --git a/tests/fe/fe_values_view_16.cc b/tests/fe/fe_values_view_16.cc index 88f8340937..3e1acfa267 100644 --- a/tests/fe/fe_values_view_16.cc +++ b/tests/fe/fe_values_view_16.cc @@ -54,8 +54,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector> selected_vector_values(quadrature.size()); diff --git a/tests/fe/fe_values_view_17.cc b/tests/fe/fe_values_view_17.cc index 1e0ecf2aa4..d3381eb46f 100644 --- a/tests/fe/fe_values_view_17.cc +++ b/tests/fe/fe_values_view_17.cc @@ -53,8 +53,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector> selected_vector_values( diff --git a/tests/fe/fe_values_view_18.cc b/tests/fe/fe_values_view_18.cc index 44d03f2261..f43651332c 100644 --- a/tests/fe/fe_values_view_18.cc +++ b/tests/fe/fe_values_view_18.cc @@ -55,8 +55,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector> selected_vector_values( diff --git a/tests/fe/fe_values_view_19.cc b/tests/fe/fe_values_view_19.cc index bd15411544..d7c83cacc9 100644 --- a/tests/fe/fe_values_view_19.cc +++ b/tests/fe/fe_values_view_19.cc @@ -52,8 +52,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector selected_vector_values(quadrature.size()); diff --git a/tests/fe/fe_values_view_20.cc b/tests/fe/fe_values_view_20.cc index f4de9ffeea..4e47d5e470 100644 --- a/tests/fe/fe_values_view_20.cc +++ b/tests/fe/fe_values_view_20.cc @@ -54,8 +54,9 @@ test(const Triangulation &tr, const FiniteElement &fe) fe_function(i) = i + 1; const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_hessians); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_hessians); fe_values.reinit(dof.begin_active()); std::vector selected_vector_values(quadrature.size()); diff --git a/tests/fe/fe_values_view_21.cc b/tests/fe/fe_values_view_21.cc index 53c566d92b..dbceb56228 100644 --- a/tests/fe/fe_values_view_21.cc +++ b/tests/fe/fe_values_view_21.cc @@ -82,15 +82,15 @@ private: }; template -MixedElastoPlasticity::MixedElastoPlasticity(const unsigned int degree) : - degree(degree), - n_stress_components((dim * (dim + 1)) / 2), - n_gamma_components(1), - fe(FE_Q(degree), - n_stress_components, - FE_Q(degree), - n_gamma_components), - dof_handler(triangulation) +MixedElastoPlasticity::MixedElastoPlasticity(const unsigned int degree) + : degree(degree) + , n_stress_components((dim * (dim + 1)) / 2) + , n_gamma_components(1) + , fe(FE_Q(degree), + n_stress_components, + FE_Q(degree), + n_gamma_components) + , dof_handler(triangulation) {} template @@ -107,8 +107,9 @@ MixedElastoPlasticity::make_grid_and_dofs() << std::endl; // stress -> 0 gamma -> 1 - std::vector block_component( - n_stress_components + n_gamma_components, 1); + std::vector block_component(n_stress_components + + n_gamma_components, + 1); for (unsigned int ii = 0; ii < n_stress_components; ii++) block_component[ii] = 0; diff --git a/tests/fe/fe_values_view_21_nonsymmetric.cc b/tests/fe/fe_values_view_21_nonsymmetric.cc index 3a86b9fded..66021e8a17 100644 --- a/tests/fe/fe_values_view_21_nonsymmetric.cc +++ b/tests/fe/fe_values_view_21_nonsymmetric.cc @@ -83,15 +83,15 @@ private: }; template -MixedElastoPlasticity::MixedElastoPlasticity(const unsigned int degree) : - degree(degree), - n_stress_components(dim * dim), - n_gamma_components(1), - fe(FE_Q(degree), - n_stress_components, - FE_Q(degree), - n_gamma_components), - dof_handler(triangulation) +MixedElastoPlasticity::MixedElastoPlasticity(const unsigned int degree) + : degree(degree) + , n_stress_components(dim * dim) + , n_gamma_components(1) + , fe(FE_Q(degree), + n_stress_components, + FE_Q(degree), + n_gamma_components) + , dof_handler(triangulation) {} template @@ -108,8 +108,9 @@ MixedElastoPlasticity::make_grid_and_dofs() << std::endl; // stress -> 0 gamma -> 1 - std::vector block_component( - n_stress_components + n_gamma_components, 1); + std::vector block_component(n_stress_components + + n_gamma_components, + 1); for (unsigned int ii = 0; ii < n_stress_components; ii++) block_component[ii] = 0; diff --git a/tests/fe/fe_values_view_22.cc b/tests/fe/fe_values_view_22.cc index 54c38e8a24..9461c81244 100644 --- a/tests/fe/fe_values_view_22.cc +++ b/tests/fe/fe_values_view_22.cc @@ -75,15 +75,15 @@ private: template -MixedElastoPlasticity::MixedElastoPlasticity(const unsigned int degree) : - degree(degree), - n_stress_components((dim * (dim + 1)) / 2), - n_gamma_components(1), - fe(FE_Q(degree), - n_stress_components, - FE_Q(degree), - n_gamma_components), - dof_handler(triangulation) +MixedElastoPlasticity::MixedElastoPlasticity(const unsigned int degree) + : degree(degree) + , n_stress_components((dim * (dim + 1)) / 2) + , n_gamma_components(1) + , fe(FE_Q(degree), + n_stress_components, + FE_Q(degree), + n_gamma_components) + , dof_handler(triangulation) {} @@ -102,8 +102,9 @@ MixedElastoPlasticity::make_grid_and_dofs() << std::endl; // stress -> 0 gamma -> 1 - std::vector block_component( - n_stress_components + n_gamma_components, 1); + std::vector block_component(n_stress_components + + n_gamma_components, + 1); for (unsigned int ii = 0; ii < n_stress_components; ii++) block_component[ii] = 0; diff --git a/tests/fe/fe_values_view_25b_nonsymmetric.cc b/tests/fe/fe_values_view_25b_nonsymmetric.cc index 245d936392..8e7f1e9bd4 100644 --- a/tests/fe/fe_values_view_25b_nonsymmetric.cc +++ b/tests/fe/fe_values_view_25b_nonsymmetric.cc @@ -74,8 +74,9 @@ test(const Triangulation &tr, const FiniteElement &fe) { DoFHandler dof_scalar(tr); dof_scalar.distribute_dofs(fe_scalar); - FEValues fe_values_scalar( - fe_scalar, quadrature, update_values | update_gradients); + FEValues fe_values_scalar(fe_scalar, + quadrature, + update_values | update_gradients); fe_values_scalar.reinit(dof_scalar.begin_active()); for (unsigned int i = 0; i < fe_scalar.dofs_per_cell; ++i) @@ -166,9 +167,9 @@ test(const Triangulation &tr, const FiniteElement &fe) { AssertThrow(val_q[ind_k] == scalar_values[i_node][q], ExcInternalError()); - AssertThrow( - (grad_q[ind_k[0]][ind_k[1]] == scalar_gradients[i_node][q]), - ExcInternalError()); + AssertThrow((grad_q[ind_k[0]][ind_k[1]] == + scalar_gradients[i_node][q]), + ExcInternalError()); } else { diff --git a/tests/fe/fe_values_view_28.cc b/tests/fe/fe_values_view_28.cc index 2dcf08d910..dc108f9c5d 100644 --- a/tests/fe/fe_values_view_28.cc +++ b/tests/fe/fe_values_view_28.cc @@ -41,7 +41,8 @@ class F : public Function<2> { public: - F() : Function<2>(2) + F() + : Function<2>(2) {} virtual void @@ -116,9 +117,9 @@ test(const Triangulation &tr, const FiniteElement &fe) // curl of this function should be // curl F = d_x F_y - d_y F_x = 2x // verify that this is true - AssertThrow( - std::fabs(curls[q][0] - 2 * fe_values.quadrature_point(q)[0]) <= 1e-10, - ExcInternalError()); + AssertThrow(std::fabs(curls[q][0] - + 2 * fe_values.quadrature_point(q)[0]) <= 1e-10, + ExcInternalError()); } } diff --git a/tests/fe/fe_values_view_29.cc b/tests/fe/fe_values_view_29.cc index 9193d072f3..0e67282b34 100644 --- a/tests/fe/fe_values_view_29.cc +++ b/tests/fe/fe_values_view_29.cc @@ -41,7 +41,8 @@ class F : public Function<2> { public: - F() : Function<2>(2) + F() + : Function<2>(2) {} virtual void @@ -118,9 +119,9 @@ test(const Triangulation &tr, // curl of this function should be // curl F = d_x F_y - d_y F_x = 2x // verify that this is true - AssertThrow( - std::fabs(curls[q][0] - 2 * fe_values.quadrature_point(q)[0]) <= 1e-10, - ExcInternalError()); + AssertThrow(std::fabs(curls[q][0] - + 2 * fe_values.quadrature_point(q)[0]) <= 1e-10, + ExcInternalError()); } } diff --git a/tests/fe/fe_values_view_30.cc b/tests/fe/fe_values_view_30.cc index ce0b0b8594..c87dbdd061 100644 --- a/tests/fe/fe_values_view_30.cc +++ b/tests/fe/fe_values_view_30.cc @@ -46,7 +46,8 @@ template class VectorFunction : public Function { public: - VectorFunction() : Function(dim) + VectorFunction() + : Function(dim) {} virtual double value(const Point &p, const unsigned int component) const; diff --git a/tests/fe/fe_values_view_get_function_from_local_dof_values_01.cc b/tests/fe/fe_values_view_get_function_from_local_dof_values_01.cc index 30f3728f2d..e05ebb357a 100644 --- a/tests/fe/fe_values_view_get_function_from_local_dof_values_01.cc +++ b/tests/fe/fe_values_view_get_function_from_local_dof_values_01.cc @@ -399,8 +399,9 @@ test_extractor(const FEType &fe, const ExtractorType &extractor) cell->get_dof_indices(local_dof_indices); std::vector local_dof_values(fe.dofs_per_cell); - cell->get_dof_values( - solution, local_dof_values.begin(), local_dof_values.end()); + cell->get_dof_values(solution, + local_dof_values.begin(), + local_dof_values.end()); // Convert the DoF values so that they are potentially of // a different number type diff --git a/tests/fe/fe_values_view_get_function_from_local_dof_values_02.cc b/tests/fe/fe_values_view_get_function_from_local_dof_values_02.cc index 7de24f479f..708ac63ffa 100644 --- a/tests/fe/fe_values_view_get_function_from_local_dof_values_02.cc +++ b/tests/fe/fe_values_view_get_function_from_local_dof_values_02.cc @@ -257,8 +257,9 @@ test_extractor(const FEType &fe, const ExtractorType &extractor) cell->get_dof_indices(local_dof_indices); std::vector local_dof_values(fe.dofs_per_cell); - cell->get_dof_values( - solution, local_dof_values.begin(), local_dof_values.end()); + cell->get_dof_values(solution, + local_dof_values.begin(), + local_dof_values.end()); // Convert the DoF values so that they are potentially of // a different number type diff --git a/tests/fe/fe_values_view_tensor_01.cc b/tests/fe/fe_values_view_tensor_01.cc index d5af9c9090..1d49a58f2f 100644 --- a/tests/fe/fe_values_view_tensor_01.cc +++ b/tests/fe/fe_values_view_tensor_01.cc @@ -80,15 +80,15 @@ private: }; template -MixedElastoPlasticity::MixedElastoPlasticity(const unsigned int degree) : - degree(degree), - n_stress_components(dim * dim), - n_gamma_components(1), - fe(FE_Q(degree), - n_stress_components, - FE_Q(degree), - n_gamma_components), - dof_handler(triangulation) +MixedElastoPlasticity::MixedElastoPlasticity(const unsigned int degree) + : degree(degree) + , n_stress_components(dim * dim) + , n_gamma_components(1) + , fe(FE_Q(degree), + n_stress_components, + FE_Q(degree), + n_gamma_components) + , dof_handler(triangulation) {} template @@ -105,8 +105,9 @@ MixedElastoPlasticity::make_grid_and_dofs() << std::endl; // stress -> 0 gamma -> 1 - std::vector block_component( - n_stress_components + n_gamma_components, 1); + std::vector block_component(n_stress_components + + n_gamma_components, + 1); for (unsigned int ii = 0; ii < n_stress_components; ii++) block_component[ii] = 0; diff --git a/tests/fe/injection_q_system.cc b/tests/fe/injection_q_system.cc index e50243374b..d29f8cd063 100644 --- a/tests/fe/injection_q_system.cc +++ b/tests/fe/injection_q_system.cc @@ -30,9 +30,12 @@ test() for (unsigned int i = 1; i < 4; ++i) for (unsigned int j = i; j < 4; ++j) - do_check( - FESystem( - FE_Q(QIterated<1>(QTrapez<1>(), i)), 1, FE_DGQ(i - 1), 1), - FESystem( - FE_Q(QIterated<1>(QTrapez<1>(), j)), 1, FE_DGQ(j - 1), 1)); + do_check(FESystem(FE_Q(QIterated<1>(QTrapez<1>(), i)), + 1, + FE_DGQ(i - 1), + 1), + FESystem(FE_Q(QIterated<1>(QTrapez<1>(), j)), + 1, + FE_DGQ(j - 1), + 1)); } diff --git a/tests/fe/interpolate_common.h b/tests/fe/interpolate_common.h index 3c973e46f3..3a6d309eac 100644 --- a/tests/fe/interpolate_common.h +++ b/tests/fe/interpolate_common.h @@ -90,7 +90,8 @@ template class Q1WedgeFunction : public Function { public: - Q1WedgeFunction() : Function(COMP) + Q1WedgeFunction() + : Function(COMP) {} double diff --git a/tests/fe/interpolate_q_system_mixed_01.cc b/tests/fe/interpolate_q_system_mixed_01.cc index 68e9f1ede1..0aa00e2757 100644 --- a/tests/fe/interpolate_q_system_mixed_01.cc +++ b/tests/fe/interpolate_q_system_mixed_01.cc @@ -51,7 +51,10 @@ template class F : public Function { public: - F(const unsigned int q, const double adj) : Function(4), q(q), adj(adj) + F(const unsigned int q, const double adj) + : Function(4) + , q(q) + , adj(adj) {} virtual void @@ -110,12 +113,16 @@ test() for (unsigned int q = 0; q <= p + 2; ++q) { // interpolate the function with mask 1 - VectorTools::interpolate( - dof_handler, F(q, adj1), interpolant, mask1); + VectorTools::interpolate(dof_handler, + F(q, adj1), + interpolant, + mask1); // interpolate the function with mask 2 - VectorTools::interpolate( - dof_handler, F(q, adj2), interpolant, mask2); + VectorTools::interpolate(dof_handler, + F(q, adj2), + interpolant, + mask2); // then compute the interpolation error for mask 1 VectorTools::integrate_difference(dof_handler, @@ -154,8 +161,10 @@ test() deallog << fe.get_name() << ", Fails for including non-interpolating FE "; try { - VectorTools::interpolate( - dof_handler, F(0, 0.0), interpolant, mask_fail); + VectorTools::interpolate(dof_handler, + F(0, 0.0), + interpolant, + mask_fail); } catch (const ExceptionBase &e) { diff --git a/tests/fe/jacobians.cc b/tests/fe/jacobians.cc index ebbfcbebfb..2565555470 100644 --- a/tests/fe/jacobians.cc +++ b/tests/fe/jacobians.cc @@ -104,8 +104,10 @@ do_test(const Triangulation &tria, const Mapping &mapping) } { deallog << dim << "D Jacobian pushed forward gradients:" << std::endl; - FEValues fe_val( - mapping, dummy, quad, update_jacobian_pushed_forward_grads); + FEValues fe_val(mapping, + dummy, + quad, + update_jacobian_pushed_forward_grads); typename Triangulation::active_cell_iterator cell = tria.begin_active(), endc = tria.end(); @@ -142,8 +144,10 @@ do_test(const Triangulation &tria, const Mapping &mapping) } { deallog << dim << "D Jacobian pushed forward hessians:" << std::endl; - FEValues fe_val( - mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives); + FEValues fe_val(mapping, + dummy, + quad, + update_jacobian_pushed_forward_2nd_derivatives); typename Triangulation::active_cell_iterator cell = tria.begin_active(), endc = tria.end(); @@ -186,8 +190,10 @@ do_test(const Triangulation &tria, const Mapping &mapping) { deallog << dim << "D Jacobian pushed forward hessian gradients:" << std::endl; - FEValues fe_val( - mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives); + FEValues fe_val(mapping, + dummy, + quad, + update_jacobian_pushed_forward_3rd_derivatives); typename Triangulation::active_cell_iterator cell = tria.begin_active(), endc = tria.end(); diff --git a/tests/fe/jacobians_face.cc b/tests/fe/jacobians_face.cc index ca9660ba6d..4ade93bc98 100644 --- a/tests/fe/jacobians_face.cc +++ b/tests/fe/jacobians_face.cc @@ -87,8 +87,10 @@ test() { FEFaceValues fe_val(mapping, dummy, quad, update_inverse_jacobians); - FESubfaceValues fe_sub_val( - mapping, dummy, quad, update_inverse_jacobians); + FESubfaceValues fe_sub_val(mapping, + dummy, + quad, + update_inverse_jacobians); deallog << dim << "D inverse Jacobians:" << std::endl; typename Triangulation::active_cell_iterator cell = @@ -123,8 +125,10 @@ test() { FEFaceValues fe_val(mapping, dummy, quad, update_jacobian_grads); - FESubfaceValues fe_sub_val( - mapping, dummy, quad, update_jacobian_grads); + FESubfaceValues fe_sub_val(mapping, + dummy, + quad, + update_jacobian_grads); deallog << dim << "D Jacobian gradients:" << std::endl; typename Triangulation::active_cell_iterator cell = @@ -160,10 +164,14 @@ test() } { - FEFaceValues fe_val( - mapping, dummy, quad, update_jacobian_pushed_forward_grads); - FESubfaceValues fe_sub_val( - mapping, dummy, quad, update_jacobian_pushed_forward_grads); + FEFaceValues fe_val(mapping, + dummy, + quad, + update_jacobian_pushed_forward_grads); + FESubfaceValues fe_sub_val(mapping, + dummy, + quad, + update_jacobian_pushed_forward_grads); deallog << dim << "D Jacobian pushed forward gradients:" << std::endl; typename Triangulation::active_cell_iterator cell = @@ -202,10 +210,14 @@ test() } { - FEFaceValues fe_val( - mapping, dummy, quad, update_jacobian_2nd_derivatives); - FESubfaceValues fe_sub_val( - mapping, dummy, quad, update_jacobian_2nd_derivatives); + FEFaceValues fe_val(mapping, + dummy, + quad, + update_jacobian_2nd_derivatives); + FESubfaceValues fe_sub_val(mapping, + dummy, + quad, + update_jacobian_2nd_derivatives); deallog << dim << "D Jacobian hessians:" << std::endl; typename Triangulation::active_cell_iterator cell = @@ -246,8 +258,10 @@ test() } { - FEFaceValues fe_val( - mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives); + FEFaceValues fe_val(mapping, + dummy, + quad, + update_jacobian_pushed_forward_2nd_derivatives); FESubfaceValues fe_sub_val( mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives); @@ -292,10 +306,14 @@ test() } { - FEFaceValues fe_val( - mapping, dummy, quad, update_jacobian_3rd_derivatives); - FESubfaceValues fe_sub_val( - mapping, dummy, quad, update_jacobian_3rd_derivatives); + FEFaceValues fe_val(mapping, + dummy, + quad, + update_jacobian_3rd_derivatives); + FESubfaceValues fe_sub_val(mapping, + dummy, + quad, + update_jacobian_3rd_derivatives); deallog << dim << "D Jacobian hessian gradients:" << std::endl; typename Triangulation::active_cell_iterator cell = @@ -338,8 +356,10 @@ test() } { - FEFaceValues fe_val( - mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives); + FEFaceValues fe_val(mapping, + dummy, + quad, + update_jacobian_pushed_forward_3rd_derivatives); FESubfaceValues fe_sub_val( mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives); diff --git a/tests/fe/jacobians_face_cartesian.cc b/tests/fe/jacobians_face_cartesian.cc index 30fc248c02..0a6855753d 100644 --- a/tests/fe/jacobians_face_cartesian.cc +++ b/tests/fe/jacobians_face_cartesian.cc @@ -85,8 +85,10 @@ test() { FEFaceValues fe_val(mapping, dummy, quad, update_inverse_jacobians); - FESubfaceValues fe_sub_val( - mapping, dummy, quad, update_inverse_jacobians); + FESubfaceValues fe_sub_val(mapping, + dummy, + quad, + update_inverse_jacobians); deallog << dim << "D inverse Jacobians:" << std::endl; typename Triangulation::active_cell_iterator cell = @@ -121,8 +123,10 @@ test() { FEFaceValues fe_val(mapping, dummy, quad, update_jacobian_grads); - FESubfaceValues fe_sub_val( - mapping, dummy, quad, update_jacobian_grads); + FESubfaceValues fe_sub_val(mapping, + dummy, + quad, + update_jacobian_grads); deallog << dim << "D Jacobian gradients:" << std::endl; typename Triangulation::active_cell_iterator cell = @@ -158,10 +162,14 @@ test() } { - FEFaceValues fe_val( - mapping, dummy, quad, update_jacobian_pushed_forward_grads); - FESubfaceValues fe_sub_val( - mapping, dummy, quad, update_jacobian_pushed_forward_grads); + FEFaceValues fe_val(mapping, + dummy, + quad, + update_jacobian_pushed_forward_grads); + FESubfaceValues fe_sub_val(mapping, + dummy, + quad, + update_jacobian_pushed_forward_grads); deallog << dim << "D Jacobian pushed forward gradients:" << std::endl; typename Triangulation::active_cell_iterator cell = @@ -200,10 +208,14 @@ test() } { - FEFaceValues fe_val( - mapping, dummy, quad, update_jacobian_2nd_derivatives); - FESubfaceValues fe_sub_val( - mapping, dummy, quad, update_jacobian_2nd_derivatives); + FEFaceValues fe_val(mapping, + dummy, + quad, + update_jacobian_2nd_derivatives); + FESubfaceValues fe_sub_val(mapping, + dummy, + quad, + update_jacobian_2nd_derivatives); deallog << dim << "D Jacobian hessians:" << std::endl; typename Triangulation::active_cell_iterator cell = @@ -244,8 +256,10 @@ test() } { - FEFaceValues fe_val( - mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives); + FEFaceValues fe_val(mapping, + dummy, + quad, + update_jacobian_pushed_forward_2nd_derivatives); FESubfaceValues fe_sub_val( mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives); @@ -290,10 +304,14 @@ test() } { - FEFaceValues fe_val( - mapping, dummy, quad, update_jacobian_3rd_derivatives); - FESubfaceValues fe_sub_val( - mapping, dummy, quad, update_jacobian_3rd_derivatives); + FEFaceValues fe_val(mapping, + dummy, + quad, + update_jacobian_3rd_derivatives); + FESubfaceValues fe_sub_val(mapping, + dummy, + quad, + update_jacobian_3rd_derivatives); deallog << dim << "D Jacobian hessian gradients:" << std::endl; typename Triangulation::active_cell_iterator cell = @@ -336,8 +354,10 @@ test() } { - FEFaceValues fe_val( - mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives); + FEFaceValues fe_val(mapping, + dummy, + quad, + update_jacobian_pushed_forward_3rd_derivatives); FESubfaceValues fe_sub_val( mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives); diff --git a/tests/fe/jacobians_face_fe_field.cc b/tests/fe/jacobians_face_fe_field.cc index de69e77045..8e7c4caa00 100644 --- a/tests/fe/jacobians_face_fe_field.cc +++ b/tests/fe/jacobians_face_fe_field.cc @@ -103,8 +103,10 @@ test() { FEFaceValues fe_val(mapping, dummy, quad, update_inverse_jacobians); - FESubfaceValues fe_sub_val( - mapping, dummy, quad, update_inverse_jacobians); + FESubfaceValues fe_sub_val(mapping, + dummy, + quad, + update_inverse_jacobians); deallog << dim << "D inverse Jacobians:" << std::endl; typename Triangulation::active_cell_iterator cell = @@ -139,8 +141,10 @@ test() { FEFaceValues fe_val(mapping, dummy, quad, update_jacobian_grads); - FESubfaceValues fe_sub_val( - mapping, dummy, quad, update_jacobian_grads); + FESubfaceValues fe_sub_val(mapping, + dummy, + quad, + update_jacobian_grads); deallog << dim << "D Jacobian gradients:" << std::endl; typename Triangulation::active_cell_iterator cell = @@ -176,10 +180,14 @@ test() } { - FEFaceValues fe_val( - mapping, dummy, quad, update_jacobian_pushed_forward_grads); - FESubfaceValues fe_sub_val( - mapping, dummy, quad, update_jacobian_pushed_forward_grads); + FEFaceValues fe_val(mapping, + dummy, + quad, + update_jacobian_pushed_forward_grads); + FESubfaceValues fe_sub_val(mapping, + dummy, + quad, + update_jacobian_pushed_forward_grads); deallog << dim << "D Jacobian pushed forward gradients:" << std::endl; typename Triangulation::active_cell_iterator cell = @@ -218,10 +226,14 @@ test() } { - FEFaceValues fe_val( - mapping, dummy, quad, update_jacobian_2nd_derivatives); - FESubfaceValues fe_sub_val( - mapping, dummy, quad, update_jacobian_2nd_derivatives); + FEFaceValues fe_val(mapping, + dummy, + quad, + update_jacobian_2nd_derivatives); + FESubfaceValues fe_sub_val(mapping, + dummy, + quad, + update_jacobian_2nd_derivatives); deallog << dim << "D Jacobian hessians:" << std::endl; typename Triangulation::active_cell_iterator cell = @@ -262,8 +274,10 @@ test() } { - FEFaceValues fe_val( - mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives); + FEFaceValues fe_val(mapping, + dummy, + quad, + update_jacobian_pushed_forward_2nd_derivatives); FESubfaceValues fe_sub_val( mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives); @@ -308,10 +322,14 @@ test() } { - FEFaceValues fe_val( - mapping, dummy, quad, update_jacobian_3rd_derivatives); - FESubfaceValues fe_sub_val( - mapping, dummy, quad, update_jacobian_3rd_derivatives); + FEFaceValues fe_val(mapping, + dummy, + quad, + update_jacobian_3rd_derivatives); + FESubfaceValues fe_sub_val(mapping, + dummy, + quad, + update_jacobian_3rd_derivatives); deallog << dim << "D Jacobian hessian gradients:" << std::endl; typename Triangulation::active_cell_iterator cell = @@ -354,8 +372,10 @@ test() } { - FEFaceValues fe_val( - mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives); + FEFaceValues fe_val(mapping, + dummy, + quad, + update_jacobian_pushed_forward_3rd_derivatives); FESubfaceValues fe_sub_val( mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives); diff --git a/tests/fe/nedelec_2.cc b/tests/fe/nedelec_2.cc index 1c6f43d651..a2ed0a2a14 100644 --- a/tests/fe/nedelec_2.cc +++ b/tests/fe/nedelec_2.cc @@ -162,14 +162,16 @@ plot(const Triangulation &tr, const unsigned int p) std::pair neighbor_face = c->neighbor_of_coarser_neighbor(face); - fesubface.reinit( - c->neighbor(face), neighbor_face.first, neighbor_face.second); + 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)); + plot_diff(shape_values1[k], + shape_values2[k], + feface.normal_vector(k)); } } else @@ -179,8 +181,9 @@ plot(const Triangulation &tr, const unsigned int p) 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)); + plot_diff(shape_values1[k], + shape_values2[k], + feface.normal_vector(k)); } } } diff --git a/tests/fe/nedelec_3.cc b/tests/fe/nedelec_3.cc index b4ffa4081f..4caadaa734 100644 --- a/tests/fe/nedelec_3.cc +++ b/tests/fe/nedelec_3.cc @@ -83,8 +83,9 @@ check(const unsigned int p) QTrapez quadrature; std::vector> shape_values(quadrature.size(), Vector(dim)); - FEValues fe( - fe_ned, quadrature, update_values | update_quadrature_points); + FEValues fe(fe_ned, + quadrature, + update_values | update_quadrature_points); for (typename DoFHandler::active_cell_iterator c = dof.begin_active(); c != dof.end(); diff --git a/tests/fe/nedelec_crash_01.cc b/tests/fe/nedelec_crash_01.cc index 77ccbf61d3..c467103e06 100644 --- a/tests/fe/nedelec_crash_01.cc +++ b/tests/fe/nedelec_crash_01.cc @@ -38,7 +38,8 @@ main() // use the old-style constraints struct MyFE : FE_Nedelec<3> { - MyFE() : FE_Nedelec<3>(0){}; + MyFE() + : FE_Nedelec<3>(0){}; virtual bool hp_constraints_are_implemented() const { diff --git a/tests/fe/nedelec_crash_hp.cc b/tests/fe/nedelec_crash_hp.cc index f2814f4abb..ed529438f9 100644 --- a/tests/fe/nedelec_crash_hp.cc +++ b/tests/fe/nedelec_crash_hp.cc @@ -64,11 +64,11 @@ test() Triangulation triangulation; std::vector subdivisions(dim, 1); subdivisions[0] = 2; - GridGenerator::subdivided_hyper_rectangle( - triangulation, - subdivisions, - Point(), - (dim == 3 ? Point(2, 1, 1) : Point(2, 1))); + GridGenerator::subdivided_hyper_rectangle(triangulation, + subdivisions, + Point(), + (dim == 3 ? Point(2, 1, 1) : + Point(2, 1))); (++triangulation.begin_active())->set_refine_flag(); triangulation.execute_coarsening_and_refinement(); diff --git a/tests/fe/nedelec_face_interpolation.cc b/tests/fe/nedelec_face_interpolation.cc index 4a61e49972..7d52747b73 100644 --- a/tests/fe/nedelec_face_interpolation.cc +++ b/tests/fe/nedelec_face_interpolation.cc @@ -48,11 +48,11 @@ test(unsigned p1, unsigned p2) Triangulation triangulation; std::vector subdivisions(dim, 1); subdivisions[0] = 2; - GridGenerator::subdivided_hyper_rectangle( - triangulation, - subdivisions, - Point(), - (dim == 3 ? Point(2, 1, 1) : Point(2, 1))); + GridGenerator::subdivided_hyper_rectangle(triangulation, + subdivisions, + Point(), + (dim == 3 ? Point(2, 1, 1) : + Point(2, 1))); (++triangulation.begin_active())->set_refine_flag(); triangulation.execute_coarsening_and_refinement(); diff --git a/tests/fe/nedelec_non_rect_2d.cc b/tests/fe/nedelec_non_rect_2d.cc index b170d978d5..e26c5adc23 100644 --- a/tests/fe/nedelec_non_rect_2d.cc +++ b/tests/fe/nedelec_non_rect_2d.cc @@ -77,7 +77,8 @@ namespace polytest class SimplePolynomial : public Function { public: - SimplePolynomial() : Function(2) + SimplePolynomial() + : Function(2) {} void vector_value_list(const std::vector> &points, @@ -159,11 +160,11 @@ namespace polytest }; template - polytest::polytest(unsigned int degree) : - p_order(degree), - quad_order(2 * degree + 3), - dof_handler(tria), - fe(degree) + polytest::polytest(unsigned int degree) + : p_order(degree) + , quad_order(2 * degree + 3) + , dof_handler(tria) + , fe(degree) {} template polytest::~polytest() @@ -187,8 +188,10 @@ namespace polytest dof_handler, 0, boundary_function, 0, constraints); constraints.close(); DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern( - dof_handler, c_sparsity, constraints, false); + DoFTools::make_sparsity_pattern(dof_handler, + c_sparsity, + constraints, + false); sparsity_pattern.copy_from(c_sparsity); system_matrix.reinit(sparsity_pattern); diff --git a/tests/fe/nedelec_non_rect_face.cc b/tests/fe/nedelec_non_rect_face.cc index 4e6291634e..32abebb7c1 100644 --- a/tests/fe/nedelec_non_rect_face.cc +++ b/tests/fe/nedelec_non_rect_face.cc @@ -98,7 +98,8 @@ namespace Maxwell }; template - ExactSolution::ExactSolution() : Function(dim) + ExactSolution::ExactSolution() + : Function(dim) {} template void @@ -185,11 +186,11 @@ namespace Maxwell }; template - MaxwellProblem::MaxwellProblem(const unsigned int order) : - mapping(1), - dof_handler(triangulation), - fe(order), - exact_solution() + MaxwellProblem::MaxwellProblem(const unsigned int order) + : mapping(1) + , dof_handler(triangulation) + , fe(order) + , exact_solution() { p_order = order; quad_order = 2 * (p_order + 1); @@ -303,8 +304,10 @@ namespace Maxwell constraints.close(); DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern( - dof_handler, c_sparsity, constraints, false); + DoFTools::make_sparsity_pattern(dof_handler, + c_sparsity, + constraints, + false); sparsity_pattern.copy_from(c_sparsity); system_matrix.reinit(sparsity_pattern); diff --git a/tests/fe/non_primitive_1.cc b/tests/fe/non_primitive_1.cc index 2436b5071c..1ba3663b33 100644 --- a/tests/fe/non_primitive_1.cc +++ b/tests/fe/non_primitive_1.cc @@ -66,8 +66,9 @@ create_stokes_matrix_1(const DoFHandler &dof_handler, QGauss quadrature(3); const unsigned int n_q_points = quadrature.size(); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_JxW_values); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_JxW_values); const double nu = 3.14159265358e-2; @@ -135,8 +136,9 @@ create_stokes_matrix_2(const DoFHandler &dof_handler, QGauss quadrature(3); const unsigned int n_q_points = quadrature.size(); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_JxW_values); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_JxW_values); const double nu = 3.14159265358e-2; @@ -208,8 +210,9 @@ create_stokes_matrix_3(const DoFHandler &dof_handler, QGauss quadrature(3); const unsigned int n_q_points = quadrature.size(); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_JxW_values); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_JxW_values); const double nu = 3.14159265358e-2; @@ -238,8 +241,9 @@ create_stokes_matrix_3(const DoFHandler &dof_handler, // 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_grad_component(i, + q, + comp_i)[comp_i] * fe_values.shape_value_component(j, q, comp_j) * fe_values.JxW(q)); @@ -247,8 +251,9 @@ create_stokes_matrix_3(const DoFHandler &dof_handler, 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.shape_grad_component(j, + q, + comp_j)[comp_j] * fe_values.JxW(q)); }; diff --git a/tests/fe/non_primitive_2.cc b/tests/fe/non_primitive_2.cc index 98bbd51f44..51ebba895a 100644 --- a/tests/fe/non_primitive_2.cc +++ b/tests/fe/non_primitive_2.cc @@ -69,8 +69,9 @@ create_stokes_matrix_2(const DoFHandler &dof_handler, QGauss quadrature(3); const unsigned int n_q_points = quadrature.size(); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_JxW_values); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_JxW_values); const double nu = 3.14159265358e-2; @@ -142,8 +143,9 @@ create_stokes_matrix_3(const DoFHandler &dof_handler, QGauss quadrature(3); const unsigned int n_q_points = quadrature.size(); - FEValues fe_values( - fe, quadrature, update_values | update_gradients | update_JxW_values); + FEValues fe_values(fe, + quadrature, + update_values | update_gradients | update_JxW_values); const double nu = 3.14159265358e-2; @@ -172,8 +174,9 @@ create_stokes_matrix_3(const DoFHandler &dof_handler, // 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_grad_component(i, + q, + comp_i)[comp_i] * fe_values.shape_value_component(j, q, comp_j) * fe_values.JxW(q)); @@ -181,8 +184,9 @@ create_stokes_matrix_3(const DoFHandler &dof_handler, 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.shape_grad_component(j, + q, + comp_j)[comp_j] * fe_values.JxW(q)); }; diff --git a/tests/fe/rt_7.cc b/tests/fe/rt_7.cc index c8d9bfc21d..da8f1e0c0a 100644 --- a/tests/fe/rt_7.cc +++ b/tests/fe/rt_7.cc @@ -54,8 +54,9 @@ plot_shape_functions(const unsigned int degree) QTrapez<1> q_trapez; const unsigned int div = 10; QIterated q(q_trapez, div); - FEValues fe( - fe_rt, q, update_values | update_gradients | update_quadrature_points); + FEValues fe(fe_rt, + q, + update_values | update_gradients | update_quadrature_points); fe.reinit(c); Assert(fe.get_fe().n_components() == dim, ExcInternalError()); diff --git a/tests/fe/rt_approximation_01.cc b/tests/fe/rt_approximation_01.cc index d54dd8fa97..d823346bca 100644 --- a/tests/fe/rt_approximation_01.cc +++ b/tests/fe/rt_approximation_01.cc @@ -70,7 +70,8 @@ template class TestMap1 : public Function { public: - TestMap1(const unsigned int n_components) : Function(n_components) + TestMap1(const unsigned int n_components) + : Function(n_components) {} virtual ~TestMap1() @@ -125,9 +126,9 @@ private: const double phi; public: - TestDef1(const unsigned int n_components, const double ph) : - Function(n_components), - phi(ph) + TestDef1(const unsigned int n_components, const double ph) + : Function(n_components) + , phi(ph) {} virtual ~TestDef1() @@ -181,9 +182,9 @@ private: const double scale; public: - TestDef2(const unsigned int n_components, const double sc) : - Function(n_components), - scale(sc) + TestDef2(const unsigned int n_components, const double sc) + : Function(n_components) + , scale(sc) {} virtual ~TestDef2() @@ -233,9 +234,9 @@ private: const double scale; public: - TestDef3(const unsigned int n_components, const double sc) : - Function(n_components), - scale(sc) + TestDef3(const unsigned int n_components, const double sc) + : Function(n_components) + , scale(sc) {} virtual ~TestDef3() @@ -282,7 +283,8 @@ private: std::vector> polys; public: - TestPoly(unsigned int deg) : Function(2) + TestPoly(unsigned int deg) + : Function(2) { std::vector coeff(deg, 0.0); for (unsigned int p = 0; p < 4; ++p) diff --git a/tests/fe/rt_bubbles_15.cc b/tests/fe/rt_bubbles_15.cc index d09581b69b..a576c89d2f 100644 --- a/tests/fe/rt_bubbles_15.cc +++ b/tests/fe/rt_bubbles_15.cc @@ -62,8 +62,9 @@ test(const unsigned int degree) QTrapez quadrature; - FESubfaceValues fe_values( - fe_rt_bubbles, quadrature, update_gradients); + FESubfaceValues fe_values(fe_rt_bubbles, + quadrature, + update_gradients); fe_values.reinit(dof.begin_active(), 0, 0); for (unsigned int q = 0; q < quadrature.size(); ++q) { diff --git a/tests/fe/rt_hessian.cc b/tests/fe/rt_hessian.cc index bf67ca5ab2..287442fb20 100644 --- a/tests/fe/rt_hessian.cc +++ b/tests/fe/rt_hessian.cc @@ -48,8 +48,9 @@ test(const Triangulation &tr, const FiniteElement &fe) dof.distribute_dofs(fe); const QGauss quadrature(2); - FEValues fe_values( - fe, quadrature, update_covariant_transformation | update_hessians); + FEValues fe_values(fe, + quadrature, + update_covariant_transformation | update_hessians); fe_values.reinit(dof.begin_active()); diff --git a/tests/fe/rt_normal_02.cc b/tests/fe/rt_normal_02.cc index 26bbe3697b..a2505eca4f 100644 --- a/tests/fe/rt_normal_02.cc +++ b/tests/fe/rt_normal_02.cc @@ -106,12 +106,12 @@ void EvaluateNormal2(DoFHandler<2> *dof_handler, Vector &solution) 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())); + (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); diff --git a/tests/fe/rtdiff.cc b/tests/fe/rtdiff.cc index 6b2f9a131c..d1c5badf5e 100644 --- a/tests/fe/rtdiff.cc +++ b/tests/fe/rtdiff.cc @@ -95,10 +95,12 @@ compare_shapes(const FiniteElement &other, QGauss 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); + 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) diff --git a/tests/fe/rtn_2.cc b/tests/fe/rtn_2.cc index 961507f3c1..530691568b 100644 --- a/tests/fe/rtn_2.cc +++ b/tests/fe/rtn_2.cc @@ -55,8 +55,9 @@ plot_shape_functions(const unsigned int degree) QTrapez<1> q_trapez; const unsigned int div = 10; QIterated q(q_trapez, div); - FEValues fe( - fe_rt, q, update_values | update_gradients | update_quadrature_points); + FEValues fe(fe_rt, + q, + update_values | update_gradients | update_quadrature_points); fe.reinit(c); for (unsigned int q_point = 0; q_point < q.size(); ++q_point) diff --git a/tests/fe/shapes.h b/tests/fe/shapes.h index decd24ff0b..a397776f18 100644 --- a/tests/fe/shapes.h +++ b/tests/fe/shapes.h @@ -48,11 +48,11 @@ plot_shape_functions(Mapping & mapping, QTrapez<1> q_trapez; QIterated q(q_trapez, div); - FEValues fe( - mapping, - finel, - q, - UpdateFlags(update_values | update_gradients | update_hessians)); + FEValues fe(mapping, + finel, + q, + UpdateFlags(update_values | update_gradients | + update_hessians)); sprintf(fname, "Cell%dd-%s", dim, name); // cerr << "\n" << fname << "\n"; @@ -137,12 +137,16 @@ plot_face_shape_functions(Mapping & mapping, const unsigned int div = 4; - QTrapez<1> q_trapez; - QIterated q(q_trapez, div); - FEFaceValues fe( - mapping, finel, q, UpdateFlags(uflags | update_quadrature_points)); - FESubfaceValues sub( - mapping, finel, q, UpdateFlags(uflags | update_quadrature_points)); + QTrapez<1> q_trapez; + QIterated q(q_trapez, div); + FEFaceValues fe(mapping, + finel, + q, + UpdateFlags(uflags | update_quadrature_points)); + FESubfaceValues sub(mapping, + finel, + q, + UpdateFlags(uflags | update_quadrature_points)); sprintf(fname, "Face%dd-%s", dim, name); deallog.push(fname); @@ -276,8 +280,10 @@ plot_face_shape_functions(Mapping & mapping, { const Tensor<3, dim> t1 = sub.shape_3rd_derivative(i, k), - t2 = sub.shape_3rd_derivative_component( - i, k, c); + t2 = + sub.shape_3rd_derivative_component(i, + k, + c); Assert(t1 == t2, ExcInternalError()); } } @@ -376,13 +382,13 @@ check_values_and_derivatives(const FiniteElement &fe, if (fe.is_primitive(i)) for (unsigned int c = 0; c < fe.n_components(); ++c) - Assert( - ((c == fe.system_to_component_index(i).first) && - (fe_values.shape_grad(i, x) == - fe_values.shape_grad_component(i, x, c))) || - ((c != fe.system_to_component_index(i).first) && - (fe_values.shape_grad_component(i, x, c) == Tensor<1, dim>())), - ExcInternalError()); + Assert(((c == fe.system_to_component_index(i).first) && + (fe_values.shape_grad(i, x) == + fe_values.shape_grad_component(i, x, c))) || + ((c != fe.system_to_component_index(i).first) && + (fe_values.shape_grad_component(i, x, c) == + Tensor<1, dim>())), + ExcInternalError()); } // check second derivatives diff --git a/tests/fe/system_03.cc b/tests/fe/system_03.cc index 8ffbb69188..9426a425ba 100644 --- a/tests/fe/system_03.cc +++ b/tests/fe/system_03.cc @@ -57,8 +57,9 @@ main() check<2>(fe); } { - FESystem<2> fe = { - FESystem<2>(FE_Q<2>(1) ^ 2) ^ 1, FE_DGQ<2>(2) ^ 0, FE_Q<2>(1) ^ 1}; + FESystem<2> fe = {FESystem<2>(FE_Q<2>(1) ^ 2) ^ 1, + FE_DGQ<2>(2) ^ 0, + FE_Q<2>(1) ^ 1}; check<2>(fe); } diff --git a/tests/fe/system_04.cc b/tests/fe/system_04.cc index 1f5cac9538..93dd6214b4 100644 --- a/tests/fe/system_04.cc +++ b/tests/fe/system_04.cc @@ -58,8 +58,9 @@ main() check<2>(fe); } { - FESystem<2> fe( - FESystem<2>(FE_Q<2>(1) ^ 2) ^ 1, FE_DGQ<2>(2) ^ 0, FE_Q<2>(1)); + FESystem<2> fe(FESystem<2>(FE_Q<2>(1) ^ 2) ^ 1, + FE_DGQ<2>(2) ^ 0, + FE_Q<2>(1)); check<2>(fe); } diff --git a/tests/full_matrix/full_matrix_10.cc b/tests/full_matrix/full_matrix_10.cc index 4ed0c9ee47..919b2b0d53 100644 --- a/tests/full_matrix/full_matrix_10.cc +++ b/tests/full_matrix/full_matrix_10.cc @@ -43,8 +43,9 @@ test() C.add(-1., D); deallog << "Difference: " - << filter_out_small_numbers( - C.l1_norm(), std::numeric_limits::epsilon() * 100.) + << filter_out_small_numbers(C.l1_norm(), + std::numeric_limits::epsilon() * + 100.) << std::endl; } diff --git a/tests/full_matrix/full_matrix_11.cc b/tests/full_matrix/full_matrix_11.cc index 636197df97..65e490eed5 100644 --- a/tests/full_matrix/full_matrix_11.cc +++ b/tests/full_matrix/full_matrix_11.cc @@ -43,8 +43,9 @@ test() C.add(-1., D); deallog << "Difference: " - << filter_out_small_numbers( - C.l1_norm(), 100. * std::numeric_limits::epsilon()) + << filter_out_small_numbers(C.l1_norm(), + 100. * + std::numeric_limits::epsilon()) << std::endl; } diff --git a/tests/gla/block_mat_02.cc b/tests/gla/block_mat_02.cc index a6f41dec2a..0395affc03 100644 --- a/tests/gla/block_mat_02.cc +++ b/tests/gla/block_mat_02.cc @@ -78,8 +78,9 @@ test() DoFRenumbering::component_wise(stokes_dof_handler, stokes_sub_blocks); std::vector stokes_dofs_per_block(2); - DoFTools::count_dofs_per_block( - stokes_dof_handler, stokes_dofs_per_block, stokes_sub_blocks); + DoFTools::count_dofs_per_block(stokes_dof_handler, + stokes_dofs_per_block, + stokes_sub_blocks); const unsigned int n_u = stokes_dofs_per_block[0], n_p = stokes_dofs_per_block[1]; @@ -114,13 +115,13 @@ test() 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, @@ -174,8 +175,9 @@ test_LA_Trilinos() DoFRenumbering::component_wise(stokes_dof_handler, stokes_sub_blocks); std::vector stokes_dofs_per_block(2); - DoFTools::count_dofs_per_block( - stokes_dof_handler, stokes_dofs_per_block, stokes_sub_blocks); + DoFTools::count_dofs_per_block(stokes_dof_handler, + stokes_dofs_per_block, + stokes_sub_blocks); const unsigned int n_u = stokes_dofs_per_block[0], n_p = stokes_dofs_per_block[1]; @@ -211,13 +213,13 @@ test_LA_Trilinos() 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)); sp.compress(); diff --git a/tests/gla/block_mat_03.cc b/tests/gla/block_mat_03.cc index 6b52245141..33244aeddd 100644 --- a/tests/gla/block_mat_03.cc +++ b/tests/gla/block_mat_03.cc @@ -85,14 +85,16 @@ test() DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs); locally_relevant_partitioning.push_back( locally_relevant_dofs.get_view(0, dofs_per_block[0])); - locally_relevant_partitioning.push_back(locally_relevant_dofs.get_view( - dofs_per_block[0], dofs_per_block[0] + dofs_per_block[1])); + locally_relevant_partitioning.push_back( + locally_relevant_dofs.get_view(dofs_per_block[0], + dofs_per_block[0] + dofs_per_block[1])); IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs(); locally_owned_partitioning.push_back( locally_owned_dofs.get_view(0, dofs_per_block[0])); - locally_owned_partitioning.push_back(locally_owned_dofs.get_view( - dofs_per_block[0], dofs_per_block[0] + dofs_per_block[1])); + locally_owned_partitioning.push_back( + locally_owned_dofs.get_view(dofs_per_block[0], + dofs_per_block[0] + dofs_per_block[1])); deallog << "owned: "; locally_owned_dofs.print(deallog); @@ -141,8 +143,9 @@ test() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - local_matrix, local_dof_indices, A); + constraints.distribute_local_to_global(local_matrix, + local_dof_indices, + A); } A.compress(VectorOperation::add); @@ -188,14 +191,16 @@ test_alt() DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs); locally_relevant_partitioning.push_back( locally_relevant_dofs.get_view(0, dofs_per_block[0])); - locally_relevant_partitioning.push_back(locally_relevant_dofs.get_view( - dofs_per_block[0], dofs_per_block[0] + dofs_per_block[1])); + locally_relevant_partitioning.push_back( + locally_relevant_dofs.get_view(dofs_per_block[0], + dofs_per_block[0] + dofs_per_block[1])); IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs(); locally_owned_partitioning.push_back( locally_owned_dofs.get_view(0, dofs_per_block[0])); - locally_owned_partitioning.push_back(locally_owned_dofs.get_view( - dofs_per_block[0], dofs_per_block[0] + dofs_per_block[1])); + locally_owned_partitioning.push_back( + locally_owned_dofs.get_view(dofs_per_block[0], + dofs_per_block[0] + dofs_per_block[1])); deallog << "owned: "; locally_owned_dofs.print(deallog); @@ -208,12 +213,12 @@ test_alt() TrilinosWrappers::BlockSparsityPattern sp(locally_owned_partitioning, MPI_COMM_WORLD); - DoFTools::make_sparsity_pattern( - dof_handler, - sp, - constraints, - false, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(dof_handler, + sp, + constraints, + false, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); sp.compress(); typename LA::MPI::BlockSparseMatrix A; A.reinit(sp); @@ -244,8 +249,9 @@ test_alt() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - local_matrix, local_dof_indices, A); + constraints.distribute_local_to_global(local_matrix, + local_dof_indices, + A); } A.compress(VectorOperation::add); diff --git a/tests/gla/extract_subvector_to_parallel.cc b/tests/gla/extract_subvector_to_parallel.cc index 538c0c5845..e44444c816 100644 --- a/tests/gla/extract_subvector_to_parallel.cc +++ b/tests/gla/extract_subvector_to_parallel.cc @@ -93,8 +93,9 @@ main(int argc, char **argv) deallog.push("deal.II"); LinearAlgebra::distributed::Vector w(local, MPI_COMM_WORLD); set(w); - LinearAlgebra::distributed::Vector v( - local, dense_local, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local, + dense_local, + MPI_COMM_WORLD); v = w; // get copy of vector including ghost elements test(v); deallog.pop(); @@ -157,8 +158,9 @@ main(int argc, char **argv) LinearAlgebra::distributed::BlockVector w(partitioning, MPI_COMM_WORLD); set(w); - LinearAlgebra::distributed::BlockVector v( - partitioning, dense_partitioning, MPI_COMM_WORLD); + LinearAlgebra::distributed::BlockVector v(partitioning, + dense_partitioning, + MPI_COMM_WORLD); v = w; // get copy of vector including ghost elements test(v); deallog.pop(); @@ -168,8 +170,9 @@ main(int argc, char **argv) deallog.push("PETSc"); PETScWrappers::MPI::BlockVector w(partitioning, MPI_COMM_WORLD); set(w); - PETScWrappers::MPI::BlockVector v( - partitioning, dense_partitioning, MPI_COMM_WORLD); + PETScWrappers::MPI::BlockVector v(partitioning, + dense_partitioning, + MPI_COMM_WORLD); v = w; // get copy of vector including ghost elements test(v); deallog.pop(); @@ -179,8 +182,9 @@ main(int argc, char **argv) deallog.push("Trilinos"); TrilinosWrappers::MPI::BlockVector w(partitioning, MPI_COMM_WORLD); set(w); - TrilinosWrappers::MPI::BlockVector v( - partitioning, dense_partitioning, MPI_COMM_WORLD); + TrilinosWrappers::MPI::BlockVector v(partitioning, + dense_partitioning, + MPI_COMM_WORLD); v = w; // get copy of vector including ghost elements test(v); deallog.pop(); diff --git a/tests/gla/mat_03.cc b/tests/gla/mat_03.cc index 0a52bc3762..bdf9ff8d96 100644 --- a/tests/gla/mat_03.cc +++ b/tests/gla/mat_03.cc @@ -77,12 +77,12 @@ test() // DynamicSparsityPattern sp (owned); DynamicSparsityPattern sp(relevant); typename LA::MPI::SparseMatrix matrix; - DoFTools::make_sparsity_pattern( - dof_handler, - sp, - cm, - false, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(dof_handler, + sp, + cm, + false, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); SparsityTools::distribute_sparsity_pattern( sp, dof_handler.n_locally_owned_dofs_per_processor(), diff --git a/tests/gla/mat_04.cc b/tests/gla/mat_04.cc index a12d10a906..4af2dfe4ac 100644 --- a/tests/gla/mat_04.cc +++ b/tests/gla/mat_04.cc @@ -76,12 +76,12 @@ test() DynamicSparsityPattern sp(relevant); typename LA::MPI::SparseMatrix matrix; - DoFTools::make_sparsity_pattern( - dof_handler, - sp, - cm, - false, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(dof_handler, + sp, + cm, + false, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); SparsityTools::distribute_sparsity_pattern( sp, dof_handler.n_locally_owned_dofs_per_processor(), @@ -137,12 +137,12 @@ 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)); + DoFTools::make_sparsity_pattern(dof_handler, + sp, + cm, + false, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); sp.compress(); matrix.reinit(sp); diff --git a/tests/grid/coarsening_02.cc b/tests/grid/coarsening_02.cc index 6d50b356b8..37eccb748a 100644 --- a/tests/grid/coarsening_02.cc +++ b/tests/grid/coarsening_02.cc @@ -51,10 +51,12 @@ satisfies_level1_at_vertex_rule(const Triangulation &tr) ++cell) for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) { - min_adjacent_cell_level[cell->vertex_index(v)] = std::min( - min_adjacent_cell_level[cell->vertex_index(v)], cell->level()); - max_adjacent_cell_level[cell->vertex_index(v)] = std::max( - min_adjacent_cell_level[cell->vertex_index(v)], cell->level()); + min_adjacent_cell_level[cell->vertex_index(v)] = + std::min(min_adjacent_cell_level[cell->vertex_index(v)], + cell->level()); + max_adjacent_cell_level[cell->vertex_index(v)] = + std::max(min_adjacent_cell_level[cell->vertex_index(v)], + cell->level()); } for (unsigned int k = 0; k < tr.n_vertices(); ++k) diff --git a/tests/grid/coarsening_02_1d.cc b/tests/grid/coarsening_02_1d.cc index 981a4bc520..c1a12a5701 100644 --- a/tests/grid/coarsening_02_1d.cc +++ b/tests/grid/coarsening_02_1d.cc @@ -52,10 +52,12 @@ satisfies_level1_at_vertex_rule(const Triangulation &tr) ++cell) for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) { - min_adjacent_cell_level[cell->vertex_index(v)] = std::min( - min_adjacent_cell_level[cell->vertex_index(v)], cell->level()); - max_adjacent_cell_level[cell->vertex_index(v)] = std::max( - min_adjacent_cell_level[cell->vertex_index(v)], cell->level()); + min_adjacent_cell_level[cell->vertex_index(v)] = + std::min(min_adjacent_cell_level[cell->vertex_index(v)], + cell->level()); + max_adjacent_cell_level[cell->vertex_index(v)] = + std::max(min_adjacent_cell_level[cell->vertex_index(v)], + cell->level()); } for (unsigned int k = 0; k < tr.n_vertices(); ++k) diff --git a/tests/grid/coarsening_03.cc b/tests/grid/coarsening_03.cc index 9a191d5d57..aad627302c 100644 --- a/tests/grid/coarsening_03.cc +++ b/tests/grid/coarsening_03.cc @@ -48,10 +48,12 @@ satisfies_level1_at_vertex_rule(const Triangulation &tr) ++cell) for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) { - min_adjacent_cell_level[cell->vertex_index(v)] = std::min( - min_adjacent_cell_level[cell->vertex_index(v)], cell->level()); - max_adjacent_cell_level[cell->vertex_index(v)] = std::max( - min_adjacent_cell_level[cell->vertex_index(v)], cell->level()); + min_adjacent_cell_level[cell->vertex_index(v)] = + std::min(min_adjacent_cell_level[cell->vertex_index(v)], + cell->level()); + max_adjacent_cell_level[cell->vertex_index(v)] = + std::max(min_adjacent_cell_level[cell->vertex_index(v)], + cell->level()); } for (unsigned int k = 0; k < tr.n_vertices(); ++k) diff --git a/tests/grid/distributed_compute_point_locations_02.cc b/tests/grid/distributed_compute_point_locations_02.cc index 381fec25be..14a406ee2a 100644 --- a/tests/grid/distributed_compute_point_locations_02.cc +++ b/tests/grid/distributed_compute_point_locations_02.cc @@ -100,8 +100,9 @@ test_compute_pt_loc(unsigned int ref_cube, unsigned int ref_sphere) if (my_pair.first->is_locally_owned()) { computed_pts++; - auto cells_it = std::find( - computed_cells.begin(), computed_cells.end(), my_pair.first); + auto cells_it = std::find(computed_cells.begin(), + computed_cells.end(), + my_pair.first); if (cells_it == computed_cells.end()) { diff --git a/tests/grid/filtered_iterator.cc b/tests/grid/filtered_iterator.cc index 9d964c15d1..c52a179c17 100644 --- a/tests/grid/filtered_iterator.cc +++ b/tests/grid/filtered_iterator.cc @@ -164,16 +164,16 @@ test() tria.end())) == static_cast(tria.n_active_cells(3)), ExcInternalError()); - logfile << "Check 4: " - << (std::distance( - FI(std::bind(predicate, std::placeholders::_1, 3)) - .set_to_next_positive(tria.begin_active()), - FI(std::bind(predicate, std::placeholders::_1, 3), - tria.end())) == - static_cast(tria.n_active_cells(3)) ? - "OK" : - "Failed") - << std::endl; + logfile + << "Check 4: " + << (std::distance(FI(std::bind(predicate, std::placeholders::_1, 3)) + .set_to_next_positive(tria.begin_active()), + FI(std::bind(predicate, std::placeholders::_1, 3), + tria.end())) == + static_cast(tria.n_active_cells(3)) ? + "OK" : + "Failed") + << std::endl; }; diff --git a/tests/grid/filtered_iterator_02.cc b/tests/grid/filtered_iterator_02.cc index 2cb15f4171..c19190c8cf 100644 --- a/tests/grid/filtered_iterator_02.cc +++ b/tests/grid/filtered_iterator_02.cc @@ -92,8 +92,9 @@ test() const IteratorFilters::LevelEqualTo predicate(3); FilteredIterator begin = make_filtered_iterator(tria.begin_active(), predicate), - end = make_filtered_iterator( - static_cast(tria.end()), predicate); + end = + make_filtered_iterator(static_cast(tria.end()), + predicate); Assert(std::distance(begin, end) == static_cast(tria.n_active_cells(3)), @@ -165,16 +166,16 @@ test() tria.end())) == static_cast(tria.n_active_cells(3)), ExcInternalError()); - logfile << "Check 4: " - << (std::distance( - FI(std::bind(predicate, std::placeholders::_1, 3)) - .set_to_next_positive(tria.begin_active()), - FI(std::bind(predicate, std::placeholders::_1, 3), - tria.end())) == - static_cast(tria.n_active_cells(3)) ? - "OK" : - "Failed") - << std::endl; + logfile + << "Check 4: " + << (std::distance(FI(std::bind(predicate, std::placeholders::_1, 3)) + .set_to_next_positive(tria.begin_active()), + FI(std::bind(predicate, std::placeholders::_1, 3), + tria.end())) == + static_cast(tria.n_active_cells(3)) ? + "OK" : + "Failed") + << std::endl; }; diff --git a/tests/grid/grid_generator_06.cc b/tests/grid/grid_generator_06.cc index df9e59c5af..42c71221d5 100644 --- a/tests/grid/grid_generator_06.cc +++ b/tests/grid/grid_generator_06.cc @@ -35,8 +35,10 @@ test(std::ostream &out) { Triangulation<2> triangulation; Triangulation<3> tr; - GridGenerator::hyper_rectangle( - triangulation, Point<2>(0, 0), Point<2>(1, 1), true); + GridGenerator::hyper_rectangle(triangulation, + Point<2>(0, 0), + Point<2>(1, 1), + true); GridGenerator::extrude_triangulation(triangulation, 3, 2.0, tr); GridOut go; diff --git a/tests/grid/grid_generator_07.cc b/tests/grid/grid_generator_07.cc index 70728aca8f..9d3df0dd6d 100644 --- a/tests/grid/grid_generator_07.cc +++ b/tests/grid/grid_generator_07.cc @@ -47,8 +47,9 @@ test(std::ostream &out) ++cell) cells_to_remove.insert(cell); - GridGenerator::create_triangulation_with_removed_cells( - triangulation, cells_to_remove, tr); + GridGenerator::create_triangulation_with_removed_cells(triangulation, + cells_to_remove, + tr); GridOut go; go.write_gnuplot(tr, out); } diff --git a/tests/grid/grid_out_gnuplot_02.cc b/tests/grid/grid_out_gnuplot_02.cc index 0e74163b24..534944ef4f 100644 --- a/tests/grid/grid_out_gnuplot_02.cc +++ b/tests/grid/grid_out_gnuplot_02.cc @@ -37,7 +37,8 @@ template class Shift : public Function { public: - Shift() : Function(spacedim) + Shift() + : Function(spacedim) {} virtual double @@ -90,8 +91,9 @@ gnuplot_output(const GridOutFlags::Gnuplot &flags) displacement_dof_handler.initialize(triangulation, displacement_fe); Vector displacements(displacement_dof_handler.n_dofs()); - VectorTools::interpolate( - displacement_dof_handler, Shift(), displacements); + VectorTools::interpolate(displacement_dof_handler, + Shift(), + displacements); MappingQ1Eulerian, spacedim> mapping( displacement_dof_handler, displacements); diff --git a/tests/grid/grid_out_per_processor_vtu_01.cc b/tests/grid/grid_out_per_processor_vtu_01.cc index c3ab407918..a64e16306a 100644 --- a/tests/grid/grid_out_per_processor_vtu_01.cc +++ b/tests/grid/grid_out_per_processor_vtu_01.cc @@ -47,8 +47,10 @@ output(const parallel::distributed::Triangulation &tr, const bool include_artificial) { GridOut out; - out.write_mesh_per_processor_as_vtu( - tr, filename, view_levels, include_artificial); + out.write_mesh_per_processor_as_vtu(tr, + filename, + view_levels, + include_artificial); // copy the .pvtu and .vtu files // into the logstream diff --git a/tests/grid/grid_out_per_processor_vtu_02.cc b/tests/grid/grid_out_per_processor_vtu_02.cc index cbb2ea384a..c86685a8e3 100644 --- a/tests/grid/grid_out_per_processor_vtu_02.cc +++ b/tests/grid/grid_out_per_processor_vtu_02.cc @@ -48,8 +48,10 @@ output(const parallel::shared::Triangulation &tr, const bool include_artificial) { GridOut out; - out.write_mesh_per_processor_as_vtu( - tr, filename, view_levels, include_artificial); + out.write_mesh_per_processor_as_vtu(tr, + filename, + view_levels, + include_artificial); // copy the .pvtu and .vtu files // into the logstream diff --git a/tests/grid/grid_out_svg_01.cc b/tests/grid/grid_out_svg_01.cc index 027934f303..8360f7d36c 100644 --- a/tests/grid/grid_out_svg_01.cc +++ b/tests/grid/grid_out_svg_01.cc @@ -35,8 +35,9 @@ create_grid() Point<2> center(0., 0.); - GridGenerator::hyper_cube_with_cylindrical_hole( - triangulation, inner_radius, outer_radius); + GridGenerator::hyper_cube_with_cylindrical_hole(triangulation, + inner_radius, + outer_radius); triangulation.reset_manifold(0); triangulation.refine_global(1); diff --git a/tests/grid/grid_out_svg_02.cc b/tests/grid/grid_out_svg_02.cc index 9fd7f6b762..632120fb58 100644 --- a/tests/grid/grid_out_svg_02.cc +++ b/tests/grid/grid_out_svg_02.cc @@ -36,8 +36,9 @@ create_grid() Point<2> center(0., 0.); - GridGenerator::hyper_cube_with_cylindrical_hole( - triangulation, inner_radius, outer_radius); + GridGenerator::hyper_cube_with_cylindrical_hole(triangulation, + inner_radius, + outer_radius); triangulation.refine_global(1); for (unsigned int l = 0; l < 3; ++l) diff --git a/tests/grid/grid_parallelepiped_03.cc b/tests/grid/grid_parallelepiped_03.cc index af0c32780e..6ffec8f142 100644 --- a/tests/grid/grid_parallelepiped_03.cc +++ b/tests/grid/grid_parallelepiped_03.cc @@ -67,8 +67,10 @@ check_subdivided_parallelepiped(bool colorize, bool log) const unsigned int n_subdivisions = (2 * dim + 1); Triangulation triangulation; - GridGenerator::subdivided_parallelepiped( - triangulation, n_subdivisions, corners, colorize); + GridGenerator::subdivided_parallelepiped(triangulation, + n_subdivisions, + corners, + colorize); GridOut grid_out; diff --git a/tests/grid/grid_parallelepiped_04.cc b/tests/grid/grid_parallelepiped_04.cc index afee31ea13..5a822c211e 100644 --- a/tests/grid/grid_parallelepiped_04.cc +++ b/tests/grid/grid_parallelepiped_04.cc @@ -78,8 +78,10 @@ check_parallelepiped(bool colorize, bool log, const unsigned int (&subd)[dim]) Triangulation triangulation; - GridGenerator::subdivided_parallelepiped( - triangulation, subd, corners, colorize); + GridGenerator::subdivided_parallelepiped(triangulation, + subd, + corners, + colorize); { std::map boundary_count; diff --git a/tests/grid/grid_remove_anisotropy.cc b/tests/grid/grid_remove_anisotropy.cc index 0299e7c44d..506ca55136 100644 --- a/tests/grid/grid_remove_anisotropy.cc +++ b/tests/grid/grid_remove_anisotropy.cc @@ -43,8 +43,9 @@ check_remove_anisotropy() const unsigned int n_subdivisions = 1; Triangulation<3> triangulation; - GridGenerator::subdivided_parallelepiped( - triangulation, n_subdivisions, corners); + GridGenerator::subdivided_parallelepiped(triangulation, + n_subdivisions, + corners); dealii::GridTools::remove_anisotropy<3>(triangulation, /*max ratio =*/1.2); diff --git a/tests/grid/grid_tools_halo_layer_ghost_cells.cc b/tests/grid/grid_tools_halo_layer_ghost_cells.cc index 48ac098e9d..2af7a5fd7c 100644 --- a/tests/grid/grid_tools_halo_layer_ghost_cells.cc +++ b/tests/grid/grid_tools_halo_layer_ghost_cells.cc @@ -86,9 +86,9 @@ test() << "Halo " << cell_2->level() << " " << cell_2->index() << " " << cell_2->id() << " " << cell_2->id().to_string() << std::endl; - AssertThrow( - cell_2 == cell_1, - ExcMessage("Halo cell is not identical to ghost cell.")); + AssertThrow(cell_2 == cell_1, + ExcMessage( + "Halo cell is not identical to ghost cell.")); } } } diff --git a/tests/grid/grid_tools_min_max_diameter_01.cc b/tests/grid/grid_tools_min_max_diameter_01.cc index b3c911d727..6d5027514a 100644 --- a/tests/grid/grid_tools_min_max_diameter_01.cc +++ b/tests/grid/grid_tools_min_max_diameter_01.cc @@ -77,8 +77,9 @@ test(const unsigned int degree) // By using MappingQEulerian with the position vector, we are making // everything bigger by a factor 2. - MappingQEulerian, spacedim> map_fe( - degree, dof_sys, euler); + MappingQEulerian, spacedim> map_fe(degree, + dof_sys, + euler); deallog << "Min diameter : " << GridTools::minimal_cell_diameter(tria) << std::endl diff --git a/tests/grid/grid_transform_03.cc b/tests/grid/grid_transform_03.cc index 35659eea87..525c3541ab 100644 --- a/tests/grid/grid_transform_03.cc +++ b/tests/grid/grid_transform_03.cc @@ -34,9 +34,9 @@ template class L2_inverse : public Function { public: - L2_inverse(const std::vector> &distance_source) : - Function(), - distance_source(distance_source) + L2_inverse(const std::vector> &distance_source) + : Function() + , distance_source(distance_source) { Assert(distance_source.size() > 0, ExcNotImplemented()); } diff --git a/tests/grid/grid_transform_3d.cc b/tests/grid/grid_transform_3d.cc index d6b62e0221..e02984d444 100644 --- a/tests/grid/grid_transform_3d.cc +++ b/tests/grid/grid_transform_3d.cc @@ -88,12 +88,12 @@ main() { const Point &old_vertex = face->vertex(vertex_no); - Point 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]))); + Point 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; } diff --git a/tests/grid/intergrid_constraints.cc b/tests/grid/intergrid_constraints.cc index 00280a622b..5bf23337ae 100644 --- a/tests/grid/intergrid_constraints.cc +++ b/tests/grid/intergrid_constraints.cc @@ -171,8 +171,10 @@ check() // refined if that // has not yet // happened - typename DoFHandler::cell_iterator cell2( - &tria_2, cell->level(), cell->index(), &dof_2); + typename DoFHandler::cell_iterator cell2(&tria_2, + cell->level(), + cell->index(), + &dof_2); if (!cell2->has_children()) cell2->set_refine_flag(); }; diff --git a/tests/grid/merge_triangulations_04.cc b/tests/grid/merge_triangulations_04.cc index 5f4cc544fe..7f56bb4707 100644 --- a/tests/grid/merge_triangulations_04.cc +++ b/tests/grid/merge_triangulations_04.cc @@ -30,8 +30,10 @@ main() // set up the bulk triangulation Triangulation<2> bulk_triangulation; - GridGenerator::subdivided_hyper_rectangle( - bulk_triangulation, {22u, 4u}, Point<2>(0.0, 0.0), Point<2>(2.2, 0.41)); + GridGenerator::subdivided_hyper_rectangle(bulk_triangulation, + {22u, 4u}, + Point<2>(0.0, 0.0), + Point<2>(2.2, 0.41)); std::set::active_cell_iterator> cells_to_remove; Tensor<1, 2> cylinder_triangulation_offset; for (const auto cell : bulk_triangulation.active_cell_iterators()) @@ -54,13 +56,15 @@ main() } } Triangulation<2> result_1; - GridGenerator::create_triangulation_with_removed_cells( - bulk_triangulation, cells_to_remove, result_1); + GridGenerator::create_triangulation_with_removed_cells(bulk_triangulation, + cells_to_remove, + result_1); // set up the cylinder triangulation Triangulation<2> cylinder_triangulation; - GridGenerator::hyper_cube_with_cylindrical_hole( - cylinder_triangulation, 0.05, 0.41 / 4.0); + GridGenerator::hyper_cube_with_cylindrical_hole(cylinder_triangulation, + 0.05, + 0.41 / 4.0); GridTools::shift(cylinder_triangulation_offset, cylinder_triangulation); // dumb hack for (const auto cell : cylinder_triangulation.active_cell_iterators()) @@ -72,10 +76,10 @@ main() for (const auto cell : tria.active_cell_iterators()) for (unsigned int line_n = 0; line_n < GeometryInfo<2>::lines_per_cell; ++line_n) - min_line_length = std::min( - min_line_length, - (cell->line(line_n)->vertex(0) - cell->line(line_n)->vertex(1)) - .norm()); + min_line_length = std::min(min_line_length, + (cell->line(line_n)->vertex(0) - + cell->line(line_n)->vertex(1)) + .norm()); return min_line_length; }; @@ -89,8 +93,10 @@ main() Triangulation<2> result_2; - GridGenerator::merge_triangulations( - result_1, cylinder_triangulation, result_2, tolerance); + GridGenerator::merge_triangulations(result_1, + cylinder_triangulation, + result_2, + tolerance); const types::manifold_id tfi_id = 1; const types::manifold_id polar_id = 0; @@ -133,9 +139,9 @@ main() } // de-duplicate std::sort(inner_pointers.begin(), inner_pointers.end()); - inner_pointers.erase( - std::unique(inner_pointers.begin(), inner_pointers.end()), - inner_pointers.end()); + inner_pointers.erase(std::unique(inner_pointers.begin(), + inner_pointers.end()), + inner_pointers.end()); // find the current center... Point<2> center; diff --git a/tests/grid/mesh_3d.h b/tests/grid/mesh_3d.h index 094620b2b2..70fe0ab725 100644 --- a/tests/grid/mesh_3d.h +++ b/tests/grid/mesh_3d.h @@ -57,8 +57,9 @@ void create_two_cubes(Triangulation<3> &coarse_grid) // finally generate a triangulation // out of this GridReordering<3>::reorder_cells(cells); - coarse_grid.create_triangulation_compatibility( - vertices, cells, SubCellData()); + coarse_grid.create_triangulation_compatibility(vertices, + cells, + SubCellData()); } @@ -104,8 +105,9 @@ void create_two_cubes_rotation(Triangulation<3> & coarse_grid, } // finally generate a triangulation // out of this - coarse_grid.create_triangulation_compatibility( - vertices, cells, SubCellData()); + coarse_grid.create_triangulation_compatibility(vertices, + cells, + SubCellData()); } @@ -138,8 +140,9 @@ 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}}; + const unsigned int connectivity[3][4] = {{1, 2, 3, 0}, + {3, 4, 5, 0}, + {0, 5, 6, 7}}; for (unsigned int i = 0; i < 3; ++i) { CellData<3> cell; @@ -154,8 +157,9 @@ void create_L_shape(Triangulation<3> &coarse_grid) // finally generate a triangulation // out of this GridReordering<3>::reorder_cells(cells); - coarse_grid.create_triangulation_compatibility( - vertices, cells, SubCellData()); + coarse_grid.create_triangulation_compatibility(vertices, + cells, + SubCellData()); } diff --git a/tests/grid/mesh_3d_14.cc b/tests/grid/mesh_3d_14.cc index e726e38c92..4f97da3871 100644 --- a/tests/grid/mesh_3d_14.cc +++ b/tests/grid/mesh_3d_14.cc @@ -48,10 +48,11 @@ void check_this(Triangulation<3> &tria) quadrature, update_quadrature_points | update_JxW_values | update_normal_vectors); - FESubfaceValues<3> fe_face_values2( - fe, - quadrature, - update_quadrature_points | update_JxW_values | update_normal_vectors); + FESubfaceValues<3> fe_face_values2(fe, + quadrature, + update_quadrature_points | + update_JxW_values | + update_normal_vectors); DoFHandler<3> dof_handler(tria); dof_handler.distribute_dofs(fe); diff --git a/tests/grid/mesh_3d_16.cc b/tests/grid/mesh_3d_16.cc index 5b79e1c7ad..fd457e0d1d 100644 --- a/tests/grid/mesh_3d_16.cc +++ b/tests/grid/mesh_3d_16.cc @@ -46,8 +46,9 @@ void check(Triangulation<3> &tria) QGauss<2> q_face(3); - FEFaceValues<3> fe_face_values( - fe, q_face, update_normal_vectors | update_JxW_values); + FEFaceValues<3> fe_face_values(fe, + q_face, + update_normal_vectors | update_JxW_values); FESubfaceValues<3> fe_subface_values( fe, q_face, update_normal_vectors | update_JxW_values); diff --git a/tests/grid/mesh_3d_20.cc b/tests/grid/mesh_3d_20.cc index 640922d8f3..bce91f2a92 100644 --- a/tests/grid/mesh_3d_20.cc +++ b/tests/grid/mesh_3d_20.cc @@ -43,10 +43,12 @@ void check_this(Triangulation<3> &tria) { QTrapez<2> quadrature; FE_Q<3> fe(1); - FEFaceValues<3> fe_face_values1( - fe, quadrature, update_quadrature_points | update_JxW_values); - FEFaceValues<3> fe_face_values2( - fe, quadrature, update_quadrature_points | update_JxW_values); + FEFaceValues<3> fe_face_values1(fe, + quadrature, + update_quadrature_points | update_JxW_values); + FEFaceValues<3> fe_face_values2(fe, + quadrature, + update_quadrature_points | update_JxW_values); DoFHandler<3> dof_handler(tria); dof_handler.distribute_dofs(fe); diff --git a/tests/grid/mesh_3d_22.cc b/tests/grid/mesh_3d_22.cc index 77f94d2388..62480dfc1a 100644 --- a/tests/grid/mesh_3d_22.cc +++ b/tests/grid/mesh_3d_22.cc @@ -55,7 +55,8 @@ template class F : public Function { public: - F(const unsigned int q) : q(q) + F(const unsigned int q) + : q(q) {} virtual double @@ -90,8 +91,10 @@ test(Triangulation &triangulation) for (unsigned int q = 0; q <= p + 2; ++q) { // interpolate the function - VectorTools::interpolate( - mapping, dof_handler, F(q), interpolant); + VectorTools::interpolate(mapping, + dof_handler, + F(q), + interpolant); // then compute the interpolation error VectorTools::integrate_difference(mapping, diff --git a/tests/grid/mesh_3d_25.cc b/tests/grid/mesh_3d_25.cc index 6a96a2636f..07e50bb80e 100644 --- a/tests/grid/mesh_3d_25.cc +++ b/tests/grid/mesh_3d_25.cc @@ -51,7 +51,8 @@ template class F : public Function { public: - F(const unsigned int q) : q(q) + F(const unsigned int q) + : q(q) {} virtual double @@ -86,8 +87,10 @@ test(Triangulation &triangulation) for (unsigned int q = 0; q <= p + 2; ++q) { // interpolate the function - VectorTools::interpolate( - mapping, dof_handler, F(q), interpolant); + VectorTools::interpolate(mapping, + dof_handler, + F(q), + interpolant); // then compute the interpolation error VectorTools::integrate_difference(mapping, diff --git a/tests/grid/mesh_3d_26.cc b/tests/grid/mesh_3d_26.cc index 130111556d..649da576ff 100644 --- a/tests/grid/mesh_3d_26.cc +++ b/tests/grid/mesh_3d_26.cc @@ -51,7 +51,8 @@ template class F : public Function { public: - F(const unsigned int q) : q(q) + F(const unsigned int q) + : q(q) {} virtual double @@ -88,8 +89,10 @@ test(Triangulation &triangulation) for (unsigned int q = 0; q <= p + 2; ++q) { // interpolate the function - VectorTools::interpolate( - mapping, dof_handler, F(q), interpolant); + VectorTools::interpolate(mapping, + dof_handler, + F(q), + interpolant); // then compute the interpolation error VectorTools::integrate_difference(mapping, diff --git a/tests/grid/mesh_3d_7.cc b/tests/grid/mesh_3d_7.cc index e8a00cb330..1b8379059c 100644 --- a/tests/grid/mesh_3d_7.cc +++ b/tests/grid/mesh_3d_7.cc @@ -40,10 +40,12 @@ void check_this(Triangulation<3> &tria) { QTrapez<2> quadrature; FE_Q<3> fe(1); - FEFaceValues<3> fe_face_values1( - fe, quadrature, update_quadrature_points | update_JxW_values); - FEFaceValues<3> fe_face_values2( - fe, quadrature, update_quadrature_points | update_JxW_values); + FEFaceValues<3> fe_face_values1(fe, + quadrature, + update_quadrature_points | update_JxW_values); + FEFaceValues<3> fe_face_values2(fe, + quadrature, + update_quadrature_points | update_JxW_values); DoFHandler<3> dof_handler(tria); dof_handler.distribute_dofs(fe); diff --git a/tests/grid/mesh_smoothing_03.cc b/tests/grid/mesh_smoothing_03.cc index fae673492a..5e2887ae29 100644 --- a/tests/grid/mesh_smoothing_03.cc +++ b/tests/grid/mesh_smoothing_03.cc @@ -50,8 +50,10 @@ test() std::vector ref(2); ref[0] = 100; ref[1] = 3; - GridGenerator::subdivided_hyper_rectangle( - triangulation, ref, Point<2>(), Point<2>(100, 3)); + GridGenerator::subdivided_hyper_rectangle(triangulation, + ref, + Point<2>(), + Point<2>(100, 3)); // refine all cells at the lower // boundary. we then have 600 cells diff --git a/tests/grid/normal_vector_03.cc b/tests/grid/normal_vector_03.cc index e4fc61ac90..f4f46a1726 100644 --- a/tests/grid/normal_vector_03.cc +++ b/tests/grid/normal_vector_03.cc @@ -94,8 +94,9 @@ main() { 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 += + normals[v] * + linear_interpolator.shape_value(v, Point<2>(xi, eta)); } normal /= normal.norm(); diff --git a/tests/grid/refine_and_coarsen_01.cc b/tests/grid/refine_and_coarsen_01.cc index e4f3c64dd0..2db42cf406 100644 --- a/tests/grid/refine_and_coarsen_01.cc +++ b/tests/grid/refine_and_coarsen_01.cc @@ -49,8 +49,10 @@ check() deallog << "n_active_cells: " << tria.n_active_cells() << std::endl; - GridRefinement::refine_and_coarsen_fixed_fraction( - tria, estimated_error_per_cell, 0.25, 0); + GridRefinement::refine_and_coarsen_fixed_fraction(tria, + estimated_error_per_cell, + 0.25, + 0); tria.execute_coarsening_and_refinement(); deallog << "n_active_cells: " << tria.n_active_cells() << std::endl; diff --git a/tests/grid/subdomain_ids.cc b/tests/grid/subdomain_ids.cc index 6086b2d0a0..b9f8cc7cde 100644 --- a/tests/grid/subdomain_ids.cc +++ b/tests/grid/subdomain_ids.cc @@ -126,15 +126,16 @@ test() std::vector selected_dofs(dof_handler.n_dofs()); for (unsigned int subdomain = 0; subdomain < (1 << dim); ++subdomain) { - DoFTools::extract_subdomain_dofs( - dof_handler, subdomain, selected_dofs); - AssertThrow( - static_cast( - 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))); + DoFTools::extract_subdomain_dofs(dof_handler, + subdomain, + selected_dofs); + AssertThrow(static_cast(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; }; @@ -157,8 +158,9 @@ test() std::vector selected_dofs(dof_handler.n_dofs()); for (unsigned int subdomain = 0; subdomain < (1 << dim); ++subdomain) { - DoFTools::extract_subdomain_dofs( - dof_handler, subdomain, selected_dofs); + DoFTools::extract_subdomain_dofs(dof_handler, + subdomain, + selected_dofs); AssertThrow( static_cast( std::count(selected_dofs.begin(), selected_dofs.end(), true)) == diff --git a/tests/grid/vertex_as_face_07.cc b/tests/grid/vertex_as_face_07.cc index a892c955d8..ed580be102 100644 --- a/tests/grid/vertex_as_face_07.cc +++ b/tests/grid/vertex_as_face_07.cc @@ -82,10 +82,12 @@ test() dof_handler.distribute_dofs(fe_collection); deallog << "Coarse mesh:" << std::endl; - print_dofs( - dof_handler.begin_active()->face(0), 0, fe1.dofs_per_face); - print_dofs( - dof_handler.begin_active()->face(1), 0, fe1.dofs_per_face); + print_dofs(dof_handler.begin_active()->face(0), + 0, + fe1.dofs_per_face); + print_dofs(dof_handler.begin_active()->face(1), + 0, + fe1.dofs_per_face); tria.refine_global(2); { @@ -107,10 +109,12 @@ test() << ", active_fe_index=" << cell->active_fe_index() << std::endl; print_dofs(cell, cell->get_fe().dofs_per_cell); - print_dofs( - cell->face(0), cell->active_fe_index(), cell->get_fe().dofs_per_face); - print_dofs( - cell->face(1), cell->active_fe_index(), cell->get_fe().dofs_per_face); + print_dofs(cell->face(0), + cell->active_fe_index(), + cell->get_fe().dofs_per_face); + print_dofs(cell->face(1), + cell->active_fe_index(), + cell->get_fe().dofs_per_face); } } diff --git a/tests/hp/boundary_matrices.cc b/tests/hp/boundary_matrices.cc index 4a150b9cbc..05950c297f 100644 --- a/tests/hp/boundary_matrices.cc +++ b/tests/hp/boundary_matrices.cc @@ -54,7 +54,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(dim + 1) + MySquareFunction() + : Function(dim + 1) {} virtual double @@ -109,8 +110,10 @@ check() SparsityPattern sparsity(dof.n_boundary_dofs(function_map), dof.max_couplings_between_boundary_dofs()); - DoFTools::make_boundary_sparsity_pattern( - dof, function_map, dof_to_boundary_mapping, sparsity); + DoFTools::make_boundary_sparsity_pattern(dof, + function_map, + dof_to_boundary_mapping, + sparsity); sparsity.compress(); SparseMatrix matrix; diff --git a/tests/hp/boundary_matrices_hp.cc b/tests/hp/boundary_matrices_hp.cc index 9ce381134a..791824900b 100644 --- a/tests/hp/boundary_matrices_hp.cc +++ b/tests/hp/boundary_matrices_hp.cc @@ -56,7 +56,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(2 * dim + 1) + MySquareFunction() + : Function(2 * dim + 1) {} virtual double @@ -130,8 +131,10 @@ check() SparsityPattern sparsity(dof.n_boundary_dofs(function_map), dof.max_couplings_between_boundary_dofs()); - DoFTools::make_boundary_sparsity_pattern( - dof, function_map, dof_to_boundary_mapping, sparsity); + DoFTools::make_boundary_sparsity_pattern(dof, + function_map, + dof_to_boundary_mapping, + sparsity); sparsity.compress(); SparseMatrix matrix; diff --git a/tests/hp/compare_hp_vs_nonhp_01.cc b/tests/hp/compare_hp_vs_nonhp_01.cc index 3ca34b031d..0a15919668 100644 --- a/tests/hp/compare_hp_vs_nonhp_01.cc +++ b/tests/hp/compare_hp_vs_nonhp_01.cc @@ -69,7 +69,8 @@ ExactSolution::value(const Point &p, const unsigned int) const } template -ExactSolution::ExactSolution() : Function() +ExactSolution::ExactSolution() + : Function() {} @@ -106,7 +107,8 @@ namespace with_hp }; template - LaplaceProblem::LaplaceProblem() : dof_handler(triangulation) + LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) { fe.push_back(FE_Q(1)); quadrature.push_back(QGauss(2)); @@ -187,8 +189,9 @@ namespace with_hp 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_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); @@ -196,12 +199,18 @@ namespace with_hp std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, exact_solution, boundary_values); - VectorTools::interpolate_boundary_values( - dof_handler, 1, exact_solution, boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + exact_solution, + boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 1, + exact_solution, + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } template @@ -259,7 +268,9 @@ namespace without_hp }; template - LaplaceProblem::LaplaceProblem() : fe(1), dof_handler(triangulation) + LaplaceProblem::LaplaceProblem() + : fe(1) + , dof_handler(triangulation) {} template @@ -333,8 +344,9 @@ namespace without_hp 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_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); @@ -342,12 +354,18 @@ namespace without_hp std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, exact_solution, boundary_values); - VectorTools::interpolate_boundary_values( - dof_handler, 1, exact_solution, boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + exact_solution, + boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 1, + exact_solution, + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } template diff --git a/tests/hp/crash_09.cc b/tests/hp/crash_09.cc index 79687eacdb..9e0ee7850f 100644 --- a/tests/hp/crash_09.cc +++ b/tests/hp/crash_09.cc @@ -69,8 +69,10 @@ main() Triangulation<3> triangulation; std::vector subdivisions(3, 2); subdivisions[2] = 1; - GridGenerator::subdivided_hyper_rectangle( - triangulation, subdivisions, Point<3>(), Point<3>(2, 2, 1)); + GridGenerator::subdivided_hyper_rectangle(triangulation, + subdivisions, + Point<3>(), + Point<3>(2, 2, 1)); hp::FECollection<3> fe; fe.push_back(FE_Q<3>(1)); diff --git a/tests/hp/crash_11.cc b/tests/hp/crash_11.cc index 4dddb2ef95..d423ce34b7 100644 --- a/tests/hp/crash_11.cc +++ b/tests/hp/crash_11.cc @@ -69,8 +69,10 @@ main() Triangulation<3> triangulation; std::vector subdivisions(3, 2); subdivisions[2] = 1; - GridGenerator::subdivided_hyper_rectangle( - triangulation, subdivisions, Point<3>(), Point<3>(2, 2, 1)); + GridGenerator::subdivided_hyper_rectangle(triangulation, + subdivisions, + Point<3>(), + Point<3>(2, 2, 1)); hp::FECollection<3> fe; fe.push_back(FE_Q<3>(1)); diff --git a/tests/hp/crash_12.cc b/tests/hp/crash_12.cc index bdc735fa3d..5e14b40ccc 100644 --- a/tests/hp/crash_12.cc +++ b/tests/hp/crash_12.cc @@ -69,11 +69,11 @@ test() Triangulation triangulation; std::vector subdivisions(dim, 1); subdivisions[0] = 2; - GridGenerator::subdivided_hyper_rectangle( - triangulation, - subdivisions, - Point(), - (dim == 3 ? Point(2, 1, 1) : Point(2, 1))); + GridGenerator::subdivided_hyper_rectangle(triangulation, + subdivisions, + Point(), + (dim == 3 ? Point(2, 1, 1) : + Point(2, 1))); (++triangulation.begin_active())->set_refine_flag(); triangulation.execute_coarsening_and_refinement(); diff --git a/tests/hp/crash_17.cc b/tests/hp/crash_17.cc index ab410274ee..53cefa97ab 100644 --- a/tests/hp/crash_17.cc +++ b/tests/hp/crash_17.cc @@ -113,7 +113,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -135,7 +136,8 @@ RightHandSide::value(const Point &p, template -LaplaceProblem::LaplaceProblem() : dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) { for (unsigned int degree = 2; degree < 5; ++degree) { @@ -252,8 +254,9 @@ LaplaceProblem::assemble_system() 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -264,10 +267,14 @@ LaplaceProblem::assemble_system() hanging_node_constraints.condense(system_rhs); condense.stop(); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } template @@ -334,8 +341,9 @@ LaplaceProblem::estimate_smoothness( if (!((i == 0) && (j == 0) && (k == 0)) && (i * i + j * j + k * k < N * N)) { - k_vectors.push_back(Point( - numbers::PI * i, numbers::PI * j, numbers::PI * k)); + k_vectors.push_back(Point(numbers::PI * i, + numbers::PI * j, + numbers::PI * k)); k_vectors_magnitude.push_back(i * i + j * j + k * k); } @@ -469,8 +477,10 @@ LaplaceProblem::refine_grid() Vector 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); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); float max_smoothness = 0, min_smoothness = smoothness_indicators.linfty_norm(); @@ -528,8 +538,9 @@ LaplaceProblem::output_results(const unsigned int cycle) const estimate_smoothness(smoothness_indicators); Vector smoothness_field(dof_handler.n_dofs()); - DoFTools::distribute_cell_to_dof_vector( - dof_handler, smoothness_indicators, smoothness_field); + DoFTools::distribute_cell_to_dof_vector(dof_handler, + smoothness_indicators, + smoothness_field); Vector fe_indices(triangulation.n_active_cells()); { diff --git a/tests/hp/crash_18.cc b/tests/hp/crash_18.cc index ffb59b682e..9e147af5b2 100644 --- a/tests/hp/crash_18.cc +++ b/tests/hp/crash_18.cc @@ -116,7 +116,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -138,7 +139,8 @@ RightHandSide::value(const Point &p, template -LaplaceProblem::LaplaceProblem() : dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) { for (unsigned int degree = 2; degree < 5; ++degree) { @@ -257,8 +259,9 @@ LaplaceProblem::assemble_system() 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -269,10 +272,14 @@ LaplaceProblem::assemble_system() hanging_node_constraints.condense(system_rhs); condense.stop(); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } template @@ -339,8 +346,9 @@ LaplaceProblem::estimate_smoothness( if (!((i == 0) && (j == 0) && (k == 0)) && (i * i + j * j + k * k < N * N)) { - k_vectors.push_back(Point( - numbers::PI * i, numbers::PI * j, numbers::PI * k)); + k_vectors.push_back(Point(numbers::PI * i, + numbers::PI * j, + numbers::PI * k)); k_vectors_magnitude.push_back(i * i + j * j + k * k); } @@ -474,8 +482,10 @@ LaplaceProblem::refine_grid() Vector 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); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); float max_smoothness = 0, min_smoothness = smoothness_indicators.linfty_norm(); @@ -533,8 +543,9 @@ LaplaceProblem::output_results(const unsigned int cycle) const estimate_smoothness(smoothness_indicators); Vector smoothness_field(dof_handler.n_dofs()); - DoFTools::distribute_cell_to_dof_vector( - dof_handler, smoothness_indicators, smoothness_field); + DoFTools::distribute_cell_to_dof_vector(dof_handler, + smoothness_indicators, + smoothness_field); Vector fe_indices(triangulation.n_active_cells()); { diff --git a/tests/hp/crash_19.cc b/tests/hp/crash_19.cc index ee665783d8..22eea9c0b2 100644 --- a/tests/hp/crash_19.cc +++ b/tests/hp/crash_19.cc @@ -95,11 +95,15 @@ test() ExactSolution exact_solution; std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, exact_solution, boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + exact_solution, + boundary_values); if (dim == 1) - VectorTools::interpolate_boundary_values( - dof_handler, 1, exact_solution, boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 1, + exact_solution, + boundary_values); for (std::map::iterator i = boundary_values.begin(); diff --git a/tests/hp/crash_21.cc b/tests/hp/crash_21.cc index 7153edbc34..80dff84b35 100644 --- a/tests/hp/crash_21.cc +++ b/tests/hp/crash_21.cc @@ -83,7 +83,8 @@ namespace Step template - Problem::Problem() : dof_handler(triangulation) + Problem::Problem() + : dof_handler(triangulation) { GridGenerator::hyper_cube(triangulation); for (unsigned int degree = 1; degree <= 7; ++degree) diff --git a/tests/hp/distribute_dofs_linear_time.cc b/tests/hp/distribute_dofs_linear_time.cc index d612d2e14b..6e810f4325 100644 --- a/tests/hp/distribute_dofs_linear_time.cc +++ b/tests/hp/distribute_dofs_linear_time.cc @@ -150,9 +150,9 @@ public: template QuadraticTimeCircle::QuadraticTimeCircle( - const unsigned int n_global_refines) : - n_global_refines(n_global_refines), - dof_handler(triangulation) + const unsigned int n_global_refines) + : n_global_refines(n_global_refines) + , dof_handler(triangulation) { boundary_manifold = ladutenko_circle(triangulation); typename Triangulation::active_cell_iterator cell = triangulation diff --git a/tests/hp/face_domination_01.cc b/tests/hp/face_domination_01.cc index 6ac77b4032..99a0ed3181 100644 --- a/tests/hp/face_domination_01.cc +++ b/tests/hp/face_domination_01.cc @@ -64,8 +64,10 @@ main() Triangulation triangulation; std::vector subdivisions(dim, 1U); subdivisions[0] = 2; - GridGenerator::subdivided_hyper_rectangle( - triangulation, subdivisions, Point(0, 0), Point(2, 1)); + GridGenerator::subdivided_hyper_rectangle(triangulation, + subdivisions, + Point(0, 0), + Point(2, 1)); hp::FECollection fe_collection; fe_collection.push_back(FESystem(FE_Nothing(), 1)); diff --git a/tests/hp/face_domination_02.cc b/tests/hp/face_domination_02.cc index 8a00cc2792..a1105dae95 100644 --- a/tests/hp/face_domination_02.cc +++ b/tests/hp/face_domination_02.cc @@ -66,8 +66,10 @@ main() Triangulation triangulation; std::vector subdivisions(dim, 1U); subdivisions[0] = 2; - GridGenerator::subdivided_hyper_rectangle( - triangulation, subdivisions, Point(0, 0), Point(2, 1)); + GridGenerator::subdivided_hyper_rectangle(triangulation, + subdivisions, + Point(0, 0), + Point(2, 1)); hp::FECollection fe_collection; fe_collection.push_back(FESystem(FE_Q(1), 1, FE_Nothing(), 1)); diff --git a/tests/hp/face_domination_03.cc b/tests/hp/face_domination_03.cc index 397ef7691f..0fa10e6351 100644 --- a/tests/hp/face_domination_03.cc +++ b/tests/hp/face_domination_03.cc @@ -50,10 +50,10 @@ public: }; template -MixedFECollection::MixedFECollection() : - continuous_fe(FE_Q(1), dim), - discontinuous_fe(FE_DGQ(1), dim), - dof_handler(triangulation) +MixedFECollection::MixedFECollection() + : continuous_fe(FE_Q(1), dim) + , discontinuous_fe(FE_DGQ(1), dim) + , dof_handler(triangulation) {} template diff --git a/tests/hp/face_domination_04.cc b/tests/hp/face_domination_04.cc index 9f845c13c3..4b1ce3f5f2 100644 --- a/tests/hp/face_domination_04.cc +++ b/tests/hp/face_domination_04.cc @@ -65,8 +65,10 @@ main() Triangulation triangulation; std::vector subdivisions(dim, 1U); subdivisions[0] = 2; - GridGenerator::subdivided_hyper_rectangle( - triangulation, subdivisions, Point(0, 0), Point(2, 1)); + GridGenerator::subdivided_hyper_rectangle(triangulation, + subdivisions, + Point(0, 0), + Point(2, 1)); for (unsigned int i = 0; i < 2; ++i) { hp::FECollection fe_collection; diff --git a/tests/hp/fe_nothing_08.cc b/tests/hp/fe_nothing_08.cc index f99aa68698..ee66245275 100644 --- a/tests/hp/fe_nothing_08.cc +++ b/tests/hp/fe_nothing_08.cc @@ -71,8 +71,10 @@ test() deallog << dof_handler.n_dofs() << " dofs" << std::endl; std::map bv; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(1), bv); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(1), + bv); for (std::map::iterator p = bv.begin(); p != bv.end(); ++p) diff --git a/tests/hp/fe_nothing_09.cc b/tests/hp/fe_nothing_09.cc index 9e504738fd..33575702da 100644 --- a/tests/hp/fe_nothing_09.cc +++ b/tests/hp/fe_nothing_09.cc @@ -73,8 +73,10 @@ test() deallog << dof_handler.n_dofs() << " dofs" << std::endl; std::map bv; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(2), bv); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(2), + bv); for (std::map::iterator p = bv.begin(); p != bv.end(); ++p) diff --git a/tests/hp/fe_nothing_11.cc b/tests/hp/fe_nothing_11.cc index df1c4e157f..66d2eb64f2 100644 --- a/tests/hp/fe_nothing_11.cc +++ b/tests/hp/fe_nothing_11.cc @@ -73,8 +73,10 @@ test() deallog << dof_handler.n_dofs() << " dofs" << std::endl; std::map bv; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(4), bv); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(4), + bv); for (std::map::iterator p = bv.begin(); p != bv.end(); ++p) diff --git a/tests/hp/fe_nothing_18.cc b/tests/hp/fe_nothing_18.cc index 14a2966254..cd9cebd89d 100644 --- a/tests/hp/fe_nothing_18.cc +++ b/tests/hp/fe_nothing_18.cc @@ -149,7 +149,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function(dim) + BoundaryValues() + : Function(dim) {} virtual void @@ -194,9 +195,9 @@ public: }; template -ConstrainValues::ConstrainValues() : - Function(dim) /*pass down to the main class the number of components of - the function*/ +ConstrainValues::ConstrainValues() + : Function(dim) /*pass down to the main class the number of components of + the function*/ {} template @@ -232,29 +233,30 @@ ConstrainValues::vector_value_list( /* constructor*/ template -ElasticProblem::ElasticProblem() : - n_blocks(2), - n_components(dim * n_blocks), - first_u_comp(0), - first_lamda_comp(dim), - degree(1), - dofs_per_block(n_blocks), - dof_handler(triangulation), /*assotiate dof_handler to the triangulation */ +ElasticProblem::ElasticProblem() + : n_blocks(2) + , n_components(dim * n_blocks) + , first_u_comp(0) + , first_lamda_comp(dim) + , degree(1) + , dofs_per_block(n_blocks) + , dof_handler(triangulation) + , /*assotiate dof_handler to the triangulation */ elasticity_fe( FE_Q(degree), dim, // use dim FE_Q of a given degree to represent displacements FE_Nothing(), dim // zero extension of lagrange multipliers elsewhere in the domain - ), - elasticity_w_lagrange_fe(FE_Q(degree), - dim, - FE_Q(degree), - dim // same for lagrange multipliers - ), - u_fe(first_u_comp), - lamda_fe(first_lamda_comp), - id_of_lagrange_mult(1), - beta1(1.0) + ) + , elasticity_w_lagrange_fe(FE_Q(degree), + dim, + FE_Q(degree), + dim // same for lagrange multipliers + ) + , u_fe(first_u_comp) + , lamda_fe(first_lamda_comp) + , id_of_lagrange_mult(1) + , beta1(1.0) { fe.push_back(elasticity_fe); // FE index 0 fe.push_back(elasticity_w_lagrange_fe); // FE index 1 @@ -279,10 +281,12 @@ ElasticProblem::make_grid() { Triangulation triangulationL; Triangulation triangulationR; - GridGenerator::hyper_cube( - triangulationL, -1, 0); // create a square [-1,1]^d domain - GridGenerator::hyper_cube( - triangulationR, -1, 0); // create a square [-1,1]^d domain + GridGenerator::hyper_cube(triangulationL, + -1, + 0); // create a square [-1,1]^d domain + GridGenerator::hyper_cube(triangulationR, + -1, + 0); // create a square [-1,1]^d domain Point shift_vector; shift_vector[0] = 1.0; GridTools::shift(shift_vector, triangulationR); @@ -299,8 +303,9 @@ ElasticProblem::make_grid() i); } - GridGenerator::merge_triangulations( - triangulationL, triangulationR, triangulation); + GridGenerator::merge_triangulations(triangulationL, + triangulationR, + triangulation); // triangulation.refine_global (2); //refine twice globally before solving } diff --git a/tests/hp/fe_nothing_20.cc b/tests/hp/fe_nothing_20.cc index 376e3602af..a48d7b34a0 100644 --- a/tests/hp/fe_nothing_20.cc +++ b/tests/hp/fe_nothing_20.cc @@ -74,8 +74,9 @@ test() Vector solution(dof_handler.n_dofs()); - VectorTools::interpolate( - dof_handler, Functions::ZeroFunction(2 * dim + 1), solution); + VectorTools::interpolate(dof_handler, + Functions::ZeroFunction(2 * dim + 1), + solution); deallog << "l2_norm = " << solution.l2_norm() << std::endl; } diff --git a/tests/hp/fe_nothing_21.cc b/tests/hp/fe_nothing_21.cc index f94c873f3c..22fb268c4f 100644 --- a/tests/hp/fe_nothing_21.cc +++ b/tests/hp/fe_nothing_21.cc @@ -67,8 +67,9 @@ test() Vector solution(dof_handler.n_dofs()); - VectorTools::interpolate( - dof_handler, Functions::ZeroFunction(2), solution); + VectorTools::interpolate(dof_handler, + Functions::ZeroFunction(2), + solution); deallog << "l2_norm = " << solution.l2_norm() << std::endl; } diff --git a/tests/hp/flux_sparsity.cc b/tests/hp/flux_sparsity.cc index 7b1f68aacd..88848946de 100644 --- a/tests/hp/flux_sparsity.cc +++ b/tests/hp/flux_sparsity.cc @@ -69,8 +69,10 @@ check() Assert(false, ExcNotImplemented()); } - GridGenerator::subdivided_hyper_rectangle( - triangulation, subdivisions, p1, p2); + GridGenerator::subdivided_hyper_rectangle(triangulation, + subdivisions, + p1, + p2); // Create FE Collection and insert two FE objects // (RT0 - DGQ0 - Q1 ^ dim) and (Nothing - Nothing - Q2 ^ dim) @@ -115,8 +117,10 @@ check() face_coupling[c][d] = DoFTools::always; } - DoFTools::make_flux_sparsity_pattern( - dof_handler, dsp, cell_coupling, face_coupling); + DoFTools::make_flux_sparsity_pattern(dof_handler, + dsp, + cell_coupling, + face_coupling); dsp.compress(); // Print sparsity pattern diff --git a/tests/hp/flux_sparsity_02.cc b/tests/hp/flux_sparsity_02.cc index 8e20a81705..1d4f17c3e8 100644 --- a/tests/hp/flux_sparsity_02.cc +++ b/tests/hp/flux_sparsity_02.cc @@ -65,8 +65,10 @@ check() Assert(false, ExcNotImplemented()); } - GridGenerator::subdivided_hyper_rectangle( - triangulation, subdivisions, p1, p2); + GridGenerator::subdivided_hyper_rectangle(triangulation, + subdivisions, + p1, + p2); // Create FE Collection and insert two FE objects // DGQ0 and DGQ1 @@ -89,8 +91,10 @@ check() cell_coupling(0, 0) = DoFTools::always; face_coupling(0, 0) = DoFTools::always; - DoFTools::make_flux_sparsity_pattern( - dof_handler, dsp, cell_coupling, face_coupling); + DoFTools::make_flux_sparsity_pattern(dof_handler, + dsp, + cell_coupling, + face_coupling); dsp.compress(); // Print sparsity pattern, we expect that all dofs couple with each other. @@ -106,8 +110,10 @@ check() cell_coupling(0, 0) = DoFTools::always; face_coupling(0, 0) = DoFTools::none; - DoFTools::make_flux_sparsity_pattern( - dof_handler, dsp, cell_coupling, face_coupling); + DoFTools::make_flux_sparsity_pattern(dof_handler, + dsp, + cell_coupling, + face_coupling); dsp.compress(); // Print sparsity pattern, we expect no couplings across the face. @@ -123,8 +129,10 @@ check() cell_coupling(0, 0) = DoFTools::none; face_coupling(0, 0) = DoFTools::always; - DoFTools::make_flux_sparsity_pattern( - dof_handler, dsp, cell_coupling, face_coupling); + DoFTools::make_flux_sparsity_pattern(dof_handler, + dsp, + cell_coupling, + face_coupling); dsp.compress(); // Print sparsity pattern, we expect that all dofs couple with each other. @@ -140,8 +148,10 @@ check() cell_coupling(0, 0) = DoFTools::none; face_coupling(0, 0) = DoFTools::none; - DoFTools::make_flux_sparsity_pattern( - dof_handler, dsp, cell_coupling, face_coupling); + DoFTools::make_flux_sparsity_pattern(dof_handler, + dsp, + cell_coupling, + face_coupling); dsp.compress(); // Print sparsity pattern, we expect no couplings. diff --git a/tests/hp/get_interpolated_dof_values_02.cc b/tests/hp/get_interpolated_dof_values_02.cc index dd1cb7a4d0..3b33b69caf 100644 --- a/tests/hp/get_interpolated_dof_values_02.cc +++ b/tests/hp/get_interpolated_dof_values_02.cc @@ -86,8 +86,9 @@ test() // then do the same with the "correct", local fe_index Vector local2(cell->get_fe().dofs_per_cell); - cell->get_interpolated_dof_values( - solution, local2, cell->active_fe_index()); + cell->get_interpolated_dof_values(solution, + local2, + cell->active_fe_index()); // and do it a third time with the fe_index for a Q1 element Vector local3(fe[0].dofs_per_cell); diff --git a/tests/hp/hp_constraints_common.h b/tests/hp/hp_constraints_common.h index 5071c06992..069780e26f 100644 --- a/tests/hp/hp_constraints_common.h +++ b/tests/hp/hp_constraints_common.h @@ -424,13 +424,13 @@ test_interpolation_base(const hp::FECollection & fe, 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(QGauss(min_degree + 2)), - VectorTools::L2_norm); + VectorTools::integrate_difference(dof_handler, + interpolant_1, + test_function, + error, + hp::QCollection( + QGauss(min_degree + 2)), + VectorTools::L2_norm); Assert(error.l2_norm() < 1e-12 * interpolant_1.l2_norm(), ExcInternalError()); deallog << " Relative interpolation error before constraints: " diff --git a/tests/hp/hp_constraints_common_no_support.h b/tests/hp/hp_constraints_common_no_support.h index 32ed5c1929..20f22de363 100644 --- a/tests/hp/hp_constraints_common_no_support.h +++ b/tests/hp/hp_constraints_common_no_support.h @@ -424,13 +424,13 @@ test_interpolation_base(const hp::FECollection & fe, interpolant_1); // then compute the interpolation error - VectorTools::integrate_difference( - dof_handler, - interpolant_1, - test_function, - error, - hp::QCollection(QGauss(min_degree)), - VectorTools::L2_norm); + VectorTools::integrate_difference(dof_handler, + interpolant_1, + test_function, + error, + hp::QCollection( + QGauss(min_degree)), + VectorTools::L2_norm); Assert(error.l2_norm() < 1e-12 * interpolant_1.l2_norm(), ExcInternalError()); deallog << " Relative interpolation error before constraints: " diff --git a/tests/hp/hp_constraints_neither_dominate_01.cc b/tests/hp/hp_constraints_neither_dominate_01.cc index 3889c61f94..4b5a2619eb 100644 --- a/tests/hp/hp_constraints_neither_dominate_01.cc +++ b/tests/hp/hp_constraints_neither_dominate_01.cc @@ -84,8 +84,10 @@ test2cells(const unsigned int p1 = 2, const unsigned int p2 = 1) p2[0] = 1.0; std::vector repetitoins(dim, 1); repetitoins[0] = 2; - GridGenerator::subdivided_hyper_rectangle( - triangulation, repetitoins, p1, p2); + GridGenerator::subdivided_hyper_rectangle(triangulation, + repetitoins, + p1, + p2); } hp::DoFHandler dof_handler(triangulation); diff --git a/tests/hp/hp_constraints_neither_dominate_02.cc b/tests/hp/hp_constraints_neither_dominate_02.cc index 659378407e..fd8f68e8e5 100644 --- a/tests/hp/hp_constraints_neither_dominate_02.cc +++ b/tests/hp/hp_constraints_neither_dominate_02.cc @@ -114,8 +114,10 @@ test2cells(const FiniteElement &fe_0, p1[0] = -1.0; std::vector repetitoins(dim, 1); repetitoins[0] = 2; - GridGenerator::subdivided_hyper_rectangle( - triangulation, repetitoins, p1, p2); + GridGenerator::subdivided_hyper_rectangle(triangulation, + repetitoins, + p1, + p2); } hp::DoFHandler dof_handler(triangulation); @@ -287,8 +289,9 @@ test2cells(const FiniteElement &fe_0, } // sort - std::sort( - pairs_point_value.begin(), pairs_point_value.end(), less_than_key()); + std::sort(pairs_point_value.begin(), + pairs_point_value.end(), + less_than_key()); for (unsigned int p = 0; p < pairs_point_value.size(); p++) { const Point & pt = pairs_point_value[p].first; diff --git a/tests/hp/hp_q_hierarchical_constraints.cc b/tests/hp/hp_q_hierarchical_constraints.cc index 81d6f4f0f3..f22a53d986 100644 --- a/tests/hp/hp_q_hierarchical_constraints.cc +++ b/tests/hp/hp_q_hierarchical_constraints.cc @@ -38,15 +38,18 @@ test(const bool apply_constrains, const unsigned int hp) { Triangulation triangulationL; Triangulation triangulationR; - GridGenerator::hyper_cube( - triangulationL, -1, 0); // create a square [-1,0]^d domain - GridGenerator::hyper_cube( - triangulationR, -1, 0); // create a square [-1,0]^d domain + GridGenerator::hyper_cube(triangulationL, + -1, + 0); // create a square [-1,0]^d domain + GridGenerator::hyper_cube(triangulationR, + -1, + 0); // create a square [-1,0]^d domain Point shift_vector; shift_vector[0] = 1.0; GridTools::shift(shift_vector, triangulationR); - GridGenerator::merge_triangulations( - triangulationL, triangulationR, triangulation); + GridGenerator::merge_triangulations(triangulationL, + triangulationR, + triangulation); } hp::FECollection fe; diff --git a/tests/hp/integrate_difference_02.cc b/tests/hp/integrate_difference_02.cc index ab1257b8d8..214eb7082b 100644 --- a/tests/hp/integrate_difference_02.cc +++ b/tests/hp/integrate_difference_02.cc @@ -78,12 +78,12 @@ test() // interpolate a linear function Vector vec(dof_handler.n_dofs()); - VectorTools::interpolate( - dof_handler, - Functions::Monomial( - dim == 1 ? Point(1.) : - (dim == 2 ? Point(1., 0.) : Point(1., 0., 0.))), - vec); + VectorTools::interpolate(dof_handler, + Functions::Monomial( + dim == 1 ? Point(1.) : + (dim == 2 ? Point(1., 0.) : + Point(1., 0., 0.))), + vec); Vector diff(tria.n_active_cells()); diff --git a/tests/hp/integrate_difference_03.cc b/tests/hp/integrate_difference_03.cc index ec8cc332b3..92a093741d 100644 --- a/tests/hp/integrate_difference_03.cc +++ b/tests/hp/integrate_difference_03.cc @@ -89,10 +89,11 @@ test() // interpolate a linear function Vector vec(dof_handler.n_dofs()); - VectorTools::interpolate( - dof_handler, - VectorFunctionFromScalarFunctionObject(&f, 0, dim), - vec); + VectorTools::interpolate(dof_handler, + VectorFunctionFromScalarFunctionObject(&f, + 0, + dim), + vec); Vector diff(tria.n_active_cells()); diff --git a/tests/hp/interpolate_dgq_01.cc b/tests/hp/interpolate_dgq_01.cc index 0a001f0d70..5db994cff0 100644 --- a/tests/hp/interpolate_dgq_01.cc +++ b/tests/hp/interpolate_dgq_01.cc @@ -49,7 +49,8 @@ template class F : public Function { public: - F(const unsigned int q) : q(q) + F(const unsigned int q) + : q(q) {} virtual double @@ -91,13 +92,13 @@ test() VectorTools::interpolate(dof_handler, F(q), interpolant); // then compute the interpolation error - VectorTools::integrate_difference( - dof_handler, - interpolant, - F(q), - error, - hp::QCollection(QGauss(q + 2)), - VectorTools::L2_norm); + VectorTools::integrate_difference(dof_handler, + interpolant, + F(q), + error, + hp::QCollection( + QGauss(q + 2)), + VectorTools::L2_norm); if (q <= p) AssertThrow(error.l2_norm() < 1e-12 * interpolant.l2_norm(), ExcInternalError()); diff --git a/tests/hp/interpolate_dgq_02.cc b/tests/hp/interpolate_dgq_02.cc index d1caee7e8b..6fe4997034 100644 --- a/tests/hp/interpolate_dgq_02.cc +++ b/tests/hp/interpolate_dgq_02.cc @@ -50,7 +50,8 @@ template class F : public Function { public: - F(const unsigned int q) : q(q) + F(const unsigned int q) + : q(q) {} virtual double @@ -100,13 +101,13 @@ test() constraints.distribute(interpolant); // then compute the interpolation error - VectorTools::integrate_difference( - dof_handler, - interpolant, - F(q), - error, - hp::QCollection(QGauss(q + 2)), - VectorTools::L2_norm); + VectorTools::integrate_difference(dof_handler, + interpolant, + F(q), + error, + hp::QCollection( + QGauss(q + 2)), + VectorTools::L2_norm); if (q <= p) AssertThrow(error.l2_norm() < 1e-12 * interpolant.l2_norm(), ExcInternalError()); diff --git a/tests/hp/interpolate_nothing_01.cc b/tests/hp/interpolate_nothing_01.cc index 4e6aff48b8..3bdcee5b4b 100644 --- a/tests/hp/interpolate_nothing_01.cc +++ b/tests/hp/interpolate_nothing_01.cc @@ -67,10 +67,10 @@ test() Vector error(triangulation.n_active_cells()); // interpolate the function - VectorTools::interpolate( - dof_handler, - Functions::ZeroFunction(hp_fe[0].n_components()), - interpolant); + VectorTools::interpolate(dof_handler, + Functions::ZeroFunction( + hp_fe[0].n_components()), + interpolant); deallog << interpolant.l2_norm() << std::endl; } diff --git a/tests/hp/interpolate_nothing_02.cc b/tests/hp/interpolate_nothing_02.cc index d56e6847c0..cb374a1a87 100644 --- a/tests/hp/interpolate_nothing_02.cc +++ b/tests/hp/interpolate_nothing_02.cc @@ -105,14 +105,14 @@ private: // Constructor template diffusionMechanics::diffusionMechanics(const unsigned int mech_degree, - const unsigned int diff_degree) : - mech_degree(mech_degree), - diff_degree(diff_degree), - omega1_fe(FE_Q(mech_degree), dim, FE_Q(diff_degree), 1), - omega2_fe(FE_Q(mech_degree), dim, FE_Nothing(), 1), - dof_handler(triangulation), - quadrature_formula(3), - face_quadrature_formula(2) + const unsigned int diff_degree) + : mech_degree(mech_degree) + , diff_degree(diff_degree) + , omega1_fe(FE_Q(mech_degree), dim, FE_Q(diff_degree), 1) + , omega2_fe(FE_Q(mech_degree), dim, FE_Nothing(), 1) + , dof_handler(triangulation) + , quadrature_formula(3) + , face_quadrature_formula(2) { // Nodal Solution names for (unsigned int i = 0; i < dim; ++i) @@ -138,7 +138,8 @@ template class InitialConditions : public Function { public: - InitialConditions() : Function(totalDOF) + InitialConditions() + : Function(totalDOF) {} void vector_value(const Point &p, Vector &values) const diff --git a/tests/hp/interpolate_nothing_03.cc b/tests/hp/interpolate_nothing_03.cc index d0866cc4ad..23e4554bce 100644 --- a/tests/hp/interpolate_nothing_03.cc +++ b/tests/hp/interpolate_nothing_03.cc @@ -77,8 +77,9 @@ test() Vector interpolant(dof_handler.n_dofs()); // interpolate the function - VectorTools::interpolate( - dof_handler, Functions::ConstantFunction(3.14), interpolant); + VectorTools::interpolate(dof_handler, + Functions::ConstantFunction(3.14), + interpolant); deallog << interpolant.mean_value() << std::endl; } diff --git a/tests/hp/interpolate_q_01.cc b/tests/hp/interpolate_q_01.cc index 7288a3cd15..6247ce5965 100644 --- a/tests/hp/interpolate_q_01.cc +++ b/tests/hp/interpolate_q_01.cc @@ -49,7 +49,8 @@ template class F : public Function { public: - F(const unsigned int q) : q(q) + F(const unsigned int q) + : q(q) {} virtual double @@ -92,13 +93,13 @@ test() VectorTools::interpolate(dof_handler, F(q), interpolant); // then compute the interpolation error - VectorTools::integrate_difference( - dof_handler, - interpolant, - F(q), - error, - hp::QCollection(QGauss(q + 2)), - VectorTools::L2_norm); + VectorTools::integrate_difference(dof_handler, + interpolant, + F(q), + error, + hp::QCollection( + QGauss(q + 2)), + VectorTools::L2_norm); if (q <= p) AssertThrow(error.l2_norm() < 1e-12 * interpolant.l2_norm(), ExcInternalError()); diff --git a/tests/hp/interpolate_q_02.cc b/tests/hp/interpolate_q_02.cc index d6f0e4bcb1..791cff91c8 100644 --- a/tests/hp/interpolate_q_02.cc +++ b/tests/hp/interpolate_q_02.cc @@ -50,7 +50,8 @@ template class F : public Function { public: - F(const unsigned int q) : q(q) + F(const unsigned int q) + : q(q) {} virtual double @@ -100,13 +101,13 @@ test() constraints.distribute(interpolant); // then compute the interpolation error - VectorTools::integrate_difference( - dof_handler, - interpolant, - F(q), - error, - hp::QCollection(QGauss(q + 2)), - VectorTools::L2_norm); + VectorTools::integrate_difference(dof_handler, + interpolant, + F(q), + error, + hp::QCollection( + QGauss(q + 2)), + VectorTools::L2_norm); if (q <= p) AssertThrow(error.l2_norm() < 1e-12 * interpolant.l2_norm(), ExcInternalError()); diff --git a/tests/hp/interpolate_q_system_01.cc b/tests/hp/interpolate_q_system_01.cc index bcc82a0b4e..17c1ea72a4 100644 --- a/tests/hp/interpolate_q_system_01.cc +++ b/tests/hp/interpolate_q_system_01.cc @@ -50,7 +50,9 @@ template class F : public Function { public: - F(const unsigned int q) : Function(3), q(q) + F(const unsigned int q) + : Function(3) + , q(q) {} virtual void @@ -96,13 +98,13 @@ test() VectorTools::interpolate(dof_handler, F(q), interpolant); // then compute the interpolation error - VectorTools::integrate_difference( - dof_handler, - interpolant, - F(q), - error, - hp::QCollection(QGauss(q + 2)), - VectorTools::L2_norm); + VectorTools::integrate_difference(dof_handler, + interpolant, + F(q), + error, + hp::QCollection( + QGauss(q + 2)), + VectorTools::L2_norm); if (q <= p) Assert(error.l2_norm() < 1e-12 * interpolant.l2_norm(), ExcInternalError()); diff --git a/tests/hp/interpolate_q_system_02.cc b/tests/hp/interpolate_q_system_02.cc index efa7a19e69..4cc516fb9c 100644 --- a/tests/hp/interpolate_q_system_02.cc +++ b/tests/hp/interpolate_q_system_02.cc @@ -51,7 +51,9 @@ template class F : public Function { public: - F(const unsigned int q) : Function(3), q(q) + F(const unsigned int q) + : Function(3) + , q(q) {} virtual void @@ -105,13 +107,13 @@ test() constraints.distribute(interpolant); // then compute the interpolation error - VectorTools::integrate_difference( - dof_handler, - interpolant, - F(q), - error, - hp::QCollection(QGauss(q + 2)), - VectorTools::L2_norm); + VectorTools::integrate_difference(dof_handler, + interpolant, + F(q), + error, + hp::QCollection( + QGauss(q + 2)), + VectorTools::L2_norm); if (q <= p) Assert(error.l2_norm() < 1e-12 * interpolant.l2_norm(), ExcInternalError()); diff --git a/tests/hp/matrices.cc b/tests/hp/matrices.cc index 66ffa84684..32163b8275 100644 --- a/tests/hp/matrices.cc +++ b/tests/hp/matrices.cc @@ -53,7 +53,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(2) + MySquareFunction() + : Function(2) {} virtual double @@ -89,8 +90,10 @@ check_boundary(const hp::DoFHandler & dof, SparsityPattern sparsity(dof.n_boundary_dofs(function_map), dof.max_couplings_between_boundary_dofs()); - DoFTools::make_boundary_sparsity_pattern( - dof, function_map, dof_to_boundary_mapping, sparsity); + DoFTools::make_boundary_sparsity_pattern(dof, + function_map, + dof_to_boundary_mapping, + sparsity); sparsity.compress(); SparseMatrix matrix; diff --git a/tests/hp/matrices_hp.cc b/tests/hp/matrices_hp.cc index 761b4c1b16..5587fa7e03 100644 --- a/tests/hp/matrices_hp.cc +++ b/tests/hp/matrices_hp.cc @@ -51,7 +51,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(2) + MySquareFunction() + : Function(2) {} virtual double @@ -88,8 +89,10 @@ check_boundary(const hp::DoFHandler & dof, SparsityPattern sparsity(dof.n_boundary_dofs(function_map), dof.max_couplings_between_boundary_dofs()); - DoFTools::make_boundary_sparsity_pattern( - dof, function_map, dof_to_boundary_mapping, sparsity); + DoFTools::make_boundary_sparsity_pattern(dof, + function_map, + dof_to_boundary_mapping, + sparsity); sparsity.compress(); SparseMatrix matrix; diff --git a/tests/hp/n_boundary_dofs_02.cc b/tests/hp/n_boundary_dofs_02.cc index 0072f0769c..a5849f4c1a 100644 --- a/tests/hp/n_boundary_dofs_02.cc +++ b/tests/hp/n_boundary_dofs_02.cc @@ -51,8 +51,9 @@ test() GridGenerator::hyper_cube(triangulation_2, 2, 3); Triangulation<1, spacedim> triangulation; - GridGenerator::merge_triangulations( - triangulation_1, triangulation_2, triangulation); + GridGenerator::merge_triangulations(triangulation_1, + triangulation_2, + triangulation); hp::FECollection<1, spacedim> fe; diff --git a/tests/hp/n_boundary_dofs_03.cc b/tests/hp/n_boundary_dofs_03.cc index b768f3f158..c5edce9e3f 100644 --- a/tests/hp/n_boundary_dofs_03.cc +++ b/tests/hp/n_boundary_dofs_03.cc @@ -54,8 +54,9 @@ test() GridGenerator::hyper_cube(triangulation_2, 2, 3); Triangulation<1, spacedim> triangulation; - GridGenerator::merge_triangulations( - triangulation_1, triangulation_2, triangulation); + GridGenerator::merge_triangulations(triangulation_1, + triangulation_2, + triangulation); // assign boundary ids triangulation.begin()->face(0)->set_boundary_id(12); diff --git a/tests/hp/project_01.cc b/tests/hp/project_01.cc index 983f76a055..5b0f1bd6de 100644 --- a/tests/hp/project_01.cc +++ b/tests/hp/project_01.cc @@ -92,10 +92,10 @@ test() // somewhat small. it won't // be zero since we project // and do not interpolate - Assert( - std::fabs(v(cell->vertex_dof_index(i, 0, cell->active_fe_index())) - - F().value(cell->vertex(i))) < 1e-4, - ExcInternalError()); + Assert(std::fabs( + v(cell->vertex_dof_index(i, 0, cell->active_fe_index())) - + F().value(cell->vertex(i))) < 1e-4, + ExcInternalError()); deallog << cell->vertex(i) << ' ' << v(cell->vertex_dof_index(i, 0, cell->active_fe_index())) << std::endl; diff --git a/tests/hp/project_02.cc b/tests/hp/project_02.cc index 6fd11e876f..4366072672 100644 --- a/tests/hp/project_02.cc +++ b/tests/hp/project_02.cc @@ -95,10 +95,10 @@ test() // somewhat small. it won't // be zero since we project // and do not interpolate - Assert( - std::fabs(v(cell->vertex_dof_index(i, 0, cell->active_fe_index())) - - F().value(cell->vertex(i))) < 1e-4, - ExcInternalError()); + Assert(std::fabs( + v(cell->vertex_dof_index(i, 0, cell->active_fe_index())) - + F().value(cell->vertex(i))) < 1e-4, + ExcInternalError()); deallog << cell->vertex(i) << ' ' << v(cell->vertex_dof_index(i, 0, cell->active_fe_index())) << std::endl; diff --git a/tests/hp/q_vs_dgq.cc b/tests/hp/q_vs_dgq.cc index 1f6a05c62e..9a6832243b 100644 --- a/tests/hp/q_vs_dgq.cc +++ b/tests/hp/q_vs_dgq.cc @@ -52,7 +52,8 @@ namespace Step27 }; template - MixedFECollection::MixedFECollection() : dof_handler(triangulation) + MixedFECollection::MixedFECollection() + : dof_handler(triangulation) {} template diff --git a/tests/hp/renumber_block_wise_01b.cc b/tests/hp/renumber_block_wise_01b.cc index ab6f9b7108..4a51755f51 100644 --- a/tests/hp/renumber_block_wise_01b.cc +++ b/tests/hp/renumber_block_wise_01b.cc @@ -54,8 +54,10 @@ check() Triangulation tr; std::vector sub(3, 1U); sub[0] = 2; - GridGenerator::subdivided_hyper_rectangle( - tr, sub, Point(), Point(2, 1, 1)); + GridGenerator::subdivided_hyper_rectangle(tr, + sub, + Point(), + Point(2, 1, 1)); hp::FECollection fe_collection; fe_collection.push_back(FE_Q(2)); diff --git a/tests/hp/set_dof_values_by_interpolation_02.cc b/tests/hp/set_dof_values_by_interpolation_02.cc index f420518d70..1e68e2353a 100644 --- a/tests/hp/set_dof_values_by_interpolation_02.cc +++ b/tests/hp/set_dof_values_by_interpolation_02.cc @@ -93,8 +93,9 @@ test() cell->set_dof_values_by_interpolation(local, solution1); // then do the same with the "correct", local fe_index - cell->set_dof_values_by_interpolation( - local, solution2, cell->active_fe_index()); + cell->set_dof_values_by_interpolation(local, + solution2, + cell->active_fe_index()); // now verify correctness AssertThrow(solution1 == solution2, ExcInternalError()); diff --git a/tests/hp/solution_transfer.cc b/tests/hp/solution_transfer.cc index 34d6edd9fc..a5647b5a6b 100644 --- a/tests/hp/solution_transfer.cc +++ b/tests/hp/solution_transfer.cc @@ -51,7 +51,8 @@ template class MyFunction : public Function { public: - MyFunction() : Function(){}; + MyFunction() + : Function(){}; virtual double value(const Point &p, const unsigned int) const @@ -187,10 +188,11 @@ transfer(std::ostream &out) // on points of QGauss of order 2. MyFunction func; { - double error = 0; - const hp::QCollection quad(QGauss(2)); - hp::FEValues hp_fe_val( - fe_q, quad, update_values | update_quadrature_points); + double error = 0; + const hp::QCollection quad(QGauss(2)); + hp::FEValues hp_fe_val(fe_q, + quad, + update_values | update_quadrature_points); std::vector vals(quad[0].size()); typename hp::DoFHandler::active_cell_iterator cell = q_dof_handler .begin_active(), @@ -212,9 +214,10 @@ transfer(std::ostream &out) { double error = 0; const hp::QCollection quad(QGauss(2)); - hp::FEValues hp_fe_val( - fe_dgq, quad, update_values | update_quadrature_points); - std::vector vals(quad[0].size()); + hp::FEValues hp_fe_val(fe_dgq, + quad, + update_values | update_quadrature_points); + std::vector vals(quad[0].size()); typename hp::DoFHandler::active_cell_iterator celldg = dgq_dof_handler.begin_active(), endc = dgq_dof_handler.end(); diff --git a/tests/hp/solution_transfer_12.cc b/tests/hp/solution_transfer_12.cc index 644996da6a..7f27e0b202 100644 --- a/tests/hp/solution_transfer_12.cc +++ b/tests/hp/solution_transfer_12.cc @@ -55,7 +55,8 @@ template class MyFunction : public Function { public: - MyFunction() : Function(){}; + MyFunction() + : Function(){}; virtual double value(const Point &p, const unsigned int) const @@ -129,8 +130,9 @@ transfer(std::ostream &out) hp::QCollection quad; quad.push_back(QTrapez()); - hp::FEValues hp_fe_val( - fe_q, quad, update_values | update_quadrature_points); + hp::FEValues hp_fe_val(fe_q, + quad, + update_values | update_quadrature_points); std::vector local_dof_indices; typename hp::DoFHandler::active_cell_iterator cell = q_dof_handler .begin_active(), @@ -203,10 +205,11 @@ transfer(std::ostream &out) // check correctness by comparing the values // on points of QGauss of order 2. { - double error = 0; - const hp::QCollection quad(QGauss(2)); - hp::FEValues hp_fe_val( - fe_q, quad, update_values | update_quadrature_points); + double error = 0; + const hp::QCollection quad(QGauss(2)); + hp::FEValues hp_fe_val(fe_q, + quad, + update_values | update_quadrature_points); std::vector vals(quad[0].size()); typename hp::DoFHandler::active_cell_iterator cell = q_dof_handler .begin_active(), diff --git a/tests/hp/step-10.cc b/tests/hp/step-10.cc index c79d900b47..9723517b86 100644 --- a/tests/hp/step-10.cc +++ b/tests/hp/step-10.cc @@ -77,8 +77,9 @@ gnuplot_output() GridOutFlags::Gnuplot gnuplot_flags(false, 30); grid_out.set_flags(gnuplot_flags); - grid_out.write_gnuplot( - triangulation, deallog.get_file_stream(), &mapping); + grid_out.write_gnuplot(triangulation, + deallog.get_file_stream(), + &mapping); } deallog << std::endl; } @@ -110,8 +111,10 @@ compute_pi_by_area() hp::DoFHandler dof_handler(triangulation); - hp::FEValues x_fe_values( - mapping, dummy_fe, quadrature, update_JxW_values); + hp::FEValues x_fe_values(mapping, + dummy_fe, + quadrature, + update_JxW_values); ConvergenceTable table; @@ -174,9 +177,11 @@ compute_pi_by_perimeter() hp::DoFHandler dof_handler(triangulation); - hp::FEFaceValues x_fe_face_values( - mapping, fe, quadrature, update_JxW_values); - ConvergenceTable table; + hp::FEFaceValues x_fe_face_values(mapping, + fe, + quadrature, + update_JxW_values); + ConvergenceTable table; for (unsigned int refinement = 0; refinement < (degree != 4 ? 6 : 4); ++refinement, triangulation.refine_global(1)) diff --git a/tests/hp/step-11.cc b/tests/hp/step-11.cc index 357e994d49..c934f67dc4 100644 --- a/tests/hp/step-11.cc +++ b/tests/hp/step-11.cc @@ -89,10 +89,10 @@ private: template -LaplaceProblem::LaplaceProblem(const unsigned int mapping_degree) : - fe(FE_Q(1)), - dof_handler(triangulation), - mapping(MappingQ(mapping_degree)) +LaplaceProblem::LaplaceProblem(const unsigned int mapping_degree) + : fe(FE_Q(1)) + , dof_handler(triangulation) + , mapping(MappingQ(mapping_degree)) { deallog << "Using mapping with degree " << mapping_degree << ":" << std::endl << "============================" << std::endl; @@ -109,8 +109,9 @@ LaplaceProblem::setup_system() system_rhs.reinit(dof_handler.n_dofs()); std::vector boundary_dofs(dof_handler.n_dofs(), false); - DoFTools::extract_boundary_dofs( - dof_handler, std::vector(1, true), boundary_dofs); + DoFTools::extract_boundary_dofs(dof_handler, + std::vector(1, true), + boundary_dofs); const unsigned int first_boundary_dof = std::distance(boundary_dofs.begin(), @@ -142,17 +143,17 @@ LaplaceProblem::assemble_and_solve() 1. * (static_cast &>(mapping[0]).get_degree() + 1) / 2)), 2U); - MatrixTools::create_laplace_matrix( - mapping, - dof_handler, - hp::QCollection(QGauss(gauss_degree)), - system_matrix); - VectorTools::create_right_hand_side( - mapping, - dof_handler, - hp::QCollection(QGauss(gauss_degree)), - Functions::ConstantFunction(-2), - system_rhs); + MatrixTools::create_laplace_matrix(mapping, + dof_handler, + hp::QCollection( + QGauss(gauss_degree)), + system_matrix); + VectorTools::create_right_hand_side(mapping, + dof_handler, + hp::QCollection( + QGauss(gauss_degree)), + Functions::ConstantFunction(-2), + system_rhs); Vector tmp(system_rhs.size()); VectorTools::create_boundary_right_hand_side( mapping, @@ -169,14 +170,14 @@ LaplaceProblem::assemble_and_solve() mean_value_constraints.distribute(solution); Vector norm_per_cell(triangulation.n_active_cells()); - VectorTools::integrate_difference( - mapping, - dof_handler, - solution, - Functions::ZeroFunction(), - norm_per_cell, - hp::QCollection(QGauss(gauss_degree + 1)), - VectorTools::H1_seminorm); + VectorTools::integrate_difference(mapping, + dof_handler, + solution, + Functions::ZeroFunction(), + norm_per_cell, + hp::QCollection( + QGauss(gauss_degree + 1)), + VectorTools::H1_seminorm); const double norm = norm_per_cell.l2_norm(); output_table.add_value("cells", triangulation.n_active_cells()); diff --git a/tests/hp/step-12.cc b/tests/hp/step-12.cc index 4dcb45e7f9..67e875841a 100644 --- a/tests/hp/step-12.cc +++ b/tests/hp/step-12.cc @@ -179,10 +179,10 @@ private: template -DGTransportEquation::DGTransportEquation() : - beta_function(), - rhs_function(), - boundary_function() +DGTransportEquation::DGTransportEquation() + : beta_function() + , rhs_function() + , boundary_function() {} @@ -439,13 +439,13 @@ private: template -DGMethod::DGMethod() : - mapping(MappingQGeneric(1)), - fe(FE_DGQ(1)), - dof_handler(triangulation), - quadrature(QGauss(4)), - face_quadrature(QGauss(4)), - dg() +DGMethod::DGMethod() + : mapping(MappingQGeneric(1)) + , fe(FE_DGQ(1)) + , dof_handler(triangulation) + , quadrature(QGauss(4)) + , face_quadrature(QGauss(4)) + , dg() {} @@ -500,14 +500,22 @@ DGMethod::assemble_system1() hp::FEValues fe_v(mapping, fe, quadrature, update_flags); - hp::FEFaceValues fe_v_face( - mapping, fe, face_quadrature, face_update_flags); - hp::FESubfaceValues fe_v_subface( - mapping, fe, face_quadrature, face_update_flags); - hp::FEFaceValues fe_v_face_neighbor( - mapping, fe, face_quadrature, neighbor_face_update_flags); - hp::FESubfaceValues fe_v_subface_neighbor( - mapping, fe, face_quadrature, neighbor_face_update_flags); + hp::FEFaceValues fe_v_face(mapping, + fe, + face_quadrature, + face_update_flags); + hp::FESubfaceValues fe_v_subface(mapping, + fe, + face_quadrature, + face_update_flags); + hp::FEFaceValues fe_v_face_neighbor(mapping, + fe, + face_quadrature, + neighbor_face_update_flags); + hp::FESubfaceValues fe_v_subface_neighbor(mapping, + fe, + face_quadrature, + neighbor_face_update_flags); FullMatrix ui_vi_matrix(dofs_per_cell, dofs_per_cell); FullMatrix ue_vi_matrix(dofs_per_cell, dofs_per_cell); @@ -584,8 +592,9 @@ DGMethod::assemble_system1() 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)); + system_matrix.add(dofs[i], + dofs_neighbor[k], + ue_vi_matrix(i, k)); } } else @@ -621,8 +630,9 @@ DGMethod::assemble_system1() ExcInternalError()); fe_v_face.reinit(cell, face_no); - fe_v_subface_neighbor.reinit( - neighbor, neighbor_face_no, neighbor_subface_no); + fe_v_subface_neighbor.reinit(neighbor, + neighbor_face_no, + neighbor_subface_no); dg.assemble_face_term1(fe_v_face, fe_v_subface_neighbor, @@ -634,8 +644,9 @@ DGMethod::assemble_system1() 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)); + system_matrix.add(dofs[i], + dofs_neighbor[k], + ue_vi_matrix(i, k)); } } } @@ -668,13 +679,19 @@ DGMethod::assemble_system2() const UpdateFlags neighbor_face_update_flags = update_values; - hp::FEValues fe_v(mapping, fe, quadrature, update_flags); - hp::FEFaceValues fe_v_face( - mapping, fe, face_quadrature, face_update_flags); - hp::FESubfaceValues fe_v_subface( - mapping, fe, face_quadrature, face_update_flags); - hp::FEFaceValues fe_v_face_neighbor( - mapping, fe, face_quadrature, neighbor_face_update_flags); + hp::FEValues fe_v(mapping, fe, quadrature, update_flags); + hp::FEFaceValues fe_v_face(mapping, + fe, + face_quadrature, + face_update_flags); + hp::FESubfaceValues fe_v_subface(mapping, + fe, + face_quadrature, + face_update_flags); + hp::FEFaceValues fe_v_face_neighbor(mapping, + fe, + face_quadrature, + neighbor_face_update_flags); FullMatrix ui_vi_matrix(dofs_per_cell, dofs_per_cell); @@ -755,10 +772,12 @@ DGMethod::assemble_system2() 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[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)); @@ -792,10 +811,12 @@ DGMethod::assemble_system2() 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[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)); @@ -836,8 +857,10 @@ DGMethod::refine_grid() { Vector gradient_indicator(triangulation.n_active_cells()); - DerivativeApproximation::approximate_gradient( - mapping[0], dof_handler, solution2, gradient_indicator); + DerivativeApproximation::approximate_gradient(mapping[0], + dof_handler, + solution2, + gradient_indicator); typename hp::DoFHandler::active_cell_iterator cell = dof_handler .begin_active(), @@ -846,8 +869,10 @@ DGMethod::refine_grid() 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); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + gradient_indicator, + 0.3, + 0.1); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/hp/step-13.cc b/tests/hp/step-13.cc index 6602b46ab8..79f7337ee9 100644 --- a/tests/hp/step-13.cc +++ b/tests/hp/step-13.cc @@ -119,9 +119,9 @@ namespace Evaluation template PointValueEvaluation::PointValueEvaluation( const Point &evaluation_point, - TableHandler & results_table) : - evaluation_point(evaluation_point), - results_table(results_table) + TableHandler & results_table) + : evaluation_point(evaluation_point) + , results_table(results_table) {} @@ -179,9 +179,9 @@ namespace Evaluation template SolutionOutput::SolutionOutput( const std::string & output_name_base, - const DataOutBase::OutputFormat output_format) : - output_name_base(output_name_base), - output_format(output_format) + const DataOutBase::OutputFormat output_format) + : output_name_base(output_name_base) + , output_format(output_format) {} @@ -232,7 +232,8 @@ namespace LaplaceSolver template - Base::Base(Triangulation &coarse_grid) : triangulation(&coarse_grid) + Base::Base(Triangulation &coarse_grid) + : triangulation(&coarse_grid) {} @@ -302,12 +303,12 @@ namespace LaplaceSolver Solver::Solver(Triangulation & triangulation, const hp::FECollection &fe, const hp::QCollection & quadrature, - const Function & boundary_values) : - Base(triangulation), - fe(&fe), - quadrature(&quadrature), - dof_handler(triangulation), - boundary_values(&boundary_values) + const Function & boundary_values) + : Base(triangulation) + , fe(&fe) + , quadrature(&quadrature) + , dof_handler(triangulation) + , boundary_values(&boundary_values) {} @@ -357,8 +358,10 @@ namespace LaplaceSolver const unsigned int n_threads = MultithreadInfo::n_threads(); std::vector> - thread_ranges = Threads::split_range( - dof_handler.begin_active(), dof_handler.end(), n_threads); + thread_ranges = + Threads::split_range(dof_handler.begin_active(), + dof_handler.end(), + n_threads); Threads::Mutex mutex; Threads::ThreadGroup<> threads; @@ -374,15 +377,19 @@ namespace LaplaceSolver linear_system.hanging_node_constraints.condense(linear_system.rhs); std::map boundary_value_map; - VectorTools::interpolate_boundary_values( - dof_handler, 0, *boundary_values, boundary_value_map); + VectorTools::interpolate_boundary_values(dof_handler, + 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); + MatrixTools::apply_boundary_values(boundary_value_map, + linear_system.matrix, + solution, + linear_system.rhs); } @@ -394,8 +401,9 @@ namespace LaplaceSolver const typename hp::DoFHandler::active_cell_iterator &end_cell, Threads::Mutex & mutex) const { - hp::FEValues fe_values( - *fe, *quadrature, update_gradients | update_JxW_values); + hp::FEValues 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(); @@ -426,8 +434,9 @@ namespace LaplaceSolver Threads::Mutex::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)); + linear_system.matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); }; } @@ -499,10 +508,10 @@ namespace LaplaceSolver const hp::FECollection &fe, const hp::QCollection & quadrature, const Function & rhs_function, - const Function &boundary_values) : - Base(triangulation), - Solver(triangulation, fe, quadrature, boundary_values), - rhs_function(&rhs_function) + const Function & boundary_values) + : Base(triangulation) + , Solver(triangulation, fe, quadrature, boundary_values) + , rhs_function(&rhs_function) {} @@ -571,13 +580,13 @@ namespace LaplaceSolver const hp::FECollection &fe, const hp::QCollection & quadrature, const Function & rhs_function, - const Function & boundary_values) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - fe, - quadrature, - rhs_function, - boundary_values) + const Function & boundary_values) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + fe, + quadrature, + rhs_function, + boundary_values) {} @@ -612,13 +621,13 @@ namespace LaplaceSolver const hp::FECollection &fe, const hp::QCollection & quadrature, const Function &rhs_function, - const Function &boundary_values) : - Base(coarse_grid), - PrimalSolver(coarse_grid, - fe, - quadrature, - rhs_function, - boundary_values) + const Function &boundary_values) + : Base(coarse_grid) + , PrimalSolver(coarse_grid, + fe, + quadrature, + rhs_function, + boundary_values) {} @@ -634,8 +643,10 @@ namespace LaplaceSolver typename FunctionMap::type(), this->solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - *this->triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(*this->triangulation, + estimated_error_per_cell, + 0.3, + 0.03); this->triangulation->execute_coarsening_and_refinement(); } @@ -647,7 +658,8 @@ template class Solution : public Function { public: - Solution() : Function() + Solution() + : Function() {} virtual double @@ -673,7 +685,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -773,8 +786,9 @@ solve_problem(const std::string &solver_name) Evaluation::PointValueEvaluation postprocessor1(Point(0.5, 0.5), results_table); - Evaluation::SolutionOutput postprocessor2( - std::string("solution-") + solver_name, DataOutBase::gnuplot); + Evaluation::SolutionOutput postprocessor2(std::string("solution-") + + solver_name, + DataOutBase::gnuplot); std::list *> postprocessor_list; postprocessor_list.push_back(&postprocessor1); diff --git a/tests/hp/step-2.cc b/tests/hp/step-2.cc index 5bcff7e8a8..a92f939c39 100644 --- a/tests/hp/step-2.cc +++ b/tests/hp/step-2.cc @@ -82,8 +82,9 @@ 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(), 20); + SparsityPattern sparsity_pattern(dof_handler.n_dofs(), + dof_handler.n_dofs(), + 20); DoFTools::make_sparsity_pattern(dof_handler, sparsity_pattern); sparsity_pattern.compress(); diff --git a/tests/hp/step-27.cc b/tests/hp/step-27.cc index 73b24866d7..d46b96a2b5 100644 --- a/tests/hp/step-27.cc +++ b/tests/hp/step-27.cc @@ -117,7 +117,8 @@ namespace Step27 class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -145,9 +146,9 @@ namespace Step27 template - LaplaceProblem::LaplaceProblem() : - dof_handler(triangulation), - max_degree(dim <= 2 ? 7 : 5) + LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) + , max_degree(dim <= 2 ? 7 : 5) { for (unsigned int degree = 2; degree <= max_degree; ++degree) { @@ -163,8 +164,9 @@ namespace Step27 for (unsigned int i = 0; i < fe_collection.size(); i++) fourier_q_collection.push_back(quadrature); - fourier = std::make_shared>( - N, fe_collection, fourier_q_collection); + fourier = std::make_shared>(N, + fe_collection, + fourier_q_collection); resize(fourier_coefficients, N); } @@ -188,8 +190,10 @@ namespace Step27 constraints.clear(); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); @@ -323,8 +327,10 @@ namespace Step27 } { - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); float max_smoothness = *std::min_element(smoothness_indicators.begin(), smoothness_indicators.end()), @@ -608,12 +614,14 @@ namespace Step27 local_dof_values.reinit(cell->get_fe().dofs_per_cell); cell->get_dof_values(solution, local_dof_values); - fourier->calculate( - local_dof_values, cell->active_fe_index(), fourier_coefficients); + fourier->calculate(local_dof_values, + cell->active_fe_index(), + fourier_coefficients); std::pair, std::vector> res = - FESeries::process_coefficients( - fourier_coefficients, predicate_ind, VectorTools::Linfty_norm); + FESeries::process_coefficients(fourier_coefficients, + predicate_ind, + VectorTools::Linfty_norm); Assert(res.first.size() == res.second.size(), ExcInternalError()); diff --git a/tests/hp/step-3.cc b/tests/hp/step-3.cc index 198ddb7e28..8ecfacccc3 100644 --- a/tests/hp/step-3.cc +++ b/tests/hp/step-3.cc @@ -82,7 +82,9 @@ private: }; -LaplaceProblem::LaplaceProblem() : fe(FE_Q<2>(1)), dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : fe(FE_Q<2>(1)) + , dof_handler(triangulation) {} @@ -158,8 +160,9 @@ LaplaceProblem::assemble_system() 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_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); @@ -167,10 +170,14 @@ LaplaceProblem::assemble_system() std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction<2>(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction<2>(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/tests/hp/step-3a.cc b/tests/hp/step-3a.cc index 6f330a0af0..d465edf1bb 100644 --- a/tests/hp/step-3a.cc +++ b/tests/hp/step-3a.cc @@ -90,7 +90,8 @@ private: }; -LaplaceProblem::LaplaceProblem() : dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) {} @@ -197,8 +198,9 @@ LaplaceProblem::assemble_system() 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_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); @@ -209,10 +211,14 @@ LaplaceProblem::assemble_system() hanging_node_constraints.condense(system_rhs); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction<2>(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction<2>(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/tests/hp/step-3a_mapping_collection.cc b/tests/hp/step-3a_mapping_collection.cc index b741c654d2..8f23226fdc 100644 --- a/tests/hp/step-3a_mapping_collection.cc +++ b/tests/hp/step-3a_mapping_collection.cc @@ -91,7 +91,8 @@ private: }; -LaplaceProblem::LaplaceProblem() : dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) {} @@ -198,8 +199,9 @@ LaplaceProblem::assemble_system() 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_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); @@ -214,10 +216,14 @@ LaplaceProblem::assemble_system() std::map *> b_v_functions{ {types::boundary_id(0), &zero}}; - VectorTools::interpolate_boundary_values( - mappings, dof_handler, b_v_functions, boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(mappings, + dof_handler, + b_v_functions, + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/tests/hp/step-3b.cc b/tests/hp/step-3b.cc index 91c20e9e83..0cef28414b 100644 --- a/tests/hp/step-3b.cc +++ b/tests/hp/step-3b.cc @@ -90,7 +90,8 @@ private: }; -LaplaceProblem::LaplaceProblem() : dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) {} @@ -194,8 +195,9 @@ LaplaceProblem::assemble_system() 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_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); @@ -206,10 +208,14 @@ LaplaceProblem::assemble_system() hanging_node_constraints.condense(system_rhs); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction<2>(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction<2>(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/tests/hp/step-3c.cc b/tests/hp/step-3c.cc index 0663510961..0bd34409ee 100644 --- a/tests/hp/step-3c.cc +++ b/tests/hp/step-3c.cc @@ -87,7 +87,8 @@ private: }; -LaplaceProblem::LaplaceProblem() : dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) {} @@ -195,8 +196,9 @@ LaplaceProblem::assemble_system() 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_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); @@ -207,10 +209,14 @@ LaplaceProblem::assemble_system() hanging_node_constraints.condense(system_rhs); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction<2>(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction<2>(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/tests/hp/step-4.cc b/tests/hp/step-4.cc index a6e335562b..7d62497224 100644 --- a/tests/hp/step-4.cc +++ b/tests/hp/step-4.cc @@ -87,7 +87,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -100,7 +101,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -133,9 +135,9 @@ BoundaryValues::value(const Point &p, template -LaplaceProblem::LaplaceProblem() : - fe(FE_Q(1)), - dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : fe(FE_Q(1)) + , dof_handler(triangulation) {} @@ -222,8 +224,9 @@ LaplaceProblem::assemble_system() 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -231,10 +234,14 @@ LaplaceProblem::assemble_system() std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/tests/hp/step-5.cc b/tests/hp/step-5.cc index 5c83cf8693..17d2393719 100644 --- a/tests/hp/step-5.cc +++ b/tests/hp/step-5.cc @@ -87,7 +87,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -139,9 +140,9 @@ Coefficient::value_list(const std::vector> &points, template -LaplaceProblem::LaplaceProblem() : - fe(FE_Q(1)), - dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : fe(FE_Q(1)) + , dof_handler(triangulation) {} @@ -223,18 +224,23 @@ LaplaceProblem::assemble_system() 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_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 boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/tests/hp/step-6.cc b/tests/hp/step-6.cc index 2e621ed095..a1ebd8d816 100644 --- a/tests/hp/step-6.cc +++ b/tests/hp/step-6.cc @@ -97,7 +97,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -148,9 +149,9 @@ Coefficient::value_list(const std::vector> &points, template -LaplaceProblem::LaplaceProblem() : - dof_handler(triangulation), - fe(FE_Q(2)) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) + , fe(FE_Q(2)) {} @@ -245,8 +246,9 @@ LaplaceProblem::assemble_system() 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -256,10 +258,14 @@ LaplaceProblem::assemble_system() hanging_node_constraints.condense(system_rhs); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } @@ -293,8 +299,10 @@ LaplaceProblem::refine_grid() solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/hp/step-7.cc b/tests/hp/step-7.cc index 7789b4bb56..4f026c12eb 100644 --- a/tests/hp/step-7.cc +++ b/tests/hp/step-7.cc @@ -72,17 +72,13 @@ protected: 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)}; + 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)}; 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)}; + 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)}; template const double SolutionBase::width = 1. / 3.; @@ -93,7 +89,8 @@ template class Solution : public Function, protected SolutionBase { public: - Solution() : Function() + Solution() + : Function() {} virtual double @@ -145,7 +142,8 @@ template class RightHandSide : public Function, protected SolutionBase { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -228,10 +226,10 @@ private: template HelmholtzProblem::HelmholtzProblem(const hp::FECollection &fe, - const RefinementMode refinement_mode) : - dof_handler(triangulation), - fe(&fe), - refinement_mode(refinement_mode) + const RefinementMode refinement_mode) + : dof_handler(triangulation) + , fe(&fe) + , refinement_mode(refinement_mode) {} @@ -293,11 +291,12 @@ HelmholtzProblem::assemble_system() update_values | update_gradients | update_quadrature_points | update_JxW_values); - hp::FEFaceValues x_fe_face_values( - *fe, - face_quadrature_formula, - update_values | update_quadrature_points | update_normal_vectors | - update_JxW_values); + hp::FEFaceValues x_fe_face_values(*fe, + face_quadrature_formula, + update_values | + update_quadrature_points | + update_normal_vectors | + update_JxW_values); const RightHandSide right_hand_side; std::vector rhs_values(n_q_points); @@ -358,8 +357,9 @@ HelmholtzProblem::assemble_system() 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -369,10 +369,14 @@ HelmholtzProblem::assemble_system() hanging_node_constraints.condense(system_rhs); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Solution(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Solution(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/tests/hp/step-8.cc b/tests/hp/step-8.cc index b47e948bfe..c2f5214f96 100644 --- a/tests/hp/step-8.cc +++ b/tests/hp/step-8.cc @@ -110,7 +110,8 @@ public: template -RightHandSide::RightHandSide() : Function(dim) +RightHandSide::RightHandSide() + : Function(dim) {} @@ -158,9 +159,9 @@ RightHandSide::vector_value_list( template -ElasticProblem::ElasticProblem() : - dof_handler(triangulation), - fe(FESystem(FE_Q(1), dim)) +ElasticProblem::ElasticProblem() + : dof_handler(triangulation) + , fe(FESystem(FE_Q(1), dim)) {} @@ -288,8 +289,9 @@ ElasticProblem::assemble_system() 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_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -299,10 +301,14 @@ ElasticProblem::assemble_system() hanging_node_constraints.condense(system_rhs); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(dim), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(dim), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } @@ -337,8 +343,10 @@ ElasticProblem::refine_grid() solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/hp/vectors_boundary_rhs_01.cc b/tests/hp/vectors_boundary_rhs_01.cc index e58e7aa7b3..f527d756dc 100644 --- a/tests/hp/vectors_boundary_rhs_01.cc +++ b/tests/hp/vectors_boundary_rhs_01.cc @@ -53,7 +53,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(2) + MySquareFunction() + : Function(2) {} virtual double @@ -112,8 +113,10 @@ check() quadrature.push_back(QGauss(3)); Vector rhs(dof.n_dofs()); - VectorTools::create_boundary_right_hand_side( - dof, quadrature, MySquareFunction(), rhs); + VectorTools::create_boundary_right_hand_side(dof, + quadrature, + MySquareFunction(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/hp/vectors_boundary_rhs_02.cc b/tests/hp/vectors_boundary_rhs_02.cc index c71da47e98..7cba579893 100644 --- a/tests/hp/vectors_boundary_rhs_02.cc +++ b/tests/hp/vectors_boundary_rhs_02.cc @@ -54,7 +54,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(dim) + MySquareFunction() + : Function(dim) {} virtual double @@ -113,8 +114,10 @@ check() quadrature.push_back(QGauss(3)); Vector rhs(dof.n_dofs()); - VectorTools::create_boundary_right_hand_side( - dof, quadrature, MySquareFunction(), rhs); + VectorTools::create_boundary_right_hand_side(dof, + quadrature, + MySquareFunction(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/hp/vectors_boundary_rhs_03.cc b/tests/hp/vectors_boundary_rhs_03.cc index 74a530cecb..5f46c1b7fc 100644 --- a/tests/hp/vectors_boundary_rhs_03.cc +++ b/tests/hp/vectors_boundary_rhs_03.cc @@ -54,7 +54,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(1) + MySquareFunction() + : Function(1) {} virtual double @@ -112,8 +113,10 @@ check() quadrature.push_back(QGauss(3)); Vector rhs(dof.n_dofs()); - VectorTools::create_boundary_right_hand_side( - dof, quadrature, MySquareFunction(), rhs); + VectorTools::create_boundary_right_hand_side(dof, + quadrature, + MySquareFunction(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/hp/vectors_boundary_rhs_hp_01.cc b/tests/hp/vectors_boundary_rhs_hp_01.cc index d668eec054..f73a4b2d69 100644 --- a/tests/hp/vectors_boundary_rhs_hp_01.cc +++ b/tests/hp/vectors_boundary_rhs_hp_01.cc @@ -53,7 +53,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(2) + MySquareFunction() + : Function(2) {} virtual double @@ -119,8 +120,10 @@ check() quadrature.push_back(QGauss(3 + i)); Vector rhs(dof.n_dofs()); - VectorTools::create_boundary_right_hand_side( - dof, quadrature, MySquareFunction(), rhs); + VectorTools::create_boundary_right_hand_side(dof, + quadrature, + MySquareFunction(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/hp/vectors_boundary_rhs_hp_03.cc b/tests/hp/vectors_boundary_rhs_hp_03.cc index 15377887b2..bc59f7a1a8 100644 --- a/tests/hp/vectors_boundary_rhs_hp_03.cc +++ b/tests/hp/vectors_boundary_rhs_hp_03.cc @@ -54,7 +54,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(1) + MySquareFunction() + : Function(1) {} virtual double @@ -115,8 +116,10 @@ check() quadrature.push_back(QGauss(3 + i)); Vector rhs(dof.n_dofs()); - VectorTools::create_boundary_right_hand_side( - dof, quadrature, MySquareFunction(), rhs); + VectorTools::create_boundary_right_hand_side(dof, + quadrature, + MySquareFunction(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/hp/vectors_point_source_hp_01.cc b/tests/hp/vectors_point_source_hp_01.cc index ccebdbabee..16ff97bf12 100644 --- a/tests/hp/vectors_point_source_hp_01.cc +++ b/tests/hp/vectors_point_source_hp_01.cc @@ -89,8 +89,10 @@ check() mapping.push_back(MappingQ(i + 1)); Vector rhs(dof.n_dofs()); - VectorTools::create_point_source_vector( - mapping, dof, tr.begin()->center(), rhs); + VectorTools::create_point_source_vector(mapping, + dof, + tr.begin()->center(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/hp/vectors_rhs_01.cc b/tests/hp/vectors_rhs_01.cc index 9c0f0a30c9..fa6e454b43 100644 --- a/tests/hp/vectors_rhs_01.cc +++ b/tests/hp/vectors_rhs_01.cc @@ -53,7 +53,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(2) + MySquareFunction() + : Function(2) {} virtual double @@ -112,8 +113,10 @@ check() quadrature.push_back(QGauss(3)); Vector rhs(dof.n_dofs()); - VectorTools::create_right_hand_side( - dof, quadrature, MySquareFunction(), rhs); + VectorTools::create_right_hand_side(dof, + quadrature, + MySquareFunction(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/hp/vectors_rhs_02.cc b/tests/hp/vectors_rhs_02.cc index 232edbd657..cb4f79091a 100644 --- a/tests/hp/vectors_rhs_02.cc +++ b/tests/hp/vectors_rhs_02.cc @@ -53,7 +53,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(dim) + MySquareFunction() + : Function(dim) {} virtual double @@ -112,8 +113,10 @@ check() quadrature.push_back(QGauss(3)); Vector rhs(dof.n_dofs()); - VectorTools::create_right_hand_side( - dof, quadrature, MySquareFunction(), rhs); + VectorTools::create_right_hand_side(dof, + quadrature, + MySquareFunction(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/hp/vectors_rhs_03.cc b/tests/hp/vectors_rhs_03.cc index 98e62fd2da..a652bf183b 100644 --- a/tests/hp/vectors_rhs_03.cc +++ b/tests/hp/vectors_rhs_03.cc @@ -53,7 +53,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(1) + MySquareFunction() + : Function(1) {} virtual double @@ -111,8 +112,10 @@ check() quadrature.push_back(QGauss(3)); Vector rhs(dof.n_dofs()); - VectorTools::create_right_hand_side( - dof, quadrature, MySquareFunction(), rhs); + VectorTools::create_right_hand_side(dof, + quadrature, + MySquareFunction(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/hp/vectors_rhs_hp_01.cc b/tests/hp/vectors_rhs_hp_01.cc index b1388d26ec..f73b3a90dc 100644 --- a/tests/hp/vectors_rhs_hp_01.cc +++ b/tests/hp/vectors_rhs_hp_01.cc @@ -53,7 +53,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(2) + MySquareFunction() + : Function(2) {} virtual double @@ -119,8 +120,10 @@ check() quadrature.push_back(QGauss(3 + i)); Vector rhs(dof.n_dofs()); - VectorTools::create_right_hand_side( - dof, quadrature, MySquareFunction(), rhs); + VectorTools::create_right_hand_side(dof, + quadrature, + MySquareFunction(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/hp/vectors_rhs_hp_03.cc b/tests/hp/vectors_rhs_hp_03.cc index b6daddbfe6..ffb4ff9087 100644 --- a/tests/hp/vectors_rhs_hp_03.cc +++ b/tests/hp/vectors_rhs_hp_03.cc @@ -53,7 +53,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(1) + MySquareFunction() + : Function(1) {} virtual double @@ -114,8 +115,10 @@ check() quadrature.push_back(QGauss(3 + i)); Vector rhs(dof.n_dofs()); - VectorTools::create_right_hand_side( - dof, quadrature, MySquareFunction(), rhs); + VectorTools::create_right_hand_side(dof, + quadrature, + MySquareFunction(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/integrators/advection_01.cc b/tests/integrators/advection_01.cc index ffc795e1e2..44d11ab050 100644 --- a/tests/integrators/advection_01.cc +++ b/tests/integrators/advection_01.cc @@ -61,11 +61,11 @@ test_cell(const FEValuesBase &fev) u = 0.; u(i) = 1.; w = 0.; - fev.get_function_values( - u, - indices, - VectorSlice>>(uval), - true); + fev.get_function_values(u, + indices, + VectorSlice>>( + uval), + true); cell_residual(w, fev, make_slice(uval), vel); M.vmult(v, u); w.add(-1., v); @@ -120,11 +120,11 @@ test_boundary(const FEValuesBase &fev) u = 0.; u(i) = 1.; w = 0.; - fev.get_function_values( - u, - indices, - VectorSlice>>(uval), - true); + fev.get_function_values(u, + indices, + VectorSlice>>( + uval), + true); upwind_value_residual( w, fev, make_slice(uval), make_slice(null_val), vel); M.vmult(v, u); @@ -198,11 +198,11 @@ test_face(const FEValuesBase &fev1, const FEValuesBase &fev2) u1(i1) = 1.; w1 = 0.; w2 = 0.; - fev1.get_function_values( - u1, - indices1, - VectorSlice>>(u1val), - true); + fev1.get_function_values(u1, + indices1, + VectorSlice>>( + u1val), + true); upwind_face_residual( w1, w2, fev1, fev2, make_slice(u1val), make_slice(nullval), vel); M11.vmult(v1, u1); @@ -225,11 +225,11 @@ test_face(const FEValuesBase &fev1, const FEValuesBase &fev2) } w1 = 0.; w2 = 0.; - fev2.get_function_values( - u1, - indices2, - VectorSlice>>(u1val), - true); + fev2.get_function_values(u1, + indices2, + VectorSlice>>( + u1val), + true); upwind_face_residual( w1, w2, fev1, fev2, make_slice(nullval), make_slice(u1val), vel); M12.vmult(v1, u1); @@ -262,8 +262,9 @@ test_fe(Triangulation &tr, FiniteElement &fe) { deallog << fe.get_name() << std::endl << "cell matrix" << std::endl; QGauss quadrature(fe.tensor_degree()); - FEValues fev( - fe, quadrature, update_values | update_gradients | update_JxW_values); + FEValues fev(fe, + quadrature, + update_values | update_gradients | update_JxW_values); typename Triangulation::cell_iterator cell1 = tr.begin(1); fev.reinit(cell1); diff --git a/tests/integrators/assembler_simple_system_inhom_01.cc b/tests/integrators/assembler_simple_system_inhom_01.cc index 8fc626877b..fd233382fd 100644 --- a/tests/integrators/assembler_simple_system_inhom_01.cc +++ b/tests/integrators/assembler_simple_system_inhom_01.cc @@ -78,7 +78,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -104,7 +105,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -130,7 +132,8 @@ template class FluxBoundaryValues : public Function { public: - FluxBoundaryValues() : Function() + FluxBoundaryValues() + : Function() {} virtual double @@ -154,7 +157,8 @@ template class Advection : public TensorFunction<1, dim> { public: - Advection() : TensorFunction<1, dim>() + Advection() + : TensorFunction<1, dim>() {} virtual Tensor<1, dim> @@ -520,10 +524,10 @@ private: template MeshWorkerConstraintMatrixTest::MeshWorkerConstraintMatrixTest( - const FiniteElement &fe) : - mapping(), - dof_handler(triangulation), - fe(fe) + const FiniteElement &fe) + : mapping() + , dof_handler(triangulation) + , fe(fe) { GridGenerator::hyper_cube(this->triangulation, -1, 1); @@ -562,11 +566,15 @@ MeshWorkerConstraintMatrixTest::setup_system() std::string fe_name = fe.get_name(); std::size_t found = fe_name.find(str); if (found != std::string::npos) - DoFTools::make_flux_sparsity_pattern( - dof_handler, c_sparsity, constraints, false); + DoFTools::make_flux_sparsity_pattern(dof_handler, + c_sparsity, + constraints, + false); else - DoFTools::make_sparsity_pattern( - dof_handler, c_sparsity, constraints, false); + DoFTools::make_sparsity_pattern(dof_handler, + c_sparsity, + constraints, + false); sparsity_pattern.copy_from(c_sparsity); @@ -585,8 +593,9 @@ MeshWorkerConstraintMatrixTest::assemble_system_MeshWorker() MeshWorker::IntegrationInfoBox info_box; const unsigned int n_gauss_points = dof_handler.get_fe().degree + 1; - info_box.initialize_gauss_quadrature( - n_gauss_points, n_gauss_points, n_gauss_points); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points, + n_gauss_points); UpdateFlags update_flags = update_quadrature_points | update_values | update_gradients; @@ -620,8 +629,9 @@ MeshWorkerConstraintMatrixTest::assemble_MeshWorker() MeshWorker::IntegrationInfoBox info_box; const unsigned int n_gauss_points = dof_handler.get_fe().degree + 1; - info_box.initialize_gauss_quadrature( - n_gauss_points, n_gauss_points, n_gauss_points); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points, + n_gauss_points); UpdateFlags update_flags = update_quadrature_points | update_values | update_gradients; @@ -662,12 +672,15 @@ MeshWorkerConstraintMatrixTest::createInhomConstraints() { this->constraintsInhom.clear(); // boundary constraints - VectorTools::interpolate_boundary_values( - this->dof_handler, 0, BoundaryValues(), this->constraintsInhom); + VectorTools::interpolate_boundary_values(this->dof_handler, + 0, + BoundaryValues(), + this->constraintsInhom); // constraint of the origin std::map> support_points; - DoFTools::map_dofs_to_support_points( - this->mapping, this->dof_handler, support_points); + DoFTools::map_dofs_to_support_points(this->mapping, + this->dof_handler, + support_points); for (unsigned int dof_index = 0; dof_index < this->dof_handler.n_dofs(); ++dof_index) { diff --git a/tests/integrators/divergence_01.cc b/tests/integrators/divergence_01.cc index 3ba1bd106a..5df9cd73f7 100644 --- a/tests/integrators/divergence_01.cc +++ b/tests/integrators/divergence_01.cc @@ -177,10 +177,12 @@ test_fe(Triangulation &tr, FiniteElement &fv, FiniteElement &fs) deallog << fv.get_name() << " x " << fs.get_name() << std::endl << "cell matrix" << std::endl; QGauss quadrature(fv.tensor_degree() + 1); - FEValues fev( - fv, quadrature, update_values | update_gradients | update_JxW_values); - FEValues fes( - fs, quadrature, update_values | update_gradients | update_JxW_values); + FEValues fev(fv, + quadrature, + update_values | update_gradients | update_JxW_values); + FEValues fes(fs, + quadrature, + update_values | update_gradients | update_JxW_values); typename Triangulation::cell_iterator cell1 = tr.begin(1); fev.reinit(cell1); @@ -204,10 +206,12 @@ test_fe(Triangulation &tr, FiniteElement &fv, FiniteElement &fs) test_boundary(fev1, fes1); } - FEFaceValues fev2( - fv, face_quadrature, update_values | update_gradients | update_JxW_values); - FEFaceValues fes2( - fs, face_quadrature, update_values | update_gradients | update_JxW_values); + FEFaceValues fev2(fv, + face_quadrature, + update_values | update_gradients | update_JxW_values); + FEFaceValues fes2(fs, + face_quadrature, + update_values | update_gradients | update_JxW_values); typename Triangulation::cell_iterator cell2 = cell1->neighbor(1); deallog << "face_matrix " << 0 << std::endl; diff --git a/tests/integrators/elasticity_01.cc b/tests/integrators/elasticity_01.cc index 20980372b5..20cfaa40bf 100644 --- a/tests/integrators/elasticity_01.cc +++ b/tests/integrators/elasticity_01.cc @@ -102,11 +102,11 @@ test_boundary(const FEValuesBase &fev) u = 0.; u(i) = 1.; w = 0.; - fev.get_function_values( - u, - indices, - VectorSlice>>(uval), - true); + fev.get_function_values(u, + indices, + VectorSlice>>( + uval), + true); fev.get_function_gradients( u, indices, @@ -165,9 +165,9 @@ test_face(const FEValuesBase &fev1, const FEValuesBase &fev2) nullval(d, std::vector(fev2.n_quadrature_points, 0.)); std::vector>> u1grad( d, std::vector>(fev1.n_quadrature_points)), - nullgrad( - d, - std::vector>(fev2.n_quadrature_points, Tensor<1, dim>())); + nullgrad(d, + std::vector>(fev2.n_quadrature_points, + Tensor<1, dim>())); std::vector indices1(n1), indices2(n2); for (unsigned int i = 0; i < n1; ++i) @@ -183,11 +183,11 @@ test_face(const FEValuesBase &fev1, const FEValuesBase &fev2) u1(i1) = 1.; w1 = 0.; w2 = 0.; - fev1.get_function_values( - u1, - indices1, - VectorSlice>>(u1val), - true); + fev1.get_function_values(u1, + indices1, + VectorSlice>>( + u1val), + true); fev1.get_function_gradients( u1, indices1, @@ -210,11 +210,11 @@ test_face(const FEValuesBase &fev1, const FEValuesBase &fev2) w1 = 0.; w2 = 0.; - fev2.get_function_values( - u1, - indices2, - VectorSlice>>(u1val), - true); + fev2.get_function_values(u1, + indices2, + VectorSlice>>( + u1val), + true); fev2.get_function_gradients( u1, indices2, @@ -263,8 +263,9 @@ test_fe(Triangulation &tr, FiniteElement &fe) test_boundary(fef1); } - FEFaceValues fef2( - fe, face_quadrature, update_values | update_gradients | update_JxW_values); + FEFaceValues fef2(fe, + face_quadrature, + update_values | update_gradients | update_JxW_values); typename Triangulation::cell_iterator cell2 = cell1->neighbor(1); deallog << "face_matrix " << 0 << std::endl; diff --git a/tests/integrators/elasticity_02.cc b/tests/integrators/elasticity_02.cc index aa877d763f..656f336d58 100644 --- a/tests/integrators/elasticity_02.cc +++ b/tests/integrators/elasticity_02.cc @@ -60,11 +60,11 @@ test_boundary(const FEValuesBase &fev) u = 0.; u(i) = 1.; w = 0.; - fev.get_function_values( - u, - indices, - VectorSlice>>(uval), - true); + fev.get_function_values(u, + indices, + VectorSlice>>( + uval), + true); fev.get_function_gradients( u, indices, diff --git a/tests/integrators/grad_div_01.cc b/tests/integrators/grad_div_01.cc index 1fce41447b..6452942287 100644 --- a/tests/integrators/grad_div_01.cc +++ b/tests/integrators/grad_div_01.cc @@ -102,11 +102,11 @@ test_boundary(const FEValuesBase &fev) u = 0.; u(i) = 1.; w = 0.; - fev.get_function_values( - u, - indices, - VectorSlice>>(uval), - true); + fev.get_function_values(u, + indices, + VectorSlice>>( + uval), + true); fev.get_function_gradients( u, indices, @@ -165,9 +165,9 @@ test_face(const FEValuesBase &fev1, const FEValuesBase &fev2) nullval(d, std::vector(fev2.n_quadrature_points, 0.)); std::vector>> u1grad( d, std::vector>(fev1.n_quadrature_points)), - nullgrad( - d, - std::vector>(fev2.n_quadrature_points, Tensor<1, dim>())); + nullgrad(d, + std::vector>(fev2.n_quadrature_points, + Tensor<1, dim>())); std::vector indices1(n1), indices2(n2); for (unsigned int i = 0; i < n1; ++i) @@ -183,11 +183,11 @@ test_face(const FEValuesBase &fev1, const FEValuesBase &fev2) u1(i1) = 1.; w1 = 0.; w2 = 0.; - fev1.get_function_values( - u1, - indices1, - VectorSlice>>(u1val), - true); + fev1.get_function_values(u1, + indices1, + VectorSlice>>( + u1val), + true); fev1.get_function_gradients( u1, indices1, @@ -210,11 +210,11 @@ test_face(const FEValuesBase &fev1, const FEValuesBase &fev2) w1 = 0.; w2 = 0.; - fev2.get_function_values( - u1, - indices2, - VectorSlice>>(u1val), - true); + fev2.get_function_values(u1, + indices2, + VectorSlice>>( + u1val), + true); fev2.get_function_gradients( u1, indices2, @@ -263,8 +263,9 @@ test_fe(Triangulation &tr, FiniteElement &fe) test_boundary(fef1); } - FEFaceValues fef2( - fe, face_quadrature, update_values | update_gradients | update_JxW_values); + FEFaceValues fef2(fe, + face_quadrature, + update_values | update_gradients | update_JxW_values); typename Triangulation::cell_iterator cell2 = cell1->neighbor(1); deallog << "face_matrix " << 0 << std::endl; diff --git a/tests/integrators/laplacian_01.cc b/tests/integrators/laplacian_01.cc index e0a22fd0f9..2eb8a8cd53 100644 --- a/tests/integrators/laplacian_01.cc +++ b/tests/integrators/laplacian_01.cc @@ -108,11 +108,11 @@ test_boundary(const FEValuesBase &fev) u = 0.; u(i) = 1.; w = 0.; - fev.get_function_values( - u, - indices, - VectorSlice>>(uval), - true); + fev.get_function_values(u, + indices, + VectorSlice>>( + uval), + true); fev.get_function_gradients( u, indices, @@ -178,9 +178,9 @@ test_face(const FEValuesBase &fev1, const FEValuesBase &fev2) nullval(d, std::vector(fev2.n_quadrature_points, 0.)); std::vector>> u1grad( d, std::vector>(fev1.n_quadrature_points)), - nullgrad( - d, - std::vector>(fev2.n_quadrature_points, Tensor<1, dim>())); + nullgrad(d, + std::vector>(fev2.n_quadrature_points, + Tensor<1, dim>())); std::vector indices1(n1), indices2(n2); for (unsigned int i = 0; i < n1; ++i) @@ -196,11 +196,11 @@ test_face(const FEValuesBase &fev1, const FEValuesBase &fev2) u1(i1) = 1.; w1 = 0.; w2 = 0.; - fev1.get_function_values( - u1, - indices1, - VectorSlice>>(u1val), - true); + fev1.get_function_values(u1, + indices1, + VectorSlice>>( + u1val), + true); fev1.get_function_gradients( u1, indices1, @@ -243,11 +243,11 @@ test_face(const FEValuesBase &fev1, const FEValuesBase &fev2) w1 = 0.; w2 = 0.; - fev2.get_function_values( - u1, - indices2, - VectorSlice>>(u1val), - true); + fev2.get_function_values(u1, + indices2, + VectorSlice>>( + u1val), + true); fev2.get_function_gradients( u1, indices2, @@ -317,8 +317,9 @@ test_fe(Triangulation &tr, FiniteElement &fe) test_boundary(fef1); } - FEFaceValues fef2( - fe, face_quadrature, update_values | update_gradients | update_JxW_values); + FEFaceValues fef2(fe, + face_quadrature, + update_values | update_gradients | update_JxW_values); typename Triangulation::cell_iterator cell2 = cell1->neighbor(1); deallog << "face_matrix " << 0 << std::endl; diff --git a/tests/integrators/mesh_worker_02.cc b/tests/integrators/mesh_worker_02.cc index ff10bc8127..924e0538f7 100644 --- a/tests/integrators/mesh_worker_02.cc +++ b/tests/integrators/mesh_worker_02.cc @@ -161,8 +161,9 @@ assemble(const DoFHandler &dof_handler, SparseMatrix &matrix) MeshWorker::IntegrationInfoBox 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); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points, + n_gauss_points); info_box.initialize_update_flags(); UpdateFlags update_flags = update_values | update_gradients; info_box.add_update_flags(update_flags, true, true, true, true); @@ -200,8 +201,9 @@ assemble(const DoFHandler & dof_handler, MeshWorker::IntegrationInfoBox 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); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points, + n_gauss_points); info_box.initialize_update_flags(); UpdateFlags update_flags = update_values | update_gradients; info_box.add_update_flags(update_flags, true, true, true, true); diff --git a/tests/integrators/mesh_worker_03.cc b/tests/integrators/mesh_worker_03.cc index 5b31ddfebe..7c36460e58 100644 --- a/tests/integrators/mesh_worker_03.cc +++ b/tests/integrators/mesh_worker_03.cc @@ -159,8 +159,9 @@ assemble(const DoFHandler &dof_handler, SparseMatrix &matrix) MeshWorker::IntegrationInfoBox 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); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points, + n_gauss_points); info_box.initialize_update_flags(); UpdateFlags update_flags = update_values | update_gradients; info_box.add_update_flags(update_flags, true, true, true, true); @@ -198,8 +199,9 @@ assemble(const DoFHandler & dof_handler, MeshWorker::IntegrationInfoBox 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); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points, + n_gauss_points); info_box.initialize_update_flags(); UpdateFlags update_flags = update_values | update_gradients; info_box.add_update_flags(update_flags, true, true, true, true); diff --git a/tests/integrators/mesh_worker_1d_dg.cc b/tests/integrators/mesh_worker_1d_dg.cc index d5cae087bf..d7fbefc2f3 100644 --- a/tests/integrators/mesh_worker_1d_dg.cc +++ b/tests/integrators/mesh_worker_1d_dg.cc @@ -115,11 +115,12 @@ namespace Advection template - AdvectionProblem::AdvectionProblem() : - mapping(1), - wavespeed(1.0), - dof_handler(triangulation), - fe(FE_DGQ(0), 1), // p=0, and solving for a scalar + AdvectionProblem::AdvectionProblem() + : mapping(1) + , wavespeed(1.0) + , dof_handler(triangulation) + , fe(FE_DGQ(0), 1) + , // p=0, and solving for a scalar upos(0) {} @@ -219,8 +220,9 @@ namespace Advection MeshWorker::IntegrationInfoBox info_box; - info_box.initialize_gauss_quadrature( - n_gauss_points, n_gauss_points, n_gauss_points); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points, + n_gauss_points); info_box.initialize_update_flags(); UpdateFlags update_flags = diff --git a/tests/lac/block_matrices_04.cc b/tests/lac/block_matrices_04.cc index 5c6ac6b6c6..ed8d22b496 100644 --- a/tests/lac/block_matrices_04.cc +++ b/tests/lac/block_matrices_04.cc @@ -89,10 +89,10 @@ private: template LaplaceProblem::LaplaceProblem( - const unsigned int n_blocks) : - n_blocks(n_blocks), - fe(1), - dof_handler(triangulation) + const unsigned int n_blocks) + : n_blocks(n_blocks) + , fe(1) + , dof_handler(triangulation) { sparsity_pattern.reinit(n_blocks, n_blocks); } @@ -101,20 +101,20 @@ LaplaceProblem::LaplaceProblem( template <> LaplaceProblem, SparseMatrix, SparsityPattern>:: - LaplaceProblem(const unsigned int n_blocks) : - n_blocks(n_blocks), - fe(1), - dof_handler(triangulation) + LaplaceProblem(const unsigned int n_blocks) + : n_blocks(n_blocks) + , fe(1) + , dof_handler(triangulation) {} template <> LaplaceProblem, SparseMatrix, SparsityPattern>:: - LaplaceProblem(const unsigned int n_blocks) : - n_blocks(n_blocks), - fe(1), - dof_handler(triangulation) + LaplaceProblem(const unsigned int n_blocks) + : n_blocks(n_blocks) + , fe(1) + , dof_handler(triangulation) {} @@ -286,10 +286,10 @@ void LaplaceProblem::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(); @@ -324,8 +324,9 @@ LaplaceProblem::assemble_system() 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_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); @@ -339,8 +340,10 @@ LaplaceProblem::assemble_system() 0, Functions::ZeroFunction<2, typename VectorType::value_type>(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/tests/lac/block_vector_iterator.cc b/tests/lac/block_vector_iterator.cc index a9cbfef631..7158634ff2 100644 --- a/tests/lac/block_vector_iterator.cc +++ b/tests/lac/block_vector_iterator.cc @@ -176,11 +176,12 @@ test() deallog << "Check 6: " << (v1 == v2 ? "true" : "false") << std::endl; // check std::transform - std::transform( - v1.begin(), - v1.end(), - v2.begin(), - std::bind(std::multiplies(), std::placeholders::_1, 2.0)); + std::transform(v1.begin(), + v1.end(), + v2.begin(), + std::bind(std::multiplies(), + std::placeholders::_1, + 2.0)); v2 *= 1. / 2; deallog << "Check 7: " << (v1 == v2 ? "true" : "false") << std::endl; diff --git a/tests/lac/constrained_linear_operator_01.cc b/tests/lac/constrained_linear_operator_01.cc index 5a71ed7466..d1c94e1e98 100644 --- a/tests/lac/constrained_linear_operator_01.cc +++ b/tests/lac/constrained_linear_operator_01.cc @@ -94,7 +94,9 @@ private: template -Step6::Step6() : fe(2), dof_handler(triangulation) +Step6::Step6() + : fe(2) + , dof_handler(triangulation) {} @@ -112,8 +114,10 @@ Step6::setup_system() constraints.clear(); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ConstantFunction(1.), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ConstantFunction(1.), + constraints); constraints.close(); DynamicSparsityPattern dsp(dof_handler.n_dofs()); @@ -216,8 +220,10 @@ Step6::refine_grid() solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/lac/constraints_block_01.cc b/tests/lac/constraints_block_01.cc index d9109e3d2b..6d5b9515d3 100644 --- a/tests/lac/constraints_block_01.cc +++ b/tests/lac/constraints_block_01.cc @@ -149,8 +149,10 @@ main() std::vector dofs_per_block( 3, 0); // 3 blocks, count dofs: - DoFTools::count_dofs_per_component( - dh, dofs_per_block, false, block_component); + DoFTools::count_dofs_per_component(dh, + dofs_per_block, + false, + block_component); DoFRenumbering::component_wise(dh, block_component); diff --git a/tests/lac/constraints_c1.cc b/tests/lac/constraints_c1.cc index 715af36a6b..f0b2845206 100644 --- a/tests/lac/constraints_c1.cc +++ b/tests/lac/constraints_c1.cc @@ -118,8 +118,9 @@ setup_constraints(const DoFHandler &dof_handler) GeometryInfo::unit_normal_direction[other_face]; std::vector> rhs; - const unsigned int constrained = fe.face_to_cell_index( - (fvertex == 0) ? 2 : fe.dofs_per_face - 1, face); + 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) @@ -127,8 +128,9 @@ setup_constraints(const DoFHandler &dof_handler) 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])); + 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], diff --git a/tests/lac/constraints_hanging_nodes_bc.cc b/tests/lac/constraints_hanging_nodes_bc.cc index f24f731af9..8343e91eb9 100644 --- a/tests/lac/constraints_hanging_nodes_bc.cc +++ b/tests/lac/constraints_hanging_nodes_bc.cc @@ -103,8 +103,10 @@ test() << "Total number of constraints: " << correct_constraints.n_constraints() << std::endl; - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ConstantFunction(1.), library_constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ConstantFunction(1.), + library_constraints); library_constraints.close(); // the two constraint matrices should look the diff --git a/tests/lac/constraints_local_to_global.cc b/tests/lac/constraints_local_to_global.cc index c14ec2682b..2999035bf4 100644 --- a/tests/lac/constraints_local_to_global.cc +++ b/tests/lac/constraints_local_to_global.cc @@ -63,8 +63,10 @@ test() ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 1, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 1, + Functions::ZeroFunction(), + constraints); constraints.close(); SparsityPattern sparsity; @@ -95,10 +97,12 @@ test() else local_mat(i, j) = random_value(); cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - local_mat, local_dof_indices, sparse); - constraints.distribute_local_to_global( - local_mat, local_dof_indices, full); + constraints.distribute_local_to_global(local_mat, + local_dof_indices, + sparse); + constraints.distribute_local_to_global(local_mat, + local_dof_indices, + full); } // now check that the entries are indeed the diff --git a/tests/lac/constraints_local_to_global_chunk.cc b/tests/lac/constraints_local_to_global_chunk.cc index 936661febe..42a827d00f 100644 --- a/tests/lac/constraints_local_to_global_chunk.cc +++ b/tests/lac/constraints_local_to_global_chunk.cc @@ -65,8 +65,10 @@ test(unsigned int chunk_size) ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 1, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 1, + Functions::ZeroFunction(), + constraints); constraints.close(); SparsityPattern sparsity; @@ -99,10 +101,12 @@ test(unsigned int chunk_size) else local_mat(i, j) = random_value(); cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - local_mat, local_dof_indices, sparse); - constraints.distribute_local_to_global( - local_mat, local_dof_indices, chunk_sparse); + constraints.distribute_local_to_global(local_mat, + local_dof_indices, + sparse); + constraints.distribute_local_to_global(local_mat, + local_dof_indices, + chunk_sparse); } // now check that the entries are indeed the diff --git a/tests/lac/constraints_shift_01.cc b/tests/lac/constraints_shift_01.cc index 473429242e..05290fb09d 100644 --- a/tests/lac/constraints_shift_01.cc +++ b/tests/lac/constraints_shift_01.cc @@ -54,8 +54,9 @@ test() deallog << "Shifted constraints" << std::endl; constraints1.print(deallog.get_file_stream()); - constraints1.merge( - constraints2, ConstraintMatrix::no_conflicts_allowed, true); + constraints1.merge(constraints2, + ConstraintMatrix::no_conflicts_allowed, + true); deallog << "Shifted and merged constraints" << std::endl; constraints1.print(deallog.get_file_stream()); diff --git a/tests/lac/diagonal_matrix_02.cc b/tests/lac/diagonal_matrix_02.cc index d303359775..1ad2ba3bc7 100644 --- a/tests/lac/diagonal_matrix_02.cc +++ b/tests/lac/diagonal_matrix_02.cc @@ -73,8 +73,10 @@ test(const bool hanging_nodes = true) ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); deallog << "Testing " << dof.get_fe().get_name() << std::endl; @@ -88,12 +90,12 @@ test(const bool hanging_nodes = true) TrilinosWrappers::SparseMatrix sparse_matrix; { TrilinosWrappers::SparsityPattern csp(owned_set, MPI_COMM_WORLD); - DoFTools::make_sparsity_pattern( - dof, - csp, - constraints, - true, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(dof, + csp, + constraints, + true, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); csp.compress(); sparse_matrix.reinit(csp); } @@ -108,8 +110,9 @@ test(const bool hanging_nodes = true) { QGauss quadrature_formula(fe_degree + 1); - FEValues fe_values( - dof.get_fe(), quadrature_formula, update_gradients | update_JxW_values); + FEValues fe_values(dof.get_fe(), + quadrature_formula, + update_gradients | update_JxW_values); const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); @@ -135,10 +138,12 @@ test(const bool hanging_nodes = true) } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, diagonal_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + diagonal_matrix); } } sparse_matrix.compress(VectorOperation::add); diff --git a/tests/lac/filtered_matrix_06.cc b/tests/lac/filtered_matrix_06.cc index b6bfd10c2f..86a32f0017 100644 --- a/tests/lac/filtered_matrix_06.cc +++ b/tests/lac/filtered_matrix_06.cc @@ -131,8 +131,9 @@ check() Vector f(dof.n_dofs()); - SparsityPattern A_pattern( - dof.n_dofs(), dof.n_dofs(), dof.max_couplings_between_dofs()); + SparsityPattern A_pattern(dof.n_dofs(), + dof.n_dofs(), + dof.max_couplings_between_dofs()); DoFTools::make_sparsity_pattern(dof, A_pattern); A_pattern.compress(); diff --git a/tests/lac/inhomogeneous_constraints.cc b/tests/lac/inhomogeneous_constraints.cc index be56445549..c068889b1d 100644 --- a/tests/lac/inhomogeneous_constraints.cc +++ b/tests/lac/inhomogeneous_constraints.cc @@ -118,7 +118,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -142,7 +143,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -163,9 +165,9 @@ RightHandSide::value(const Point &p, template -LaplaceProblem::LaplaceProblem() : - dof_handler(triangulation), - max_degree(5) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) + , max_degree(5) { if (dim == 2) for (unsigned int degree = 2; degree <= max_degree; ++degree) @@ -218,8 +220,10 @@ LaplaceProblem::setup_system() { test_all_constraints.merge(hanging_nodes_only); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + boundary_values); std::map::const_iterator boundary_value = boundary_values.begin(); for (; boundary_value != boundary_values.end(); ++boundary_value) @@ -352,10 +356,14 @@ LaplaceProblem::assemble_reference() hanging_nodes_only.condense(reference_matrix, reference_rhs); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, reference_matrix, solution, reference_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + reference_matrix, + solution, + reference_rhs); deallog << " Reference matrix nonzeros: " << reference_matrix.n_nonzero_elements() << ", actually: " @@ -534,8 +542,10 @@ LaplaceProblem::postprocess() for (unsigned int i = 0; i < estimated_error_per_cell.size(); ++i) estimated_error_per_cell(i) = i; - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } @@ -674,8 +684,9 @@ LaplaceProblem::estimate_smoothness( if (!((i == 0) && (j == 0) && (k == 0)) && (i * i + j * j + k * k < N * N)) { - k_vectors.push_back(Point( - numbers::PI * i, numbers::PI * j, numbers::PI * k)); + k_vectors.push_back(Point(numbers::PI * i, + numbers::PI * j, + numbers::PI * k)); k_vectors_magnitude.push_back(i * i + j * j + k * k); } diff --git a/tests/lac/inhomogeneous_constraints_block.cc b/tests/lac/inhomogeneous_constraints_block.cc index 8d9533251a..c1266c1c82 100644 --- a/tests/lac/inhomogeneous_constraints_block.cc +++ b/tests/lac/inhomogeneous_constraints_block.cc @@ -97,7 +97,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -118,9 +119,9 @@ RightHandSide::value(const Point &p, template -AdvectionProblem::AdvectionProblem() : - dof_handler(triangulation), - fe(FE_Q(2), 2) +AdvectionProblem::AdvectionProblem() + : dof_handler(triangulation) + , fe(FE_Q(2), 2) {} @@ -326,8 +327,10 @@ AdvectionProblem::assemble_reference() std::map boundary_values; VectorTools::interpolate_boundary_values( dof_handler, 0, Functions::ConstantFunction(1., 2), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, reference_matrix, test_rhs, reference_rhs); + MatrixTools::apply_boundary_values(boundary_values, + reference_matrix, + test_rhs, + reference_rhs); } diff --git a/tests/lac/inhomogeneous_constraints_nonsymmetric.cc b/tests/lac/inhomogeneous_constraints_nonsymmetric.cc index aadaeb1224..c566a4ece0 100644 --- a/tests/lac/inhomogeneous_constraints_nonsymmetric.cc +++ b/tests/lac/inhomogeneous_constraints_nonsymmetric.cc @@ -96,7 +96,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -117,7 +118,9 @@ RightHandSide::value(const Point &p, template -AdvectionProblem::AdvectionProblem() : dof_handler(triangulation), fe(2) +AdvectionProblem::AdvectionProblem() + : dof_handler(triangulation) + , fe(2) {} @@ -146,8 +149,10 @@ AdvectionProblem::setup_system() // boundary function { std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, RightHandSide(), boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + RightHandSide(), + boundary_values); std::map::const_iterator boundary_value = boundary_values.begin(); for (; boundary_value != boundary_values.end(); ++boundary_value) @@ -281,10 +286,14 @@ AdvectionProblem::assemble_reference() // use some other rhs vector as dummy for // application of Dirichlet conditions std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, RightHandSide(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, reference_matrix, test_rhs, reference_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + RightHandSide(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + reference_matrix, + test_rhs, + reference_rhs); } diff --git a/tests/lac/inhomogeneous_constraints_vector.cc b/tests/lac/inhomogeneous_constraints_vector.cc index b38c50f5f4..1f92e58df8 100644 --- a/tests/lac/inhomogeneous_constraints_vector.cc +++ b/tests/lac/inhomogeneous_constraints_vector.cc @@ -88,7 +88,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -136,7 +137,9 @@ Coefficient::value_list(const std::vector> &points, template -LaplaceProblem::LaplaceProblem() : fe(1), dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : fe(1) + , dof_handler(triangulation) {} @@ -151,14 +154,18 @@ LaplaceProblem::setup_system() << std::endl; constraints.clear(); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ConstantFunction(1), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ConstantFunction(1), + constraints); constraints.close(); 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, constraints, false); + DoFTools::make_sparsity_pattern(dof_handler, + sparsity_pattern, + constraints, + false); sparsity_pattern.compress(); system_matrix.reinit(sparsity_pattern); @@ -231,8 +238,10 @@ LaplaceProblem::assemble_system() // 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); + constraints.distribute_local_to_global(cell_rhs, + local_dof_indices, + test, + cell_matrix); } // and compare whether we really got the diff --git a/tests/lac/la_vector_norms.cc b/tests/lac/la_vector_norms.cc index 8a9a9a710d..e76bc38ecc 100644 --- a/tests/lac/la_vector_norms.cc +++ b/tests/lac/la_vector_norms.cc @@ -91,10 +91,10 @@ check_complex_norms() acc * size * std::abs(value), ExcInternalError()); const number l2_norma = vec.l2_norm(); - AssertThrow( - std::abs(l2_norma - std::abs(value) * std::sqrt((number)size)) < - acc * std::sqrt((number)size) * std::abs(value), - ExcInternalError()); + AssertThrow(std::abs(l2_norma - + std::abs(value) * std::sqrt((number)size)) < + acc * std::sqrt((number)size) * std::abs(value), + ExcInternalError()); } } diff --git a/tests/lac/la_vector_output.cc b/tests/lac/la_vector_output.cc index ba8eb9c40e..05734a2d0b 100644 --- a/tests/lac/la_vector_output.cc +++ b/tests/lac/la_vector_output.cc @@ -70,9 +70,9 @@ test() } // Check the vector for (unsigned int i = 0; i < size; ++i) - AssertThrow( - std::abs(vec[i] - (double)i) < eps, - ExcMessage("Value in the vector has been changed by boost archive")); + AssertThrow(std::abs(vec[i] - (double)i) < eps, + ExcMessage( + "Value in the vector has been changed by boost archive")); } diff --git a/tests/lac/linear_operator_11.cc b/tests/lac/linear_operator_11.cc index 2e92438936..448395b45b 100644 --- a/tests/lac/linear_operator_11.cc +++ b/tests/lac/linear_operator_11.cc @@ -78,7 +78,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -91,7 +92,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -125,7 +127,9 @@ BoundaryValues::value(const Point &p, template -Step4::Step4() : fe(1), dof_handler(triangulation) +Step4::Step4() + : fe(1) + , dof_handler(triangulation) {} @@ -147,8 +151,10 @@ Step4::setup_system() constraints.clear(); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); diff --git a/tests/lac/linear_operator_12.cc b/tests/lac/linear_operator_12.cc index ab7eaecfaf..892d141435 100644 --- a/tests/lac/linear_operator_12.cc +++ b/tests/lac/linear_operator_12.cc @@ -86,7 +86,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -98,7 +99,8 @@ template class RightHandSideTwo : public Function { public: - RightHandSideTwo() : Function() + RightHandSideTwo() + : Function() {} virtual double @@ -111,7 +113,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -157,13 +160,13 @@ BoundaryValues::value(const Point &p, template -Step4::Step4() : - triangulation(MPI_COMM_WORLD, - typename Triangulation::MeshSmoothing( - Triangulation::smoothing_on_refinement | - Triangulation::smoothing_on_coarsening)), - fe(1), - dof_handler(triangulation) +Step4::Step4() + : triangulation(MPI_COMM_WORLD, + typename Triangulation::MeshSmoothing( + Triangulation::smoothing_on_refinement | + Triangulation::smoothing_on_coarsening)) + , fe(1) + , dof_handler(triangulation) {} @@ -185,8 +188,10 @@ Step4::setup_system() constraints.clear(); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs(); @@ -203,13 +208,17 @@ Step4::setup_system() MPI_COMM_WORLD, locally_relevant_dofs); - system_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, dsp, MPI_COMM_WORLD); + system_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + dsp, + MPI_COMM_WORLD); solution.reinit(locally_relevant_dofs, MPI_COMM_WORLD); - system_rhs.reinit( - locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD, true); + system_rhs.reinit(locally_owned_dofs, + locally_relevant_dofs, + MPI_COMM_WORLD, + true); } diff --git a/tests/lac/linear_operator_12a.cc b/tests/lac/linear_operator_12a.cc index b5781af2fc..82d9649313 100644 --- a/tests/lac/linear_operator_12a.cc +++ b/tests/lac/linear_operator_12a.cc @@ -87,7 +87,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -99,7 +100,8 @@ template class RightHandSideTwo : public Function { public: - RightHandSideTwo() : Function() + RightHandSideTwo() + : Function() {} virtual double @@ -112,7 +114,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -158,13 +161,13 @@ BoundaryValues::value(const Point &p, template -Step4::Step4() : - triangulation(MPI_COMM_WORLD, - typename Triangulation::MeshSmoothing( - Triangulation::smoothing_on_refinement | - Triangulation::smoothing_on_coarsening)), - fe(1), - dof_handler(triangulation) +Step4::Step4() + : triangulation(MPI_COMM_WORLD, + typename Triangulation::MeshSmoothing( + Triangulation::smoothing_on_refinement | + Triangulation::smoothing_on_coarsening)) + , fe(1) + , dof_handler(triangulation) {} @@ -186,8 +189,10 @@ Step4::setup_system() constraints.clear(); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs(); @@ -204,13 +209,17 @@ Step4::setup_system() MPI_COMM_WORLD, locally_relevant_dofs); - system_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, dsp, MPI_COMM_WORLD); + system_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + dsp, + MPI_COMM_WORLD); solution.reinit(locally_relevant_dofs, MPI_COMM_WORLD); - system_rhs.reinit( - locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD, true); + system_rhs.reinit(locally_owned_dofs, + locally_relevant_dofs, + MPI_COMM_WORLD, + true); } diff --git a/tests/lac/linear_operator_13.cc b/tests/lac/linear_operator_13.cc index 15fe9c1c44..8dc3e3ae91 100644 --- a/tests/lac/linear_operator_13.cc +++ b/tests/lac/linear_operator_13.cc @@ -95,8 +95,9 @@ build_matrix_vector(TrilinosWrappers::BlockSparseMatrix &matrix, vector.reinit(partitioning); // Assemble system: Mass matrix and constrant RHS vector - FEValues fe_values( - fe, quadrature_formula, update_values | update_JxW_values); + FEValues fe_values(fe, + quadrature_formula, + update_values | update_JxW_values); const unsigned int n_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); Vector cell_rhs(dofs_per_cell); @@ -219,19 +220,19 @@ evaluate_ops(const TrilinosWrappers::BlockSparseMatrix &matrix, // TrilinosWrappers::SparseMatrix::vmult out_lo_pyld = 0.0; const size_type o_local_size = out_lo_pyld.end() - out_lo_pyld.begin(); - AssertDimension( - o_local_size, - static_cast(lo_A.OperatorRangeMap().NumMyPoints())); - PayloadVectorType tril_out_lo_pyld( - View, - lo_A.OperatorRangeMap(), - const_cast(out_lo_pyld.begin()), - o_local_size, - 1); - const size_type b_local_size = b.end() - b.begin(); - AssertDimension( - b_local_size, - static_cast(lo_A.OperatorDomainMap().NumMyPoints())); + AssertDimension(o_local_size, + static_cast( + lo_A.OperatorRangeMap().NumMyPoints())); + PayloadVectorType tril_out_lo_pyld(View, + lo_A.OperatorRangeMap(), + const_cast( + out_lo_pyld.begin()), + o_local_size, + 1); + const size_type b_local_size = b.end() - b.begin(); + AssertDimension(b_local_size, + static_cast( + lo_A.OperatorDomainMap().NumMyPoints())); PayloadVectorType tril_b_pyld(View, lo_A.OperatorDomainMap(), const_cast(b.begin()), @@ -289,19 +290,19 @@ evaluate_ops(const TrilinosWrappers::BlockSparseMatrix &matrix, // Lastly we test functionality added by the Payload out_lo_pyld = 0.0; const size_type o_local_size = out_lo_pyld.end() - out_lo_pyld.begin(); - AssertDimension( - o_local_size, - static_cast(lo_A_T.OperatorRangeMap().NumMyPoints())); - PayloadVectorType tril_out_lo_pyld( - View, - lo_A_T.OperatorRangeMap(), - const_cast(out_lo_pyld.begin()), - o_local_size, - 1); - const size_type b_local_size = b.end() - b.begin(); - AssertDimension( - b_local_size, - static_cast(lo_A_T.OperatorDomainMap().NumMyPoints())); + AssertDimension(o_local_size, + static_cast( + lo_A_T.OperatorRangeMap().NumMyPoints())); + PayloadVectorType tril_out_lo_pyld(View, + lo_A_T.OperatorRangeMap(), + const_cast( + out_lo_pyld.begin()), + o_local_size, + 1); + const size_type b_local_size = b.end() - b.begin(); + AssertDimension(b_local_size, + static_cast( + lo_A_T.OperatorDomainMap().NumMyPoints())); PayloadVectorType tril_b_pyld(View, lo_A_T.OperatorDomainMap(), const_cast(b.begin()), @@ -366,16 +367,16 @@ evaluate_ops(const TrilinosWrappers::BlockSparseMatrix &matrix, const auto lo_A_T_x_lo_A = lo_A_T * lo_A; // Construct composite operator out_lo_pyld = 0.0; const size_type o_local_size = out_lo_pyld.end() - out_lo_pyld.begin(); - AssertDimension( - o_local_size, - static_cast(lo_A_T_x_lo_A.OperatorRangeMap().NumMyPoints())); - PayloadVectorType tril_out_lo_pyld( - View, - lo_A_T_x_lo_A.OperatorRangeMap(), - const_cast(out_lo_pyld.begin()), - o_local_size, - 1); - const size_type b_local_size = b.end() - b.begin(); + AssertDimension(o_local_size, + static_cast( + lo_A_T_x_lo_A.OperatorRangeMap().NumMyPoints())); + PayloadVectorType tril_out_lo_pyld(View, + lo_A_T_x_lo_A.OperatorRangeMap(), + const_cast( + out_lo_pyld.begin()), + o_local_size, + 1); + const size_type b_local_size = b.end() - b.begin(); AssertDimension(b_local_size, static_cast( lo_A_T_x_lo_A.OperatorDomainMap().NumMyPoints())); @@ -445,16 +446,16 @@ evaluate_ops(const TrilinosWrappers::BlockSparseMatrix &matrix, transpose_operator(lo_A * lo_A_T); // Construct composite operator out_lo_pyld = 0.0; const size_type o_local_size = out_lo_pyld.end() - out_lo_pyld.begin(); - AssertDimension( - o_local_size, - static_cast(lo_A_x_lo_A_T.OperatorRangeMap().NumMyPoints())); - PayloadVectorType tril_out_lo_pyld( - View, - lo_A_x_lo_A_T.OperatorRangeMap(), - const_cast(out_lo_pyld.begin()), - o_local_size, - 1); - const size_type b_local_size = b.end() - b.begin(); + AssertDimension(o_local_size, + static_cast( + lo_A_x_lo_A_T.OperatorRangeMap().NumMyPoints())); + PayloadVectorType tril_out_lo_pyld(View, + lo_A_x_lo_A_T.OperatorRangeMap(), + const_cast( + out_lo_pyld.begin()), + o_local_size, + 1); + const size_type b_local_size = b.end() - b.begin(); AssertDimension(b_local_size, static_cast( lo_A_x_lo_A_T.OperatorDomainMap().NumMyPoints())); diff --git a/tests/lac/linear_operator_14.cc b/tests/lac/linear_operator_14.cc index 3f553a85c7..47d08d8a14 100644 --- a/tests/lac/linear_operator_14.cc +++ b/tests/lac/linear_operator_14.cc @@ -102,13 +102,15 @@ build_matrix_vector(TrilinosWrappers::BlockSparseMatrix &matrix, locally_owned_dofs = dof_handler.locally_owned_dofs(); locally_owned_partitioning.push_back( locally_owned_dofs.get_view(0, dofs_per_block[0])); - locally_owned_partitioning.push_back(locally_owned_dofs.get_view( - dofs_per_block[0], dofs_per_block[0] + dofs_per_block[1])); + locally_owned_partitioning.push_back( + locally_owned_dofs.get_view(dofs_per_block[0], + dofs_per_block[0] + dofs_per_block[1])); DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs); locally_relevant_partitioning.push_back( locally_relevant_dofs.get_view(0, dofs_per_block[0])); - locally_relevant_partitioning.push_back(locally_relevant_dofs.get_view( - dofs_per_block[0], dofs_per_block[0] + dofs_per_block[1])); + locally_relevant_partitioning.push_back( + locally_relevant_dofs.get_view(dofs_per_block[0], + dofs_per_block[0] + dofs_per_block[1])); constraints.clear(); constraints.reinit(locally_relevant_dofs); @@ -122,13 +124,13 @@ build_matrix_vector(TrilinosWrappers::BlockSparseMatrix &matrix, locally_owned_partitioning, locally_relevant_partitioning, mpi_communicator); - DoFTools::make_sparsity_pattern( - dof_handler, - coupling, - dsp, - constraints, - false, - Utilities::MPI::this_mpi_process(mpi_communicator)); + DoFTools::make_sparsity_pattern(dof_handler, + coupling, + dsp, + constraints, + false, + Utilities::MPI::this_mpi_process( + mpi_communicator)); dsp.compress(); matrix.clear(); @@ -136,8 +138,9 @@ build_matrix_vector(TrilinosWrappers::BlockSparseMatrix &matrix, vector.reinit(locally_owned_partitioning, mpi_communicator); // Assemble system: Mass matrix and constrant RHS vector - FEValues fe_values( - fe, quadrature_formula, update_values | update_JxW_values); + FEValues fe_values(fe, + quadrature_formula, + update_values | update_JxW_values); const unsigned int n_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); Vector cell_rhs(dofs_per_cell); @@ -263,19 +266,19 @@ evaluate_ops(const TrilinosWrappers::BlockSparseMatrix &matrix, // TrilinosWrappers::SparseMatrix::vmult out_lo_pyld = 0.0; const size_type o_local_size = out_lo_pyld.end() - out_lo_pyld.begin(); - AssertDimension( - o_local_size, - static_cast(lo_A.OperatorRangeMap().NumMyPoints())); - PayloadVectorType tril_out_lo_pyld( - View, - lo_A.OperatorRangeMap(), - const_cast(out_lo_pyld.begin()), - o_local_size, - 1); - const size_type b_local_size = b.end() - b.begin(); - AssertDimension( - b_local_size, - static_cast(lo_A.OperatorDomainMap().NumMyPoints())); + AssertDimension(o_local_size, + static_cast( + lo_A.OperatorRangeMap().NumMyPoints())); + PayloadVectorType tril_out_lo_pyld(View, + lo_A.OperatorRangeMap(), + const_cast( + out_lo_pyld.begin()), + o_local_size, + 1); + const size_type b_local_size = b.end() - b.begin(); + AssertDimension(b_local_size, + static_cast( + lo_A.OperatorDomainMap().NumMyPoints())); PayloadVectorType tril_b_pyld(View, lo_A.OperatorDomainMap(), const_cast(b.begin()), @@ -333,19 +336,19 @@ evaluate_ops(const TrilinosWrappers::BlockSparseMatrix &matrix, // Lastly we test functionality added by the Payload out_lo_pyld = 0.0; const size_type o_local_size = out_lo_pyld.end() - out_lo_pyld.begin(); - AssertDimension( - o_local_size, - static_cast(lo_A_T.OperatorRangeMap().NumMyPoints())); - PayloadVectorType tril_out_lo_pyld( - View, - lo_A_T.OperatorRangeMap(), - const_cast(out_lo_pyld.begin()), - o_local_size, - 1); - const size_type b_local_size = b.end() - b.begin(); - AssertDimension( - b_local_size, - static_cast(lo_A_T.OperatorDomainMap().NumMyPoints())); + AssertDimension(o_local_size, + static_cast( + lo_A_T.OperatorRangeMap().NumMyPoints())); + PayloadVectorType tril_out_lo_pyld(View, + lo_A_T.OperatorRangeMap(), + const_cast( + out_lo_pyld.begin()), + o_local_size, + 1); + const size_type b_local_size = b.end() - b.begin(); + AssertDimension(b_local_size, + static_cast( + lo_A_T.OperatorDomainMap().NumMyPoints())); PayloadVectorType tril_b_pyld(View, lo_A_T.OperatorDomainMap(), const_cast(b.begin()), @@ -410,16 +413,16 @@ evaluate_ops(const TrilinosWrappers::BlockSparseMatrix &matrix, const auto lo_A_T_x_lo_A = lo_A_T * lo_A; // Construct composite operator out_lo_pyld = 0.0; const size_type o_local_size = out_lo_pyld.end() - out_lo_pyld.begin(); - AssertDimension( - o_local_size, - static_cast(lo_A_T_x_lo_A.OperatorRangeMap().NumMyPoints())); - PayloadVectorType tril_out_lo_pyld( - View, - lo_A_T_x_lo_A.OperatorRangeMap(), - const_cast(out_lo_pyld.begin()), - o_local_size, - 1); - const size_type b_local_size = b.end() - b.begin(); + AssertDimension(o_local_size, + static_cast( + lo_A_T_x_lo_A.OperatorRangeMap().NumMyPoints())); + PayloadVectorType tril_out_lo_pyld(View, + lo_A_T_x_lo_A.OperatorRangeMap(), + const_cast( + out_lo_pyld.begin()), + o_local_size, + 1); + const size_type b_local_size = b.end() - b.begin(); AssertDimension(b_local_size, static_cast( lo_A_T_x_lo_A.OperatorDomainMap().NumMyPoints())); @@ -489,16 +492,16 @@ evaluate_ops(const TrilinosWrappers::BlockSparseMatrix &matrix, transpose_operator(lo_A * lo_A_T); // Construct composite operator out_lo_pyld = 0.0; const size_type o_local_size = out_lo_pyld.end() - out_lo_pyld.begin(); - AssertDimension( - o_local_size, - static_cast(lo_A_x_lo_A_T.OperatorRangeMap().NumMyPoints())); - PayloadVectorType tril_out_lo_pyld( - View, - lo_A_x_lo_A_T.OperatorRangeMap(), - const_cast(out_lo_pyld.begin()), - o_local_size, - 1); - const size_type b_local_size = b.end() - b.begin(); + AssertDimension(o_local_size, + static_cast( + lo_A_x_lo_A_T.OperatorRangeMap().NumMyPoints())); + PayloadVectorType tril_out_lo_pyld(View, + lo_A_x_lo_A_T.OperatorRangeMap(), + const_cast( + out_lo_pyld.begin()), + o_local_size, + 1); + const size_type b_local_size = b.end() - b.begin(); AssertDimension(b_local_size, static_cast( lo_A_x_lo_A_T.OperatorDomainMap().NumMyPoints())); diff --git a/tests/lac/matrices_02.cc b/tests/lac/matrices_02.cc index 0af0a0101e..47889d45cd 100644 --- a/tests/lac/matrices_02.cc +++ b/tests/lac/matrices_02.cc @@ -48,7 +48,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(2) + MySquareFunction() + : Function(2) {} virtual double @@ -82,8 +83,10 @@ check_boundary(const DoFHandler &dof, const Mapping &mapping) SparsityPattern sparsity(dof.n_boundary_dofs(function_map), dof.max_couplings_between_boundary_dofs()); - DoFTools::make_boundary_sparsity_pattern( - dof, function_map, dof_to_boundary_mapping, sparsity); + DoFTools::make_boundary_sparsity_pattern(dof, + function_map, + dof_to_boundary_mapping, + sparsity); sparsity.compress(); SparseMatrix matrix; diff --git a/tests/lac/matrix_out.cc b/tests/lac/matrix_out.cc index 554a889cd4..09f5b8952b 100644 --- a/tests/lac/matrix_out.cc +++ b/tests/lac/matrix_out.cc @@ -56,8 +56,9 @@ main() sparse_matrix.set(i, j, static_cast(i - j)); MatrixOut matrix_out; - matrix_out.build_patches( - sparse_matrix, "sparse_matrix", MatrixOut::Options(true)); + matrix_out.build_patches(sparse_matrix, + "sparse_matrix", + MatrixOut::Options(true)); matrix_out.write_eps(logfile); }; @@ -71,8 +72,9 @@ main() (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)); + matrix_out.build_patches(full_matrix, + "collated_matrix", + MatrixOut::Options(false, 4)); matrix_out.write_gmv(logfile); }; } diff --git a/tests/lac/matrix_out_02.cc b/tests/lac/matrix_out_02.cc index 3a2771898e..be601755a9 100644 --- a/tests/lac/matrix_out_02.cc +++ b/tests/lac/matrix_out_02.cc @@ -53,8 +53,9 @@ main(int argc, char **argv) sparse_matrix.set(i, j, i + 3 * j); MatrixOut matrix_out; - matrix_out.build_patches( - sparse_matrix, "sparse_matrix", MatrixOut::Options(true, 1, true)); + matrix_out.build_patches(sparse_matrix, + "sparse_matrix", + MatrixOut::Options(true, 1, true)); matrix_out.write_gnuplot(logfile); } } diff --git a/tests/lac/precondition_chebyshev_01.cc b/tests/lac/precondition_chebyshev_01.cc index c70a8d6624..14caa3699b 100644 --- a/tests/lac/precondition_chebyshev_01.cc +++ b/tests/lac/precondition_chebyshev_01.cc @@ -28,8 +28,8 @@ class FullMatrixModified : public FullMatrix { public: - FullMatrixModified(unsigned int size1, unsigned int size2) : - FullMatrix(size1, size2) + FullMatrixModified(unsigned int size1, unsigned int size2) + : FullMatrix(size1, size2) {} double diff --git a/tests/lac/quickmatrix.h b/tests/lac/quickmatrix.h index 4bf354ed55..e2e240f675 100644 --- a/tests/lac/quickmatrix.h +++ b/tests/lac/quickmatrix.h @@ -30,9 +30,9 @@ protected: template -QuickMatrix::QuickMatrix(unsigned int nx, unsigned int ny) : - nx(nx), - ny(ny) +QuickMatrix::QuickMatrix(unsigned int nx, unsigned int ny) + : nx(nx) + , ny(ny) {} template diff --git a/tests/lac/schur_complement_01.cc b/tests/lac/schur_complement_01.cc index 12e445ae7e..5ca8c191c0 100644 --- a/tests/lac/schur_complement_01.cc +++ b/tests/lac/schur_complement_01.cc @@ -222,8 +222,9 @@ main() SolverCG> solver_S_approx(solver_control_S_approx); PreconditionJacobi> preconditioner_S_approx; preconditioner_S_approx.initialize(A.block(0, 0)); // Same space as S - const auto lo_S_inv_approx = inverse_operator( - lo_S_approx, solver_S_approx, preconditioner_S_approx); + const auto lo_S_inv_approx = inverse_operator(lo_S_approx, + solver_S_approx, + preconditioner_S_approx); // Setup outer solver: Exact inverse of Schur complement SolverControl solver_control_S(11, 1.0e-10, false, false); diff --git a/tests/lac/schur_complement_03.cc b/tests/lac/schur_complement_03.cc index 892d821ecf..74959d03d1 100644 --- a/tests/lac/schur_complement_03.cc +++ b/tests/lac/schur_complement_03.cc @@ -92,7 +92,8 @@ namespace Step22 class BoundaryValues : public Function { public: - BoundaryValues() : Function(dim + 1) + BoundaryValues() + : Function(dim + 1) {} virtual double value(const Point &p, const unsigned int component = 0) const; @@ -125,7 +126,8 @@ namespace Step22 class RightHandSide : public Function { public: - RightHandSide() : Function(dim + 1) + RightHandSide() + : Function(dim + 1) {} virtual double value(const Point &p, const unsigned int component = 0) const; @@ -151,11 +153,11 @@ namespace Step22 } template - StokesProblem::StokesProblem(const unsigned int degree) : - degree(degree), - triangulation(Triangulation::maximum_smoothing), - fe(FE_Q(degree + 1), dim, FE_Q(degree), 1), - dof_handler(triangulation) + StokesProblem::StokesProblem(const unsigned int degree) + : degree(degree) + , triangulation(Triangulation::maximum_smoothing) + , fe(FE_Q(degree + 1), dim, FE_Q(degree), 1) + , dof_handler(triangulation) {} template @@ -180,8 +182,9 @@ namespace Step22 } constraints.close(); std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block( - dof_handler, dofs_per_block, block_component); + DoFTools::count_dofs_per_block(dof_handler, + dofs_per_block, + block_component); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; deallog << " Number of active cells: " << triangulation.n_active_cells() << std::endl @@ -295,28 +298,31 @@ namespace Step22 SparseILU preconditioner_A; preconditioner_A.initialize(system_matrix.block(0, 0), SparseILU::AdditionalData()); - ReductionControl solver_control_A( - system_matrix.block(0, 0).m(), 1e-10, 1e-6); - SolverCG<> solver_A(solver_control_A); - const auto A_inv = inverse_operator(A, solver_A, preconditioner_A); + ReductionControl solver_control_A(system_matrix.block(0, 0).m(), + 1e-10, + 1e-6); + SolverCG<> solver_A(solver_control_A); + const auto A_inv = inverse_operator(A, solver_A, preconditioner_A); // Inverse of mass matrix stored in block "D" SparseILU preconditioner_M; preconditioner_M.initialize(system_matrix.block(1, 1), SparseILU::AdditionalData()); - ReductionControl solver_control_M( - system_matrix.block(1, 1).m(), 1e-10, 1e-6); - SolverCG<> solver_M(solver_control_M); - const auto M_inv = inverse_operator(M, solver_M, preconditioner_M); + ReductionControl solver_control_M(system_matrix.block(1, 1).m(), + 1e-10, + 1e-6); + SolverCG<> solver_M(solver_control_M); + const auto M_inv = inverse_operator(M, solver_M, preconditioner_M); // Schur complement const auto S = schur_complement(A_inv, B, C, D0); // Inverse of Schur complement - ReductionControl solver_control_S( - system_matrix.block(1, 1).m(), 1e-10, 1e-6); - SolverCG<> solver_S(solver_control_S); - const auto S_inv = inverse_operator(S, solver_S, M_inv); + ReductionControl solver_control_S(system_matrix.block(1, 1).m(), + 1e-10, + 1e-6); + SolverCG<> solver_S(solver_control_S); + const auto S_inv = inverse_operator(S, solver_S, M_inv); Vector & x = solution.block(0); Vector & y = solution.block(1); @@ -344,8 +350,10 @@ namespace Step22 solution, estimated_error_per_cell, fe.component_mask(pressure)); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.0); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.0); triangulation.execute_coarsening_and_refinement(); } @@ -360,8 +368,10 @@ namespace Step22 (dim == 2 ? Point(-2, -1) : Point(-2, 0, -1)); const Point top_right = (dim == 2 ? Point(2, 0) : Point(2, 1, 0)); - GridGenerator::subdivided_hyper_rectangle( - triangulation, subdivisions, bottom_left, top_right); + GridGenerator::subdivided_hyper_rectangle(triangulation, + subdivisions, + bottom_left, + top_right); } for (typename Triangulation::active_cell_iterator cell = triangulation.begin_active(); diff --git a/tests/lac/solver_monitor.cc b/tests/lac/solver_monitor.cc index 4331527ac6..bae5a29bc2 100644 --- a/tests/lac/solver_monitor.cc +++ b/tests/lac/solver_monitor.cc @@ -95,8 +95,9 @@ main() cg.connect(&monitor_norm); cg.connect(&monitor_mean); - SolverGMRES<> gmres( - control, mem, SolverGMRES<>::AdditionalData(/*max_vecs=*/8)); + SolverGMRES<> gmres(control, + mem, + SolverGMRES<>::AdditionalData(/*max_vecs=*/8)); gmres.connect(&monitor_norm); gmres.connect(&monitor_mean); diff --git a/tests/lac/solver_signals.cc b/tests/lac/solver_signals.cc index 30bff190d1..87ad383f6c 100644 --- a/tests/lac/solver_signals.cc +++ b/tests/lac/solver_signals.cc @@ -158,8 +158,9 @@ main() SolverGMRES<> solver_gmres(solver_control); // Attach all possible slots. solver_gmres.connect_condition_number_slot( - std::bind( - output_double_number, std::placeholders::_1, "Condition number: "), + std::bind(output_double_number, + std::placeholders::_1, + "Condition number: "), true); solver_gmres.connect_condition_number_slot( std::bind(output_double_number, diff --git a/tests/lac/sparse_matrices.cc b/tests/lac/sparse_matrices.cc index 69f321f065..78a3de5992 100644 --- a/tests/lac/sparse_matrices.cc +++ b/tests/lac/sparse_matrices.cc @@ -57,10 +57,12 @@ check_vmult_quadratic(std::vector &residuals, GrowingVectorMemory<> mem; SolverControl control(10, 1.e-13, false); - SolverRichardson<> rich( - control, mem, SolverRichardson<>::AdditionalData(/*omega=*/.01)); - SolverRichardson<> prich( - control, mem, SolverRichardson<>::AdditionalData(/*omega=*/1.)); + SolverRichardson<> rich(control, + mem, + SolverRichardson<>::AdditionalData(/*omega=*/.01)); + SolverRichardson<> prich(control, + mem, + SolverRichardson<>::AdditionalData(/*omega=*/1.)); const types::global_dof_index block_size = (types::global_dof_index)std::sqrt(A.n() + .3); @@ -135,11 +137,13 @@ check_vmult_quadratic(std::vector & residuals, Vector f(A.m()); GrowingVectorMemory<> mem; - SolverControl control(10, 1.e-13, false); - SolverRichardson<> rich( - control, mem, SolverRichardson<>::AdditionalData(/*omega=*/.01)); - SolverRichardson<> prich( - control, mem, SolverRichardson<>::AdditionalData(/*omega=*/1.)); + SolverControl control(10, 1.e-13, false); + SolverRichardson<> rich(control, + mem, + SolverRichardson<>::AdditionalData(/*omega=*/.01)); + SolverRichardson<> prich(control, + mem, + SolverRichardson<>::AdditionalData(/*omega=*/1.)); PreconditionIdentity identity; PreconditionJacobi> jacobi; jacobi.initialize(A, .5); diff --git a/tests/lac/tensor_product_matrix_vectorized_01.cc b/tests/lac/tensor_product_matrix_vectorized_01.cc index 6a78eb6814..4c1a0de94c 100644 --- a/tests/lac/tensor_product_matrix_vectorized_01.cc +++ b/tests/lac/tensor_product_matrix_vectorized_01.cc @@ -84,13 +84,14 @@ do_test(const unsigned int size) auto subtract_and_assign = [](AlignedVector> & lhs, const AlignedVector> &rhs) { - std::transform( - lhs.begin(), - lhs.end(), - rhs.begin(), - lhs.begin(), - [](const VectorizedArray lval, - const VectorizedArray rval) { return lval - rval; }); + std::transform(lhs.begin(), + lhs.end(), + rhs.begin(), + lhs.begin(), + [](const VectorizedArray lval, + const VectorizedArray rval) { + return lval - rval; + }); }; const ArrayView> view1(v1.begin(), v1.size()); diff --git a/tests/lac/tensor_product_matrix_vectorized_02.cc b/tests/lac/tensor_product_matrix_vectorized_02.cc index 21840f83eb..d97b108d7a 100644 --- a/tests/lac/tensor_product_matrix_vectorized_02.cc +++ b/tests/lac/tensor_product_matrix_vectorized_02.cc @@ -84,13 +84,14 @@ do_test() auto subtract_and_assign = [](AlignedVector> & lhs, const AlignedVector> &rhs) { - std::transform( - lhs.begin(), - lhs.end(), - rhs.begin(), - lhs.begin(), - [](const VectorizedArray lval, - const VectorizedArray rval) { return lval - rval; }); + std::transform(lhs.begin(), + lhs.end(), + rhs.begin(), + lhs.begin(), + [](const VectorizedArray lval, + const VectorizedArray rval) { + return lval - rval; + }); }; const ArrayView> view1(v1.begin(), v1.size()); diff --git a/tests/lac/tensor_product_matrix_vectorized_03.cc b/tests/lac/tensor_product_matrix_vectorized_03.cc index df3801db64..0fa086281a 100644 --- a/tests/lac/tensor_product_matrix_vectorized_03.cc +++ b/tests/lac/tensor_product_matrix_vectorized_03.cc @@ -84,13 +84,14 @@ do_test() auto subtract_and_assign = [](AlignedVector> & lhs, const AlignedVector> &rhs) { - std::transform( - lhs.begin(), - lhs.end(), - rhs.begin(), - lhs.begin(), - [](const VectorizedArray lval, - const VectorizedArray rval) { return lval - rval; }); + std::transform(lhs.begin(), + lhs.end(), + rhs.begin(), + lhs.begin(), + [](const VectorizedArray lval, + const VectorizedArray rval) { + return lval - rval; + }); }; const ArrayView> view1(v1.begin(), v1.size()); diff --git a/tests/lac/tensor_product_matrix_vectorized_04.cc b/tests/lac/tensor_product_matrix_vectorized_04.cc index 24b117b9c3..f87f81d715 100644 --- a/tests/lac/tensor_product_matrix_vectorized_04.cc +++ b/tests/lac/tensor_product_matrix_vectorized_04.cc @@ -78,13 +78,14 @@ do_test(const unsigned int size) auto subtract_and_assign = [](AlignedVector> & lhs, const AlignedVector> &rhs) { - std::transform( - lhs.begin(), - lhs.end(), - rhs.begin(), - lhs.begin(), - [](const VectorizedArray lval, - const VectorizedArray rval) { return lval - rval; }); + std::transform(lhs.begin(), + lhs.end(), + rhs.begin(), + lhs.begin(), + [](const VectorizedArray lval, + const VectorizedArray rval) { + return lval - rval; + }); }; const ArrayView> view1(v1.begin(), v1.size()); diff --git a/tests/lac/utilities_01.cc b/tests/lac/utilities_01.cc index 637c18e271..d73ee14922 100644 --- a/tests/lac/utilities_01.cc +++ b/tests/lac/utilities_01.cc @@ -70,12 +70,12 @@ main(int argc, char **argv) // estimate from CG { - ReductionControl control( - k, - std::sqrt(std::numeric_limits::epsilon()), - 1e-10, - false, - false); + ReductionControl control(k, + std::sqrt( + std::numeric_limits::epsilon()), + 1e-10, + false, + false); std::vector estimated_eigenvalues; SolverCG solver(control); solver.connect_eigenvalues_slot( diff --git a/tests/lac/utilities_02.cc b/tests/lac/utilities_02.cc index b7b4977d5d..1eac700ce4 100644 --- a/tests/lac/utilities_02.cc +++ b/tests/lac/utilities_02.cc @@ -101,8 +101,10 @@ test() ConstraintMatrix constraints; constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); std::shared_ptr> mf_data( @@ -200,12 +202,11 @@ test() const unsigned int num_arnoldi_vectors = 2 * eigenvalues.size() + 10; PArpackSolver>::AdditionalData - additional_data( - num_arnoldi_vectors, - PArpackSolver< - LinearAlgebra::distributed::Vector>::largest_magnitude, - true, - 1); + additional_data(num_arnoldi_vectors, + PArpackSolver>:: + largest_magnitude, + true, + 1); SolverControl solver_control(dof_handler.n_dofs(), 1e-10, @@ -249,11 +250,11 @@ test() { const double err = std::abs(eigenfunctions[j] * eigenfunctions[i] - (i == j)); - Assert( - err < precision, - ExcMessage("Eigenvectors " + Utilities::int_to_string(i) + - " and " + Utilities::int_to_string(j) + - " are not orthonormal: " + std::to_string(err))); + Assert(err < precision, + ExcMessage( + "Eigenvectors " + Utilities::int_to_string(i) + " and " + + Utilities::int_to_string(j) + + " are not orthonormal: " + std::to_string(err))); } OP.vmult(Ax, eigenfunctions[i]); diff --git a/tests/lac/vector_norms.cc b/tests/lac/vector_norms.cc index 8cefe361d2..ad383c5d3d 100644 --- a/tests/lac/vector_norms.cc +++ b/tests/lac/vector_norms.cc @@ -97,10 +97,10 @@ check_complex_norms() acc * size * std::abs(value), ExcInternalError()); const number l2_norma = vec.l2_norm(); - AssertThrow( - std::abs(l2_norma - std::abs(value) * std::sqrt((number)size)) < - acc * std::sqrt((number)size) * std::abs(value), - ExcInternalError()); + AssertThrow(std::abs(l2_norma - + std::abs(value) * std::sqrt((number)size)) < + acc * std::sqrt((number)size) * std::abs(value), + ExcInternalError()); const number lp_norma = vec.lp_norm(3.); AssertThrow( std::abs(lp_norma - diff --git a/tests/lac/vector_operations_parallel_for_start_end.cc b/tests/lac/vector_operations_parallel_for_start_end.cc index 6b42ec43db..1ab140f29d 100644 --- a/tests/lac/vector_operations_parallel_for_start_end.cc +++ b/tests/lac/vector_operations_parallel_for_start_end.cc @@ -38,8 +38,9 @@ check() new ::dealii::parallel::internal::TBBPartitioner()); Number *val; - Utilities::System::posix_memalign( - (void **)&val, 64, sizeof(Number) * size); + Utilities::System::posix_memalign((void **)&val, + 64, + sizeof(Number) * size); const Number s = 3.1415; internal::VectorOperations::Vector_set setter(s, val); @@ -51,8 +52,10 @@ check() { const unsigned int begin = i * chunk_size; const unsigned int end = std::min((i + 1) * chunk_size, size); - internal::VectorOperations::parallel_for( - setter, begin, end, thread_loop_partitioner); + internal::VectorOperations::parallel_for(setter, + begin, + end, + thread_loop_partitioner); } // check values: diff --git a/tests/lac/vector_operations_parallel_reduce_start_end.cc b/tests/lac/vector_operations_parallel_reduce_start_end.cc index 33a73da649..c8c64f8457 100644 --- a/tests/lac/vector_operations_parallel_reduce_start_end.cc +++ b/tests/lac/vector_operations_parallel_reduce_start_end.cc @@ -38,8 +38,9 @@ check() new ::dealii::parallel::internal::TBBPartitioner()); Number *val; - Utilities::System::posix_memalign( - (void **)&val, 64, sizeof(Number) * size); + Utilities::System::posix_memalign((void **)&val, + 64, + sizeof(Number) * size); for (unsigned int i = 0; i < size; ++i) val[i] = random_value(); diff --git a/tests/lapack/solver_cg.cc b/tests/lapack/solver_cg.cc index cb3b5365de..2256a81ab4 100644 --- a/tests/lapack/solver_cg.cc +++ b/tests/lapack/solver_cg.cc @@ -111,8 +111,9 @@ main() std::placeholders::_1, "Condition number estimate: "), true); - cg.connect_eigenvalues_slot(std::bind( - output_eigenvalues, std::placeholders::_1, "Final Eigenvalues: ")); + cg.connect_eigenvalues_slot(std::bind(output_eigenvalues, + std::placeholders::_1, + "Final Eigenvalues: ")); for (unsigned int size = 4; size <= 30; size *= 3) diff --git a/tests/manifold/chart_manifold_03.cc b/tests/manifold/chart_manifold_03.cc index d491b9c663..55f911203b 100644 --- a/tests/manifold/chart_manifold_03.cc +++ b/tests/manifold/chart_manifold_03.cc @@ -34,8 +34,8 @@ template class MyFlatManifold : public ChartManifold { public: - MyFlatManifold(const Tensor<1, spacedim> &periodicity) : - ChartManifold(periodicity) + MyFlatManifold(const Tensor<1, spacedim> &periodicity) + : ChartManifold(periodicity) {} virtual std::unique_ptr> diff --git a/tests/manifold/chart_manifold_03_embedded.cc b/tests/manifold/chart_manifold_03_embedded.cc index 95c2fdb4c8..a610c29bb3 100644 --- a/tests/manifold/chart_manifold_03_embedded.cc +++ b/tests/manifold/chart_manifold_03_embedded.cc @@ -36,8 +36,8 @@ template class MyFlatManifold : public ChartManifold { public: - MyFlatManifold(const Tensor<1, spacedim + 1> &periodicity) : - ChartManifold(periodicity) + MyFlatManifold(const Tensor<1, spacedim + 1> &periodicity) + : ChartManifold(periodicity) {} virtual std::unique_ptr> diff --git a/tests/manifold/chart_manifold_06.cc b/tests/manifold/chart_manifold_06.cc index 4e7912cd04..cb10d6addc 100644 --- a/tests/manifold/chart_manifold_06.cc +++ b/tests/manifold/chart_manifold_06.cc @@ -28,8 +28,8 @@ template class MyFlatManifold : public ChartManifold { public: - MyFlatManifold(const Tensor<1, spacedim> &periodicity) : - ChartManifold(periodicity) + MyFlatManifold(const Tensor<1, spacedim> &periodicity) + : ChartManifold(periodicity) {} diff --git a/tests/manifold/chart_manifold_06_embedded.cc b/tests/manifold/chart_manifold_06_embedded.cc index ca947d7f7c..48b5f27060 100644 --- a/tests/manifold/chart_manifold_06_embedded.cc +++ b/tests/manifold/chart_manifold_06_embedded.cc @@ -28,8 +28,8 @@ template class MyFlatManifold : public ChartManifold { public: - MyFlatManifold(const Tensor<1, spacedim> &periodicity) : - ChartManifold(periodicity) + MyFlatManifold(const Tensor<1, spacedim> &periodicity) + : ChartManifold(periodicity) {} virtual std::unique_ptr> diff --git a/tests/manifold/chart_manifold_07.cc b/tests/manifold/chart_manifold_07.cc index 972fc8db7b..5fb9fa08f6 100644 --- a/tests/manifold/chart_manifold_07.cc +++ b/tests/manifold/chart_manifold_07.cc @@ -32,7 +32,8 @@ public: static const int spacedim = 3; static const int chartdim = 3; - MyCylinderManifold() : ChartManifold(periodicity) + MyCylinderManifold() + : ChartManifold(periodicity) {} diff --git a/tests/manifold/chart_manifold_08.cc b/tests/manifold/chart_manifold_08.cc index 8c4a614b40..11fb708025 100644 --- a/tests/manifold/chart_manifold_08.cc +++ b/tests/manifold/chart_manifold_08.cc @@ -33,7 +33,8 @@ public: static const int spacedim = 3; static const int chartdim = 3; - MyCylinderManifold() : ChartManifold(periodicity) + MyCylinderManifold() + : ChartManifold(periodicity) {} virtual std::unique_ptr> diff --git a/tests/manifold/spherical_manifold_01.cc b/tests/manifold/spherical_manifold_01.cc index 446be240f6..14387a091d 100644 --- a/tests/manifold/spherical_manifold_01.cc +++ b/tests/manifold/spherical_manifold_01.cc @@ -131,8 +131,9 @@ main() deallog << "=================================" << std::endl; ; for (unsigned int i = 0; i < num_points; i++) - deallog << manifold.get_intermediate_point( - P1, P2, (1.0 * i) / (num_points - 1)) + deallog << manifold.get_intermediate_point(P1, + P2, + (1.0 * i) / (num_points - 1)) << std::endl; deallog << "=================================" << std::endl; } diff --git a/tests/manifold/spherical_manifold_08.cc b/tests/manifold/spherical_manifold_08.cc index b234195745..f09ba33150 100644 --- a/tests/manifold/spherical_manifold_08.cc +++ b/tests/manifold/spherical_manifold_08.cc @@ -33,10 +33,12 @@ main() SphericalManifold<3> spherical; - Point<3> p1( - -0.036923837121444085, -0.87096345314118251, -0.075394254055706517); - Point<3> p2( - -0.037583190343442631, -0.8865163726762405, -0.076740572095662762); + Point<3> p1(-0.036923837121444085, + -0.87096345314118251, + -0.075394254055706517); + Point<3> p2(-0.037583190343442631, + -0.8865163726762405, + -0.076740572095662762); // when projected to radius one, both points are almost the same: // p1/p1.norm() : [-0.042198670995936091, -0.99538680358992271, diff --git a/tests/manifold/spherical_manifold_09.cc b/tests/manifold/spherical_manifold_09.cc index 1c31325deb..2ad30e08a3 100644 --- a/tests/manifold/spherical_manifold_09.cc +++ b/tests/manifold/spherical_manifold_09.cc @@ -49,32 +49,34 @@ main() // at outer boundary, the normal should point outwards and be // aligned with the point down to roundoff. Check this for the // second face vertex as well as the center. - deallog << "Outer normal correctness (should be 0): " - << (1.0 - cell->face(f)->vertex(1) * - spherical.normal_vector( - cell->face(f), cell->face(f)->vertex(1))) - << " " - << (1.0 - - cell->face(f)->center(/*respect_manifold=*/true) * - spherical.normal_vector( - cell->face(f), cell->face(f)->center(true))) - << std::endl; + deallog + << "Outer normal correctness (should be 0): " + << (1.0 - cell->face(f)->vertex(1) * + spherical.normal_vector(cell->face(f), + cell->face(f)->vertex(1))) + << " " + << (1.0 - + cell->face(f)->center(/*respect_manifold=*/true) * + spherical.normal_vector(cell->face(f), + cell->face(f)->center(true))) + << std::endl; } else if (std::abs(cell->face(f)->vertex(1).norm() - 0.5) < 1e-1) { // at inner boundary, the normal should point inwards and be // aligned with the point down to roundoff. Check this for the // second face vertex as well as the center. - deallog << "Inner normal correctness (should be 0): " - << (0.5 - cell->face(f)->vertex(1) * - spherical.normal_vector( - cell->face(f), cell->face(f)->vertex(1))) - << " " - << (0.5 - - cell->face(f)->center(/*respect_manifold=*/true) * - spherical.normal_vector( - cell->face(f), cell->face(f)->center(true))) - << std::endl; + deallog + << "Inner normal correctness (should be 0): " + << (0.5 - cell->face(f)->vertex(1) * + spherical.normal_vector(cell->face(f), + cell->face(f)->vertex(1))) + << " " + << (0.5 - + cell->face(f)->center(/*respect_manifold=*/true) * + spherical.normal_vector(cell->face(f), + cell->face(f)->center(true))) + << std::endl; } } for (auto cell : tria.active_cell_iterators()) @@ -87,17 +89,16 @@ main() // adjust the point to lie on the same radius as the vertex points // by a weighting where the normal should again be perfectly aligned // with the point itself. - deallog << "Approximate normal in " << cell->face(f)->center(false) - << ": " - << spherical.normal_vector(cell->face(f), - cell->face(f)->center(false)) - << ", adjusted: " - << spherical.normal_vector( - cell->face(f), - cell->face(f)->center(false) / - cell->face(f)->center(false).norm() * - cell->face(f)->vertex(1).norm()) - << std::endl; + deallog + << "Approximate normal in " << cell->face(f)->center(false) << ": " + << spherical.normal_vector(cell->face(f), + cell->face(f)->center(false)) + << ", adjusted: " + << spherical.normal_vector(cell->face(f), + cell->face(f)->center(false) / + cell->face(f)->center(false).norm() * + cell->face(f)->vertex(1).norm()) + << std::endl; } return 0; diff --git a/tests/manifold/spherical_manifold_10.cc b/tests/manifold/spherical_manifold_10.cc index 079d9f3935..6bc472fd81 100644 --- a/tests/manifold/spherical_manifold_10.cc +++ b/tests/manifold/spherical_manifold_10.cc @@ -65,8 +65,9 @@ main() const double tolerance = 1e-8; for (unsigned int q = 0; q < quadrature.size(); ++q) { - const Tensor<1, dim> normal_manifold = spherical.normal_vector( - cell->face(f), fe_values.quadrature_point(q)); + const Tensor<1, dim> normal_manifold = + spherical.normal_vector(cell->face(f), + fe_values.quadrature_point(q)); const Tensor<1, dim> normal_feval = fe_values.normal_vector(q); if (std::abs(1.0 - std::abs(normal_manifold * normal_feval)) > tolerance) diff --git a/tests/manifold/spherical_manifold_12.cc b/tests/manifold/spherical_manifold_12.cc index a4f9d4f6e1..bd8a8c849c 100644 --- a/tests/manifold/spherical_manifold_12.cc +++ b/tests/manifold/spherical_manifold_12.cc @@ -69,12 +69,14 @@ main() const double tolerance = 1e-7; for (unsigned int q = 0; q < quadrature.size(); ++q) { - const Tensor<1, dim> normal_manifold = spherical.normal_vector( - cell->face(f), fe_values.quadrature_point(q)); + const Tensor<1, dim> normal_manifold = + spherical.normal_vector(cell->face(f), + fe_values.quadrature_point(q)); if (cell->face(f)->boundary_id() == 2) { - const Tensor<1, dim> normal_flat = flat.normal_vector( - cell->face(f), fe_values.quadrature_point(q)); + const Tensor<1, dim> normal_flat = + flat.normal_vector(cell->face(f), + fe_values.quadrature_point(q)); if (std::abs(1.0 - std::abs(normal_manifold * normal_flat)) > tolerance) deallog diff --git a/tests/manifold/transfinite_manifold_01.cc b/tests/manifold/transfinite_manifold_01.cc index 6438aa6528..a15adb49e2 100644 --- a/tests/manifold/transfinite_manifold_01.cc +++ b/tests/manifold/transfinite_manifold_01.cc @@ -52,10 +52,11 @@ do_test(const Triangulation &tria) points.push_back(cell->face(face)->vertex(0)); points.push_back(cell->face(face)->vertex(1)); std::vector weights(2); - weights[0] = 0.1; - weights[1] = 0.9; - Point p = cell->get_manifold().get_new_point( - make_array_view(points), make_array_view(weights)); + weights[0] = 0.1; + weights[1] = 0.9; + Point p = + cell->get_manifold().get_new_point(make_array_view(points), + make_array_view(weights)); Point pref = cell->face(face)->get_manifold().get_new_point( make_array_view(points), make_array_view(weights)); diff --git a/tests/manifold/transfinite_manifold_02.cc b/tests/manifold/transfinite_manifold_02.cc index 643552a72a..1a2c217fd4 100644 --- a/tests/manifold/transfinite_manifold_02.cc +++ b/tests/manifold/transfinite_manifold_02.cc @@ -64,10 +64,11 @@ do_test(const Triangulation &tria) points.push_back(cell->face(face)->vertex(0)); points.push_back(cell->face(face)->vertex(1)); std::vector weights(2); - weights[0] = 0.1; - weights[1] = 0.9; - Point p = cell->get_manifold().get_new_point( - make_array_view(points), make_array_view(weights)); + weights[0] = 0.1; + weights[1] = 0.9; + Point p = + cell->get_manifold().get_new_point(make_array_view(points), + make_array_view(weights)); Point pref = cell->face(face)->get_manifold().get_new_point( make_array_view(points), make_array_view(weights)); diff --git a/tests/manifold/transfinite_manifold_04.cc b/tests/manifold/transfinite_manifold_04.cc index a0cb967fa9..b7503d8c4f 100644 --- a/tests/manifold/transfinite_manifold_04.cc +++ b/tests/manifold/transfinite_manifold_04.cc @@ -53,10 +53,11 @@ do_test(const Triangulation &tria) points.push_back(cell->face(face)->vertex(0)); points.push_back(cell->face(face)->vertex(1)); std::vector weights(2); - weights[0] = 0.1; - weights[1] = 0.9; - Point p = cell->get_manifold().get_new_point( - make_array_view(points), make_array_view(weights)); + weights[0] = 0.1; + weights[1] = 0.9; + Point p = + cell->get_manifold().get_new_point(make_array_view(points), + make_array_view(weights)); Point pref = cell->face(face)->get_manifold().get_new_point( make_array_view(points), make_array_view(weights)); diff --git a/tests/manifold/transfinite_manifold_07.cc b/tests/manifold/transfinite_manifold_07.cc index 3dad3b5ae5..6ca22539e7 100644 --- a/tests/manifold/transfinite_manifold_07.cc +++ b/tests/manifold/transfinite_manifold_07.cc @@ -227,8 +227,9 @@ void concentric_disks(Triangulation<2> & tria, cell_idx++; } - tria.create_triangulation( - vertices, cells, SubCellData()); // no boundary information + tria.create_triangulation(vertices, + cells, + SubCellData()); // no boundary information double eps = 1e-5 * x[0]; unsigned int label = 100; @@ -290,7 +291,8 @@ private: }; template -Mygrid::Mygrid(unsigned int r) : refinement(r) +Mygrid::Mygrid(unsigned int r) + : refinement(r) {} template diff --git a/tests/manifold/tria_boundary_id_01.cc b/tests/manifold/tria_boundary_id_01.cc index 346f174a69..9b27faf564 100644 --- a/tests/manifold/tria_boundary_id_01.cc +++ b/tests/manifold/tria_boundary_id_01.cc @@ -89,8 +89,9 @@ main() const double outer_radius = 0.5; const double tol = 1e-6; Triangulation tria; - GridGenerator::hyper_cube_with_cylindrical_hole( - tria, inner_radius, outer_radius); + GridGenerator::hyper_cube_with_cylindrical_hole(tria, + inner_radius, + outer_radius); tria.reset_all_manifolds(); // Enumerate the flat boundaries and the curved one separately. Also provide diff --git a/tests/mappings/fe_face_values_1d_mapping_cartesian.cc b/tests/mappings/fe_face_values_1d_mapping_cartesian.cc index bfbcb8b8d1..fa594f2d55 100644 --- a/tests/mappings/fe_face_values_1d_mapping_cartesian.cc +++ b/tests/mappings/fe_face_values_1d_mapping_cartesian.cc @@ -56,12 +56,13 @@ plot_faces(Mapping & mapping, QGauss q(4); Assert(q.size() == 1, ExcInternalError()); - FEFaceValues fe_values( - mapping, - fe, - q, - UpdateFlags(update_quadrature_points | update_JxW_values | update_values | - update_gradients | update_hessians | update_normal_vectors)); + FEFaceValues fe_values(mapping, + fe, + q, + UpdateFlags(update_quadrature_points | + update_JxW_values | update_values | + update_gradients | update_hessians | + update_normal_vectors)); for (unsigned int face_nr = 0; face_nr < GeometryInfo::faces_per_cell; ++face_nr) diff --git a/tests/mappings/fe_face_values_1d_mapping_q2.cc b/tests/mappings/fe_face_values_1d_mapping_q2.cc index 09c5cb7f1c..702e37b398 100644 --- a/tests/mappings/fe_face_values_1d_mapping_q2.cc +++ b/tests/mappings/fe_face_values_1d_mapping_q2.cc @@ -56,12 +56,13 @@ plot_faces(Mapping & mapping, QGauss q(4); Assert(q.size() == 1, ExcInternalError()); - FEFaceValues fe_values( - mapping, - fe, - q, - UpdateFlags(update_quadrature_points | update_JxW_values | update_values | - update_gradients | update_hessians | update_normal_vectors)); + FEFaceValues fe_values(mapping, + fe, + q, + UpdateFlags(update_quadrature_points | + update_JxW_values | update_values | + update_gradients | update_hessians | + update_normal_vectors)); for (unsigned int face_nr = 0; face_nr < GeometryInfo::faces_per_cell; ++face_nr) diff --git a/tests/mappings/mapping.cc b/tests/mappings/mapping.cc index 83c8766666..ea505c0355 100644 --- a/tests/mappings/mapping.cc +++ b/tests/mappings/mapping.cc @@ -143,11 +143,11 @@ plot_subfaces(Mapping & mapping, const unsigned int nq = (unsigned int)(.01 + std::pow(q.size(), 1. / (dim - 1))); - FESubfaceValues fe_values( - mapping, - fe, - q, - UpdateFlags(update_quadrature_points | update_normal_vectors)); + FESubfaceValues fe_values(mapping, + fe, + q, + UpdateFlags(update_quadrature_points | + update_normal_vectors)); for (unsigned int face_nr = 0; face_nr < GeometryInfo::faces_per_cell; ++face_nr) for (unsigned int sub_nr = 0; @@ -272,10 +272,10 @@ void create_triangulations(std::vector *> &tria_ptr, cells[0].vertices[j] = cell_vertices[0][j]; cells[0].material_id = 0; - tria->create_triangulation( - std::vector>(&vertices[0], &vertices[4]), - cells, - SubCellData()); + tria->create_triangulation(std::vector>(&vertices[0], + &vertices[4]), + cells, + SubCellData()); exact_areas.push_back(9.); } diff --git a/tests/mappings/mapping_fe_field_01.cc b/tests/mappings/mapping_fe_field_01.cc index f1b2d1888b..4e82d95c12 100644 --- a/tests/mappings/mapping_fe_field_01.cc +++ b/tests/mappings/mapping_fe_field_01.cc @@ -74,8 +74,10 @@ test(const unsigned int degree) QIterated quadrature_formula(QTrapez<1>(), fe.degree); - FEValues fe_values( - map_fe, fe_sys, quadrature_formula, update_values | update_JxW_values); + FEValues fe_values(map_fe, + fe_sys, + quadrature_formula, + update_values | update_JxW_values); typename DoFHandler::active_cell_iterator cell = dof_sys diff --git a/tests/mappings/mapping_fe_field_03.cc b/tests/mappings/mapping_fe_field_03.cc index 5a192f59c6..b631d139bd 100644 --- a/tests/mappings/mapping_fe_field_03.cc +++ b/tests/mappings/mapping_fe_field_03.cc @@ -67,8 +67,9 @@ test() IndexSet locally_relevant_euler; DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_euler); - map_vector.reinit( - dh.locally_owned_dofs(), locally_relevant_euler, MPI_COMM_WORLD); + map_vector.reinit(dh.locally_owned_dofs(), + locally_relevant_euler, + MPI_COMM_WORLD); VectorTools::get_position_vector(dh, map_vector); diff --git a/tests/mappings/mapping_fe_field_real_to_unit_b2_mask.cc b/tests/mappings/mapping_fe_field_real_to_unit_b2_mask.cc index dae6af666f..2abd8f3876 100644 --- a/tests/mappings/mapping_fe_field_real_to_unit_b2_mask.cc +++ b/tests/mappings/mapping_fe_field_real_to_unit_b2_mask.cc @@ -97,8 +97,10 @@ test_real_to_unit_cell() break; } - const FESystem fesystem( - FE_Q(1), 1, FE_Bernstein(2), spacedim); + const FESystem fesystem(FE_Q(1), + 1, + FE_Bernstein(2), + spacedim); DoFHandler dhb(triangulation); dhb.distribute_dofs(fesystem); diff --git a/tests/mappings/mapping_fe_field_real_to_unit_q2_mask.cc b/tests/mappings/mapping_fe_field_real_to_unit_q2_mask.cc index c4259e4f95..427ecf04cf 100644 --- a/tests/mappings/mapping_fe_field_real_to_unit_q2_mask.cc +++ b/tests/mappings/mapping_fe_field_real_to_unit_q2_mask.cc @@ -83,8 +83,10 @@ test_real_to_unit_cell() break; } - const FESystem fesystem( - FE_Q(1), 1, FE_Q(2), spacedim); + const FESystem fesystem(FE_Q(1), + 1, + FE_Q(2), + spacedim); DoFHandler dhq(triangulation); dhq.distribute_dofs(fesystem); diff --git a/tests/mappings/mapping_manifold_02.cc b/tests/mappings/mapping_manifold_02.cc index b431a8084a..69c8cce12a 100644 --- a/tests/mappings/mapping_manifold_02.cc +++ b/tests/mappings/mapping_manifold_02.cc @@ -63,8 +63,10 @@ test() MappingManifold mapping; - FEValues fe_values( - mapping, fe, quad, update_quadrature_points); + FEValues fe_values(mapping, + fe, + quad, + update_quadrature_points); for (typename Triangulation::active_cell_iterator cell = triangulation.begin_active(); diff --git a/tests/mappings/mapping_manifold_03.cc b/tests/mappings/mapping_manifold_03.cc index 40c3b9174b..23a32ae785 100644 --- a/tests/mappings/mapping_manifold_03.cc +++ b/tests/mappings/mapping_manifold_03.cc @@ -52,8 +52,10 @@ test() MappingManifold mapping_manifold; MappingQGeneric mapping_q(1); - FEValues fe_values_mapping( - mapping_manifold, fe, quad, update_jacobians); + FEValues fe_values_mapping(mapping_manifold, + fe, + quad, + update_jacobians); FEValues fe_values_q(mapping_q, fe, quad, update_jacobians); diff --git a/tests/mappings/mapping_manifold_04.cc b/tests/mappings/mapping_manifold_04.cc index ce260cf109..18a64e5aad 100644 --- a/tests/mappings/mapping_manifold_04.cc +++ b/tests/mappings/mapping_manifold_04.cc @@ -58,8 +58,10 @@ test() MappingManifold mapping_manifold; MappingQGeneric mapping_q(1); - FEValues fe_values_mapping( - mapping_manifold, fe, quad, update_jacobians); + FEValues fe_values_mapping(mapping_manifold, + fe, + quad, + update_jacobians); FEValues fe_values_q(mapping_q, fe, quad, update_jacobians); diff --git a/tests/mappings/mapping_manifold_05.cc b/tests/mappings/mapping_manifold_05.cc index 488383657f..47eef5d8f3 100644 --- a/tests/mappings/mapping_manifold_05.cc +++ b/tests/mappings/mapping_manifold_05.cc @@ -60,11 +60,15 @@ test() MappingManifold mapping_manifold; MappingQGeneric mapping_q(1); - FEFaceValues fe_values_mapping( - mapping_manifold, fe, quad, update_jacobians); - - FEFaceValues fe_values_q( - mapping_q, fe, quad, update_jacobians); + FEFaceValues fe_values_mapping(mapping_manifold, + fe, + quad, + update_jacobians); + + FEFaceValues fe_values_q(mapping_q, + fe, + quad, + update_jacobians); typename Triangulation::active_cell_iterator cell = triangulation.begin_active(); diff --git a/tests/mappings/mapping_manifold_07.cc b/tests/mappings/mapping_manifold_07.cc index 0fabcbe770..f46d39bed3 100644 --- a/tests/mappings/mapping_manifold_07.cc +++ b/tests/mappings/mapping_manifold_07.cc @@ -55,9 +55,11 @@ test() FE_Q fe(1); const QGauss quad(3); - FEFaceValues fe_v( - map_manifold, fe, quad, update_JxW_values); - double area = 0; + FEFaceValues fe_v(map_manifold, + fe, + quad, + update_JxW_values); + double area = 0; for (typename Triangulation::active_cell_iterator cell = triangulation.begin_active(); diff --git a/tests/mappings/mapping_manifold_step-3.cc b/tests/mappings/mapping_manifold_step-3.cc index a7923dc7fd..b870c06e64 100644 --- a/tests/mappings/mapping_manifold_step-3.cc +++ b/tests/mappings/mapping_manifold_step-3.cc @@ -81,7 +81,9 @@ private: }; -LaplaceProblem::LaplaceProblem() : fe(1), dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : fe(1) + , dof_handler(triangulation) {} @@ -159,8 +161,9 @@ LaplaceProblem::assemble_system() 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_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); @@ -168,10 +171,14 @@ LaplaceProblem::assemble_system() std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction<2>(), boundary_values); - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction<2>(), + boundary_values); + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } diff --git a/tests/mappings/mapping_project_01.cc b/tests/mappings/mapping_project_01.cc index 3d2aad02f2..eb57b7b573 100644 --- a/tests/mappings/mapping_project_01.cc +++ b/tests/mappings/mapping_project_01.cc @@ -52,8 +52,9 @@ dim2_grid() for (unsigned int face = 0; face < GeometryInfo<2>::faces_per_cell; ++face) { deallog << "For face: " << face << ", the test point projects to: " - << mapping.project_real_point_to_unit_point_on_face( - cell, face, testp) + << mapping.project_real_point_to_unit_point_on_face(cell, + face, + testp) << std::endl; } } @@ -82,8 +83,9 @@ dim3_grid() for (unsigned int face = 0; face < GeometryInfo<3>::faces_per_cell; ++face) { deallog << "For face: " << face << ", the test point projects to: " - << mapping.project_real_point_to_unit_point_on_face( - cell, face, testp) + << mapping.project_real_point_to_unit_point_on_face(cell, + face, + testp) << std::endl; } } @@ -116,8 +118,9 @@ dim3_parallelepiped_grid() for (unsigned int face = 0; face < GeometryInfo<3>::faces_per_cell; ++face) { deallog << "For face: " << face << ", the test point projects to: " - << mapping.project_real_point_to_unit_point_on_face( - cell, face, testp) + << mapping.project_real_point_to_unit_point_on_face(cell, + face, + testp) << std::endl; } } diff --git a/tests/mappings/mapping_q1_cartesian_grid.cc b/tests/mappings/mapping_q1_cartesian_grid.cc index 76518005e8..c132686a28 100644 --- a/tests/mappings/mapping_q1_cartesian_grid.cc +++ b/tests/mappings/mapping_q1_cartesian_grid.cc @@ -41,10 +41,10 @@ public: static constexpr int dim = 2; public: - RefineTest(const unsigned int refine_case) : - triangulation(), - dof_handler(triangulation), - refine_case(refine_case) + RefineTest(const unsigned int refine_case) + : triangulation() + , dof_handler(triangulation) + , refine_case(refine_case) { make_grid(); test_mapping(); diff --git a/tests/mappings/mapping_q1_eulerian_01.cc b/tests/mappings/mapping_q1_eulerian_01.cc index f74dfb4177..bae2feb3b7 100644 --- a/tests/mappings/mapping_q1_eulerian_01.cc +++ b/tests/mappings/mapping_q1_eulerian_01.cc @@ -65,7 +65,8 @@ template class Displacement : public Function { public: - Displacement() : Function(dim) + Displacement() + : Function(dim) {} double diff --git a/tests/mappings/mapping_q4_3d.cc b/tests/mappings/mapping_q4_3d.cc index ca3ead907c..9dd585b1f7 100644 --- a/tests/mappings/mapping_q4_3d.cc +++ b/tests/mappings/mapping_q4_3d.cc @@ -51,8 +51,10 @@ main() MappingQ<3> mapping(4); QGauss<2> q_face(3); - FEFaceValues<3> fe_face_values( - mapping, fe, q_face, update_normal_vectors | update_JxW_values); + FEFaceValues<3> fe_face_values(mapping, + fe, + q_face, + update_normal_vectors | update_JxW_values); fe_face_values.reinit(dof_handler.begin_active(), 0); // if we got here, we got past the previous diff --git a/tests/mappings/mapping_q_eulerian.cc b/tests/mappings/mapping_q_eulerian.cc index 01d757f1e8..851889f422 100644 --- a/tests/mappings/mapping_q_eulerian.cc +++ b/tests/mappings/mapping_q_eulerian.cc @@ -57,7 +57,8 @@ template class ImposedDisplacement : public Function { public: - ImposedDisplacement() : Function(dim) + ImposedDisplacement() + : Function(dim) {} virtual void vector_value(const Point &p, Vector &value) const; @@ -111,10 +112,10 @@ private: // .... CONSTRUCTOR template -MappingTest::MappingTest(unsigned int degree) : - dof_handler(triangulation), - fe(FE_Q(degree), dim), - degree(degree) +MappingTest::MappingTest(unsigned int degree) + : dof_handler(triangulation) + , fe(FE_Q(degree), dim) + , degree(degree) {} @@ -245,8 +246,10 @@ MappingTest::graphical_output() dof_handler.distribute_dofs(fe); displacements.reinit(dof_handler.n_dofs()); - VectorTools::interpolate( - MappingQGeneric(1), dof_handler, imposed_displacement, displacements); + VectorTools::interpolate(MappingQGeneric(1), + dof_handler, + imposed_displacement, + displacements); explicitly_move_mesh(); } diff --git a/tests/mappings/mapping_q_eulerian_01.cc b/tests/mappings/mapping_q_eulerian_01.cc index 962bb3a801..4452b061e5 100644 --- a/tests/mappings/mapping_q_eulerian_01.cc +++ b/tests/mappings/mapping_q_eulerian_01.cc @@ -63,7 +63,8 @@ template class Displacement : public Function { public: - Displacement() : Function(dim) + Displacement() + : Function(dim) {} double diff --git a/tests/mappings/mapping_q_eulerian_02.cc b/tests/mappings/mapping_q_eulerian_02.cc index 2c703e6099..fc367db8cd 100644 --- a/tests/mappings/mapping_q_eulerian_02.cc +++ b/tests/mappings/mapping_q_eulerian_02.cc @@ -65,7 +65,8 @@ template class Displacement : public Function { public: - Displacement() : Function(dim) + Displacement() + : Function(dim) {} double diff --git a/tests/mappings/mapping_q_eulerian_03.cc b/tests/mappings/mapping_q_eulerian_03.cc index 286578e4be..59557ad51f 100644 --- a/tests/mappings/mapping_q_eulerian_03.cc +++ b/tests/mappings/mapping_q_eulerian_03.cc @@ -66,7 +66,8 @@ template class Displacement : public Function { public: - Displacement() : Function(dim) + Displacement() + : Function(dim) {} double diff --git a/tests/mappings/mapping_q_eulerian_05.cc b/tests/mappings/mapping_q_eulerian_05.cc index 37b5fceeb9..ae6b365561 100644 --- a/tests/mappings/mapping_q_eulerian_05.cc +++ b/tests/mappings/mapping_q_eulerian_05.cc @@ -62,8 +62,9 @@ test(unsigned int degree) grid_out.write_ucd(tria, logfile); QTrapez quad; - MappingQEulerian, spacedim> mapping( - degree, shift_dh, shift); + MappingQEulerian, spacedim> mapping(degree, + shift_dh, + shift); typename Triangulation::active_cell_iterator cell = tria.begin_active(), diff --git a/tests/mappings/mapping_q_eulerian_06.cc b/tests/mappings/mapping_q_eulerian_06.cc index bd0befb526..f71de3cf78 100644 --- a/tests/mappings/mapping_q_eulerian_06.cc +++ b/tests/mappings/mapping_q_eulerian_06.cc @@ -57,8 +57,9 @@ test(unsigned int degree) shift(i) = 0.1; QGauss quad(degree + 1); - MappingQEulerian, spacedim> mapping( - degree, shift_dh, shift); + MappingQEulerian, spacedim> mapping(degree, + shift_dh, + shift); Triangulation::active_cell_iterator cell = tria.begin_active(), endc = tria.end(); diff --git a/tests/mappings/mapping_q_eulerian_07.cc b/tests/mappings/mapping_q_eulerian_07.cc index 6b811f969b..6d8c483d35 100644 --- a/tests/mappings/mapping_q_eulerian_07.cc +++ b/tests/mappings/mapping_q_eulerian_07.cc @@ -69,7 +69,8 @@ template class Displacement : public Function { public: - Displacement() : Function(dim) + Displacement() + : Function(dim) {} double @@ -115,14 +116,16 @@ test() DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs); PETScWrappers::MPI::Vector x(locally_owned_dofs, MPI_COMM_WORLD); - PETScWrappers::MPI::Vector x_relevant( - locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD); + PETScWrappers::MPI::Vector x_relevant(locally_owned_dofs, + locally_relevant_dofs, + MPI_COMM_WORLD); VectorTools::interpolate(dof_handler, Displacement(), x); x_relevant = x; - MappingQEulerian euler( - 2, dof_handler, x_relevant); + MappingQEulerian euler(2, + dof_handler, + x_relevant); // now the actual test DataOut data_out; diff --git a/tests/mappings/mapping_q_eulerian_08.cc b/tests/mappings/mapping_q_eulerian_08.cc index 71d5ddb92a..dddfb06ee0 100644 --- a/tests/mappings/mapping_q_eulerian_08.cc +++ b/tests/mappings/mapping_q_eulerian_08.cc @@ -76,7 +76,8 @@ template class Displacement : public Function { public: - Displacement() : Function(dim) + Displacement() + : Function(dim) {} double @@ -188,8 +189,9 @@ test(const unsigned int n_ref = 0) // Displacement vector LinearAlgebra::distributed::Vector displacement; - displacement.reinit( - locally_owned_dofs_euler, locally_relevant_dofs_euler, mpi_communicator); + displacement.reinit(locally_owned_dofs_euler, + locally_relevant_dofs_euler, + mpi_communicator); VectorTools::project, @@ -210,8 +212,9 @@ test(const unsigned int n_ref = 0) const unsigned int min_level = 0; MGLevelObject> displacement_level(min_level, max_level); - mg_transfer_euler.interpolate_to_mg( - dof_handler_euler, displacement_level, displacement); + mg_transfer_euler.interpolate_to_mg(dof_handler_euler, + displacement_level, + displacement); // First, check fine-level only: { @@ -284,8 +287,9 @@ test(const unsigned int n_ref = 0) ConstraintMatrix level_constraints; IndexSet relevant_dofs; - DoFTools::extract_locally_relevant_level_dofs( - dof_handler, level, relevant_dofs); + DoFTools::extract_locally_relevant_level_dofs(dof_handler, + level, + relevant_dofs); level_constraints.reinit(relevant_dofs); level_constraints.add_lines( mg_constrained_dofs.get_boundary_indices(level)); @@ -294,8 +298,10 @@ test(const unsigned int n_ref = 0) MatrixFree mg_level_euler; MappingQEulerian> - euler_level( - euler_fe_degree, dof_handler_euler, displacement_level[level], level); + euler_level(euler_fe_degree, + dof_handler_euler, + displacement_level[level], + level); mg_level_euler.reinit(euler_level, dof_handler, @@ -304,8 +310,10 @@ test(const unsigned int n_ref = 0) mg_additional_data); MatrixFree mg_level; - mg_level.reinit( - dof_handler, level_constraints, quadrature_formula, mg_additional_data); + mg_level.reinit(dof_handler, + level_constraints, + quadrature_formula, + mg_additional_data); // go through all cells and quadrature points: { @@ -330,10 +338,10 @@ test(const unsigned int n_ref = 0) for (unsigned int v = 0; v < VectorizedArray::n_array_elements; ++v) - AssertThrow( - dist[v] < 1e-8, - ExcMessage("Level " + std::to_string(level) + - " distance: " + std::to_string(dist[v]))); + AssertThrow(dist[v] < 1e-8, + ExcMessage( + "Level " + std::to_string(level) + + " distance: " + std::to_string(dist[v]))); } } } diff --git a/tests/mappings/mapping_q_eulerian_09.cc b/tests/mappings/mapping_q_eulerian_09.cc index c77471688f..2f0a3bbd56 100644 --- a/tests/mappings/mapping_q_eulerian_09.cc +++ b/tests/mappings/mapping_q_eulerian_09.cc @@ -58,7 +58,8 @@ template class Displacement : public Function { public: - Displacement() : Function(dim) + Displacement() + : Function(dim) {} double @@ -122,15 +123,17 @@ test() // Displacement vector LinearAlgebra::distributed::Vector displacement; - displacement.reinit( - locally_owned_dofs_euler, locally_relevant_dofs_euler, mpi_communicator); + displacement.reinit(locally_owned_dofs_euler, + locally_relevant_dofs_euler, + mpi_communicator); displacement = 0.; Displacement displacement_function; // first, move via mapping: - VectorTools::interpolate( - dof_handler_euler, displacement_function, displacement); + VectorTools::interpolate(dof_handler_euler, + displacement_function, + displacement); displacement.compress(VectorOperation::insert); displacement.update_ghost_values(); diff --git a/tests/mappings/mapping_q_eulerian_11.cc b/tests/mappings/mapping_q_eulerian_11.cc index 3b94998578..9f1ed85cbc 100644 --- a/tests/mappings/mapping_q_eulerian_11.cc +++ b/tests/mappings/mapping_q_eulerian_11.cc @@ -67,7 +67,8 @@ template class Displacement : public Function { public: - Displacement() : Function(dim) + Displacement() + : Function(dim) {} double @@ -113,14 +114,16 @@ test() DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs); TrilinosWrappers::MPI::Vector x(locally_owned_dofs, MPI_COMM_WORLD); - TrilinosWrappers::MPI::Vector x_relevant( - locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD); + TrilinosWrappers::MPI::Vector x_relevant(locally_owned_dofs, + locally_relevant_dofs, + MPI_COMM_WORLD); VectorTools::interpolate(dof_handler, Displacement(), x); x_relevant = x; - MappingQEulerian euler( - 2, dof_handler, x_relevant); + MappingQEulerian euler(2, + dof_handler, + x_relevant); // now the actual test std::map> active_vertices = diff --git a/tests/mappings/mapping_q_manifold_01.cc b/tests/mappings/mapping_q_manifold_01.cc index bbd1ff72b9..b9fce8d637 100644 --- a/tests/mappings/mapping_q_manifold_01.cc +++ b/tests/mappings/mapping_q_manifold_01.cc @@ -113,7 +113,8 @@ template class VectorFunction : public Function { public: - VectorFunction(unsigned n_components) : Function(n_components) + VectorFunction(unsigned n_components) + : Function(n_components) {} virtual double value(const Point &p, const unsigned int component) const; diff --git a/tests/mappings/mapping_q_manifold_02.cc b/tests/mappings/mapping_q_manifold_02.cc index 0b365a4606..cbc3fab051 100644 --- a/tests/mappings/mapping_q_manifold_02.cc +++ b/tests/mappings/mapping_q_manifold_02.cc @@ -83,13 +83,13 @@ template class PushForward : public Function { public: - PushForward() : - Function(dim, 0.), - h(0.028), - x_max(4.5 * h), - y_max(2.036 * h), - z_max(4.5 * h), - y_FoR(h) + PushForward() + : Function(dim, 0.) + , h(0.028) + , x_max(4.5 * h) + , y_max(2.036 * h) + , z_max(4.5 * h) + , y_FoR(h) {} virtual ~PushForward(){}; @@ -140,13 +140,13 @@ template class PullBack : public Function { public: - PullBack() : - Function(dim, 0.), - h(0.028), - x_max(4.5 * h), - y_max(2.036 * h), - z_max(4.5 * h), - y_FoR(h) + PullBack() + : Function(dim, 0.) + , h(0.028) + , x_max(4.5 * h) + , y_max(2.036 * h) + , z_max(4.5 * h) + , y_FoR(h) {} virtual ~PullBack(){}; diff --git a/tests/matrix_free/assemble_matrix_03.cc b/tests/matrix_free/assemble_matrix_03.cc index 5f7cf40359..5709533553 100644 --- a/tests/matrix_free/assemble_matrix_03.cc +++ b/tests/matrix_free/assemble_matrix_03.cc @@ -49,26 +49,26 @@ namespace Assembly template struct Data { - Data(const FiniteElement &fe) : - fe_values(fe, - QGauss(fe.degree + 1), - update_values | update_gradients | update_JxW_values), - fe_eval(1, - FEEvaluation(fe, - QGauss<1>(fe.degree + 1), - fe_values.get_update_flags())), - cell_matrix(fe.dofs_per_cell, fe.dofs_per_cell), - test_matrix(cell_matrix) + Data(const FiniteElement &fe) + : fe_values(fe, + QGauss(fe.degree + 1), + update_values | update_gradients | update_JxW_values) + , fe_eval(1, + FEEvaluation(fe, + QGauss<1>(fe.degree + 1), + fe_values.get_update_flags())) + , cell_matrix(fe.dofs_per_cell, fe.dofs_per_cell) + , test_matrix(cell_matrix) {} - Data(const Data &data) : - fe_values(data.fe_values.get_mapping(), - data.fe_values.get_fe(), - data.fe_values.get_quadrature(), - data.fe_values.get_update_flags()), - fe_eval(data.fe_eval), - cell_matrix(data.cell_matrix), - test_matrix(data.test_matrix) + Data(const Data &data) + : fe_values(data.fe_values.get_mapping(), + data.fe_values.get_fe(), + data.fe_values.get_quadrature(), + data.fe_values.get_update_flags()) + , fe_eval(data.fe_eval) + , cell_matrix(data.cell_matrix) + , test_matrix(data.test_matrix) {} FEValues fe_values; diff --git a/tests/matrix_free/cell_categorization.cc b/tests/matrix_free/cell_categorization.cc index ee63c14997..1bbca99833 100644 --- a/tests/matrix_free/cell_categorization.cc +++ b/tests/matrix_free/cell_categorization.cc @@ -124,9 +124,10 @@ test() int main(int argc, char **argv) { - Utilities::MPI::MPI_InitFinalize mpi_init( - argc, argv, testing_max_num_threads()); - MPILogInitAll log; + Utilities::MPI::MPI_InitFinalize mpi_init(argc, + argv, + testing_max_num_threads()); + MPILogInitAll log; test<2>(); test<3>(); } diff --git a/tests/matrix_free/compare_faces_by_cells.cc b/tests/matrix_free/compare_faces_by_cells.cc index 3d8d2a73d2..e8fca4f1d2 100644 --- a/tests/matrix_free/compare_faces_by_cells.cc +++ b/tests/matrix_free/compare_faces_by_cells.cc @@ -97,8 +97,10 @@ public: { int dummy; result.zero_out_ghosts(); - data.cell_loop( - &LaplaceOperator::local_diagonal_by_cell, this, result, dummy); + data.cell_loop(&LaplaceOperator::local_diagonal_by_cell, + this, + result, + dummy); } void diff --git a/tests/matrix_free/compress_constraints.cc b/tests/matrix_free/compress_constraints.cc index cd26d9bc63..0dab05d8d2 100644 --- a/tests/matrix_free/compress_constraints.cc +++ b/tests/matrix_free/compress_constraints.cc @@ -76,8 +76,10 @@ test() dof.distribute_dofs(fe); ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); const QGauss<1> quad(2); diff --git a/tests/matrix_free/copy.cc b/tests/matrix_free/copy.cc index bf12b89341..2faa7bd80b 100644 --- a/tests/matrix_free/copy.cc +++ b/tests/matrix_free/copy.cc @@ -69,8 +69,10 @@ sub_test() dof.distribute_dofs(fe); ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); // std::cout << "Number of cells: " << diff --git a/tests/matrix_free/copy_feevaluation.cc b/tests/matrix_free/copy_feevaluation.cc index f227a815c7..ef2dff5d71 100644 --- a/tests/matrix_free/copy_feevaluation.cc +++ b/tests/matrix_free/copy_feevaluation.cc @@ -61,7 +61,8 @@ public: typedef typename DoFHandler::active_cell_iterator CellIterator; typedef double Number; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void local_apply(const MatrixFree & data, @@ -117,8 +118,10 @@ public: vmult(VectorType &dst, const VectorType &src) const { dst = 0; - data.cell_loop( - &MatrixFreeTest::local_apply, this, dst, src); + data.cell_loop(&MatrixFreeTest::local_apply, + this, + dst, + src); }; private: @@ -185,8 +188,9 @@ test() constraints_p.close(); std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block( - dof_handler, dofs_per_block, stokes_sub_blocks); + DoFTools::count_dofs_per_block(dof_handler, + dofs_per_block, + stokes_sub_blocks); // std::cout << "Number of active cells: " // << triangulation.n_active_cells() @@ -268,8 +272,9 @@ test() local_matrix(i, j) = local_matrix(j, i); cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - local_matrix, local_dof_indices, system_matrix); + constraints.distribute_local_to_global(local_matrix, + local_dof_indices, + system_matrix); } } diff --git a/tests/matrix_free/dg_pbc_02.cc b/tests/matrix_free/dg_pbc_02.cc index 51cf63dbd2..94eed1a597 100644 --- a/tests/matrix_free/dg_pbc_02.cc +++ b/tests/matrix_free/dg_pbc_02.cc @@ -53,8 +53,10 @@ test() p2[0] = 2; for (unsigned int d = 1; d < dim; ++d) p2[d] = 1; - GridGenerator::subdivided_hyper_rectangle( - tria, refinements, Point(), p2); + GridGenerator::subdivided_hyper_rectangle(tria, + refinements, + Point(), + p2); tria.begin()->face(0)->set_all_boundary_ids(10); tria.last()->face(1)->set_all_boundary_ids(11); @@ -146,9 +148,10 @@ test() int main(int argc, char **argv) { - Utilities::MPI::MPI_InitFinalize mpi_init( - argc, argv, testing_max_num_threads()); - MPILogInitAll log; + Utilities::MPI::MPI_InitFinalize mpi_init(argc, + argv, + testing_max_num_threads()); + MPILogInitAll log; deallog << std::setprecision(3); { diff --git a/tests/matrix_free/estimate_condition_number_mass.cc b/tests/matrix_free/estimate_condition_number_mass.cc index 6051129112..ef5bc79029 100644 --- a/tests/matrix_free/estimate_condition_number_mass.cc +++ b/tests/matrix_free/estimate_condition_number_mass.cc @@ -79,7 +79,8 @@ class MatrixFreeTest public: typedef VectorizedArray vector_t; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void vmult(Vector &dst, const Vector &src) const @@ -127,8 +128,10 @@ test(const FiniteElement &fe, const unsigned int n_iterations) MatrixFreeTest mf(mf_data); Vector in(dof.n_dofs()), out(dof.n_dofs()); - VectorTools::create_right_hand_side( - dof, QGauss(fe_degree + 1), Functions::CosineFunction(), in); + VectorTools::create_right_hand_side(dof, + QGauss(fe_degree + 1), + Functions::CosineFunction(), + in); // prescribe number of iterations in CG instead of tolerance. This is needed // to get the same test output on different platforms where roundoff errors diff --git a/tests/matrix_free/faces_value_optimization.cc b/tests/matrix_free/faces_value_optimization.cc index a730fc366e..80430fab51 100644 --- a/tests/matrix_free/faces_value_optimization.cc +++ b/tests/matrix_free/faces_value_optimization.cc @@ -36,7 +36,9 @@ template class MatrixFreeTest { public: - MatrixFreeTest(const MatrixFree &data) : data(data), error(2) + MatrixFreeTest(const MatrixFree &data) + : data(data) + , error(2) {} ~MatrixFreeTest() diff --git a/tests/matrix_free/faces_value_optimization_02.cc b/tests/matrix_free/faces_value_optimization_02.cc index 1b82a5c249..deac896895 100644 --- a/tests/matrix_free/faces_value_optimization_02.cc +++ b/tests/matrix_free/faces_value_optimization_02.cc @@ -37,7 +37,9 @@ template class MatrixFreeTest { public: - MatrixFreeTest(const MatrixFree &data) : data(data), error(2) + MatrixFreeTest(const MatrixFree &data) + : data(data) + , error(2) {} ~MatrixFreeTest() diff --git a/tests/matrix_free/get_functions_common.h b/tests/matrix_free/get_functions_common.h index 14d017accb..4445b61a66 100644 --- a/tests/matrix_free/get_functions_common.h +++ b/tests/matrix_free/get_functions_common.h @@ -61,19 +61,19 @@ template &data_in) : - data(data_in), - fe_val(data.get_dof_handler().get_fe(), - Quadrature(data.get_quadrature(0)), - update_values | update_gradients | update_hessians){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in) + , fe_val(data.get_dof_handler().get_fe(), + Quadrature(data.get_quadrature(0)), + update_values | update_gradients | update_hessians){}; MatrixFreeTest(const MatrixFree &data_in, - const Mapping & mapping) : - data(data_in), - fe_val(mapping, - data.get_dof_handler().get_fe(), - Quadrature(data.get_quadrature(0)), - update_values | update_gradients | update_hessians){}; + const Mapping & mapping) + : data(data_in) + , fe_val(mapping, + data.get_dof_handler().get_fe(), + Quadrature(data.get_quadrature(0)), + update_values | update_gradients | update_hessians){}; virtual ~MatrixFreeTest() {} diff --git a/tests/matrix_free/get_functions_faces.cc b/tests/matrix_free/get_functions_faces.cc index a539e1c0e4..a7993ad610 100644 --- a/tests/matrix_free/get_functions_faces.cc +++ b/tests/matrix_free/get_functions_faces.cc @@ -41,7 +41,8 @@ template class MatrixFreeTest { public: - MatrixFreeTest(const MatrixFree &data) : data(data) + MatrixFreeTest(const MatrixFree &data) + : data(data) {} void diff --git a/tests/matrix_free/get_functions_float.cc b/tests/matrix_free/get_functions_float.cc index ba454acf3a..c34b21fe87 100644 --- a/tests/matrix_free/get_functions_float.cc +++ b/tests/matrix_free/get_functions_float.cc @@ -57,8 +57,10 @@ test() ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 1, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 1, + Functions::ZeroFunction(), + constraints); constraints.close(); do_test(dof, constraints); diff --git a/tests/matrix_free/get_functions_multife.cc b/tests/matrix_free/get_functions_multife.cc index 5ddb36a977..8cbc4c7f84 100644 --- a/tests/matrix_free/get_functions_multife.cc +++ b/tests/matrix_free/get_functions_multife.cc @@ -56,14 +56,14 @@ class MatrixFreeTest public: typedef std::vector> VectorType; - MatrixFreeTest(const MatrixFree &data_in) : - data(data_in), - fe_val0(data.get_dof_handler(0).get_fe(), - Quadrature(data.get_quadrature(0)), - update_values | update_gradients | update_hessians), - fe_val1(data.get_dof_handler(1).get_fe(), - Quadrature(data.get_quadrature(1)), - update_values | update_gradients | update_hessians){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in) + , fe_val0(data.get_dof_handler(0).get_fe(), + Quadrature(data.get_quadrature(0)), + update_values | update_gradients | update_hessians) + , fe_val1(data.get_dof_handler(1).get_fe(), + Quadrature(data.get_quadrature(1)), + update_values | update_gradients | update_hessians){}; void operator()(const MatrixFree &data, @@ -72,8 +72,9 @@ public: const std::pair &cell_range) const { FEEvaluation fe_eval0(data, 0, 0); - FEEvaluation fe_eval1( - data, 1, 1); + FEEvaluation fe_eval1(data, + 1, + 1); std::vector reference_values0(fe_eval0.n_q_points); std::vector> reference_grads0(fe_eval0.n_q_points); std::vector> reference_hess0(fe_eval0.n_q_points); diff --git a/tests/matrix_free/get_functions_multife2.cc b/tests/matrix_free/get_functions_multife2.cc index 9a8777dda1..009d04ff06 100644 --- a/tests/matrix_free/get_functions_multife2.cc +++ b/tests/matrix_free/get_functions_multife2.cc @@ -58,17 +58,17 @@ class MatrixFreeTest public: typedef std::vector> VectorType; - MatrixFreeTest(const MatrixFree &data_in) : - data(data_in), - fe_val0(data.get_dof_handler(0).get_fe(), - Quadrature(data.get_quadrature(0)), - update_values | update_gradients | update_hessians), - fe_val1(data.get_dof_handler(1).get_fe(), - Quadrature(data.get_quadrature(1)), - update_values | update_gradients | update_hessians), - fe_val2(data.get_dof_handler(2).get_fe(), - Quadrature(data.get_quadrature(1)), - update_values | update_gradients | update_hessians){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in) + , fe_val0(data.get_dof_handler(0).get_fe(), + Quadrature(data.get_quadrature(0)), + update_values | update_gradients | update_hessians) + , fe_val1(data.get_dof_handler(1).get_fe(), + Quadrature(data.get_quadrature(1)), + update_values | update_gradients | update_hessians) + , fe_val2(data.get_dof_handler(2).get_fe(), + Quadrature(data.get_quadrature(1)), + update_values | update_gradients | update_hessians){}; void operator()(const MatrixFree &data, @@ -78,8 +78,9 @@ public: { FEEvaluation fe_eval0(data, 0, 0); FEEvaluation fe_eval1(data, 1, 1); - FEEvaluation fe_eval2( - data, 2, 1); + FEEvaluation fe_eval2(data, + 2, + 1); std::vector reference_values0(fe_eval0.n_q_points); std::vector> reference_grads0(fe_eval0.n_q_points); std::vector> reference_hess0(fe_eval0.n_q_points); diff --git a/tests/matrix_free/get_functions_notempl.cc b/tests/matrix_free/get_functions_notempl.cc index 8b49c4bdeb..c7beab690b 100644 --- a/tests/matrix_free/get_functions_notempl.cc +++ b/tests/matrix_free/get_functions_notempl.cc @@ -106,13 +106,21 @@ test() MatrixFree mf_data; if (fe_degree > 1) - sub_test( - dof, constraints, mf_data, solution); - sub_test( - dof, constraints, mf_data, solution); - sub_test( - dof, constraints, mf_data, solution); + sub_test(dof, + constraints, + mf_data, + solution); + sub_test(dof, + constraints, + mf_data, + solution); + sub_test(dof, + constraints, + mf_data, + solution); if (dim == 2) - sub_test( - dof, constraints, mf_data, solution); + sub_test(dof, + constraints, + mf_data, + solution); } diff --git a/tests/matrix_free/get_functions_rect.cc b/tests/matrix_free/get_functions_rect.cc index eec545f03c..051d2a734c 100644 --- a/tests/matrix_free/get_functions_rect.cc +++ b/tests/matrix_free/get_functions_rect.cc @@ -106,13 +106,21 @@ test() MatrixFree mf_data; if (fe_degree > 1) - sub_test( - dof, constraints, mf_data, solution); - sub_test( - dof, constraints, mf_data, solution); - sub_test( - dof, constraints, mf_data, solution); + sub_test(dof, + constraints, + mf_data, + solution); + sub_test(dof, + constraints, + mf_data, + solution); + sub_test(dof, + constraints, + mf_data, + solution); if (dim == 2) - sub_test( - dof, constraints, mf_data, solution); + sub_test(dof, + constraints, + mf_data, + solution); } diff --git a/tests/matrix_free/get_functions_variants.cc b/tests/matrix_free/get_functions_variants.cc index e3696d3487..9e7ccedbe9 100644 --- a/tests/matrix_free/get_functions_variants.cc +++ b/tests/matrix_free/get_functions_variants.cc @@ -51,7 +51,8 @@ class MatrixFreeTest public: typedef Vector VectorType; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void operator()(const MatrixFree & data, diff --git a/tests/matrix_free/get_functions_variants_gl.cc b/tests/matrix_free/get_functions_variants_gl.cc index 9bbb123da3..cf929defe8 100644 --- a/tests/matrix_free/get_functions_variants_gl.cc +++ b/tests/matrix_free/get_functions_variants_gl.cc @@ -47,7 +47,8 @@ class MatrixFreeTest public: typedef Vector VectorType; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void operator()(const MatrixFree & data, diff --git a/tests/matrix_free/get_values_plain.cc b/tests/matrix_free/get_values_plain.cc index 8abcee1851..5718245f91 100644 --- a/tests/matrix_free/get_values_plain.cc +++ b/tests/matrix_free/get_values_plain.cc @@ -54,7 +54,8 @@ template &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; // make function virtual to allow derived // classes to define a different function @@ -178,8 +179,10 @@ test() ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 1, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 1, + Functions::ZeroFunction(), + constraints); constraints.close(); do_test(dof, constraints); diff --git a/tests/matrix_free/integrate_functions.cc b/tests/matrix_free/integrate_functions.cc index 8fa0510a3e..d09c3c8c24 100644 --- a/tests/matrix_free/integrate_functions.cc +++ b/tests/matrix_free/integrate_functions.cc @@ -52,11 +52,11 @@ class MatrixFreeTest public: typedef std::vector *> VectorType; - MatrixFreeTest(const MatrixFree &data_in) : - data(data_in), - fe_val(data.get_dof_handler().get_fe(), - Quadrature(data.get_quadrature(0)), - update_values | update_gradients | update_JxW_values){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in) + , fe_val(data.get_dof_handler().get_fe(), + Quadrature(data.get_quadrature(0)), + update_values | update_gradients | update_JxW_values){}; void operator()(const MatrixFree & data, diff --git a/tests/matrix_free/integrate_functions_multife.cc b/tests/matrix_free/integrate_functions_multife.cc index e053ff568f..6d9908a1c2 100644 --- a/tests/matrix_free/integrate_functions_multife.cc +++ b/tests/matrix_free/integrate_functions_multife.cc @@ -53,17 +53,17 @@ class MatrixFreeTest public: typedef std::vector> VectorType; - MatrixFreeTest(const MatrixFree &data_in) : - data(data_in), - fe_val0(data.get_dof_handler(0).get_fe(), - Quadrature(data.get_quadrature(0)), - update_values | update_gradients | update_JxW_values), - fe_val01(data.get_dof_handler(0).get_fe(), - Quadrature(data.get_quadrature(1)), - update_values | update_gradients | update_JxW_values), - fe_val1(data.get_dof_handler(1).get_fe(), - Quadrature(data.get_quadrature(1)), - update_values | update_gradients | update_JxW_values){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in) + , fe_val0(data.get_dof_handler(0).get_fe(), + Quadrature(data.get_quadrature(0)), + update_values | update_gradients | update_JxW_values) + , fe_val01(data.get_dof_handler(0).get_fe(), + Quadrature(data.get_quadrature(1)), + update_values | update_gradients | update_JxW_values) + , fe_val1(data.get_dof_handler(1).get_fe(), + Quadrature(data.get_quadrature(1)), + update_values | update_gradients | update_JxW_values){}; void operator()(const MatrixFree & data, @@ -101,8 +101,9 @@ operator()(const MatrixFree &data, const std::pair &cell_range) const { FEEvaluation fe_eval0(data, 0, 0); - FEEvaluation fe_eval1( - data, 1, 1); + FEEvaluation fe_eval1(data, + 1, + 1); FEEvaluation fe_eval01(data, 0, 1); const unsigned int n_q_points0 = fe_eval0.n_q_points; const unsigned int n_q_points1 = fe_eval1.n_q_points; diff --git a/tests/matrix_free/integrate_functions_multife2.cc b/tests/matrix_free/integrate_functions_multife2.cc index 8a13defb75..51f9eb441b 100644 --- a/tests/matrix_free/integrate_functions_multife2.cc +++ b/tests/matrix_free/integrate_functions_multife2.cc @@ -55,17 +55,17 @@ class MatrixFreeTest public: typedef std::vector> VectorType; - MatrixFreeTest(const MatrixFree &data_in) : - data(data_in), - fe_val0(data.get_dof_handler(0).get_fe(), - Quadrature(data.get_quadrature(0)), - update_values | update_gradients | update_JxW_values), - fe_val01(data.get_dof_handler(0).get_fe(), - Quadrature(data.get_quadrature(1)), - update_values | update_gradients | update_JxW_values), - fe_val1(data.get_dof_handler(1).get_fe(), - Quadrature(data.get_quadrature(1)), - update_values | update_gradients | update_JxW_values){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in) + , fe_val0(data.get_dof_handler(0).get_fe(), + Quadrature(data.get_quadrature(0)), + update_values | update_gradients | update_JxW_values) + , fe_val01(data.get_dof_handler(0).get_fe(), + Quadrature(data.get_quadrature(1)), + update_values | update_gradients | update_JxW_values) + , fe_val1(data.get_dof_handler(1).get_fe(), + Quadrature(data.get_quadrature(1)), + update_values | update_gradients | update_JxW_values){}; void operator()(const MatrixFree & data, diff --git a/tests/matrix_free/interpolate_functions_common.h b/tests/matrix_free/interpolate_functions_common.h index 751fdabc91..a2fe989ef3 100644 --- a/tests/matrix_free/interpolate_functions_common.h +++ b/tests/matrix_free/interpolate_functions_common.h @@ -60,11 +60,12 @@ template &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; MatrixFreeTest(const MatrixFree &data_in, - const Mapping & mapping) : - data(data_in){}; + const Mapping & mapping) + : data(data_in){}; virtual ~MatrixFreeTest() {} diff --git a/tests/matrix_free/interpolate_to_mg.cc b/tests/matrix_free/interpolate_to_mg.cc index 846a712e6c..b90f8c28a2 100644 --- a/tests/matrix_free/interpolate_to_mg.cc +++ b/tests/matrix_free/interpolate_to_mg.cc @@ -74,7 +74,8 @@ template class SimpleField : public Function { public: - SimpleField() : Function(1) + SimpleField() + : Function(1) {} double @@ -143,8 +144,9 @@ test(const unsigned int n_glob_ref = 2, const unsigned int n_ref = 0) // interpolate: LinearAlgebra::distributed::Vector fine_projection; - fine_projection.reinit( - locally_owned_dofs, locally_relevant_dofs, mpi_communicator); + fine_projection.reinit(locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); VectorTools::project(dof_handler, constraints, QGauss(n_q_points + 2), @@ -171,8 +173,10 @@ test(const unsigned int n_glob_ref = 2, const unsigned int n_ref = 0) const std::string mg_mesh = "mg_mesh"; GridOut grid_out; - grid_out.write_mesh_per_processor_as_vtu( - triangulation, mg_mesh, true, true); + grid_out.write_mesh_per_processor_as_vtu(triangulation, + mg_mesh, + true, + true); } // MG hanging node constraints @@ -197,8 +201,9 @@ test(const unsigned int n_glob_ref = 2, const unsigned int n_ref = 0) QGauss quadrature(n_q_points); std::vector q_values(quadrature.size()); - FEValues fe_values( - fe, quadrature, update_values | update_quadrature_points); + FEValues fe_values(fe, + quadrature, + update_values | update_quadrature_points); for (unsigned int level = max_level + 1; level != min_level;) { --level; @@ -211,8 +216,9 @@ test(const unsigned int n_glob_ref = 2, const unsigned int n_ref = 0) { fe_values.reinit(cell); cell->get_mg_dof_indices(dof_indices); - fe_values.get_function_values( - level_projection[level], dof_indices, q_values); + fe_values.get_function_values(level_projection[level], + dof_indices, + q_values); const std::vector> &q_points = fe_values.get_quadrature_points(); diff --git a/tests/matrix_free/inverse_mass_01.cc b/tests/matrix_free/inverse_mass_01.cc index 06cd44608f..74b38e258d 100644 --- a/tests/matrix_free/inverse_mass_01.cc +++ b/tests/matrix_free/inverse_mass_01.cc @@ -51,7 +51,8 @@ template &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void local_mass_operator( diff --git a/tests/matrix_free/inverse_mass_02.cc b/tests/matrix_free/inverse_mass_02.cc index 1dbcead2b3..14d12aba05 100644 --- a/tests/matrix_free/inverse_mass_02.cc +++ b/tests/matrix_free/inverse_mass_02.cc @@ -51,7 +51,8 @@ template &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void local_mass_operator( diff --git a/tests/matrix_free/inverse_mass_03.cc b/tests/matrix_free/inverse_mass_03.cc index 75789f0dc4..9881fb80df 100644 --- a/tests/matrix_free/inverse_mass_03.cc +++ b/tests/matrix_free/inverse_mass_03.cc @@ -52,7 +52,8 @@ template &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void local_mass_operator( diff --git a/tests/matrix_free/laplace_operator_01.cc b/tests/matrix_free/laplace_operator_01.cc index 7fbb19245a..ed68f122d2 100644 --- a/tests/matrix_free/laplace_operator_01.cc +++ b/tests/matrix_free/laplace_operator_01.cc @@ -93,8 +93,10 @@ test() ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); deallog << "Testing " << dof.get_fe().get_name() << std::endl; @@ -143,20 +145,21 @@ test() TrilinosWrappers::SparseMatrix sparse_matrix; { TrilinosWrappers::SparsityPattern csp(owned_set, MPI_COMM_WORLD); - DoFTools::make_sparsity_pattern( - dof, - csp, - constraints, - true, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(dof, + csp, + constraints, + true, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); csp.compress(); sparse_matrix.reinit(csp); } { QGauss quadrature_formula(fe_degree + 1); - FEValues fe_values( - dof.get_fe(), quadrature_formula, update_gradients | update_JxW_values); + FEValues fe_values(dof.get_fe(), + quadrature_formula, + update_gradients | update_JxW_values); const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); @@ -182,8 +185,9 @@ test() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } sparse_matrix.compress(VectorOperation::add); diff --git a/tests/matrix_free/laplace_operator_02.cc b/tests/matrix_free/laplace_operator_02.cc index 31f19ce3f1..81c2c65807 100644 --- a/tests/matrix_free/laplace_operator_02.cc +++ b/tests/matrix_free/laplace_operator_02.cc @@ -48,9 +48,9 @@ template class F : public Function { public: - F(const unsigned int q, const unsigned int n_components) : - Function(n_components), - q(q) + F(const unsigned int q, const unsigned int n_components) + : Function(n_components) + , q(q) {} virtual double @@ -134,8 +134,10 @@ test() ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); deallog << "Testing " << dof.get_fe().get_name() << std::endl; @@ -204,12 +206,12 @@ test() TrilinosWrappers::SparseMatrix sparse_matrix; { TrilinosWrappers::SparsityPattern csp(owned_set, MPI_COMM_WORLD); - DoFTools::make_sparsity_pattern( - dof, - csp, - constraints, - true, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(dof, + csp, + constraints, + true, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); csp.compress(); sparse_matrix.reinit(csp); } @@ -247,8 +249,9 @@ test() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } sparse_matrix.compress(VectorOperation::add); diff --git a/tests/matrix_free/mass_operator_01.cc b/tests/matrix_free/mass_operator_01.cc index 0185f7912c..b2354fb0f4 100644 --- a/tests/matrix_free/mass_operator_01.cc +++ b/tests/matrix_free/mass_operator_01.cc @@ -101,8 +101,10 @@ test() ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); deallog << "Testing " << dof.get_fe().get_name() << std::endl; @@ -150,12 +152,12 @@ test() TrilinosWrappers::SparseMatrix sparse_matrix; { TrilinosWrappers::SparsityPattern csp(owned_set, MPI_COMM_WORLD); - DoFTools::make_sparsity_pattern( - dof, - csp, - constraints, - true, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(dof, + csp, + constraints, + true, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); csp.compress(); sparse_matrix.reinit(csp); } @@ -191,8 +193,9 @@ test() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } sparse_matrix.compress(VectorOperation::add); diff --git a/tests/matrix_free/mass_operator_02.cc b/tests/matrix_free/mass_operator_02.cc index f52d7247d2..207393acd2 100644 --- a/tests/matrix_free/mass_operator_02.cc +++ b/tests/matrix_free/mass_operator_02.cc @@ -66,8 +66,10 @@ test() ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); deallog << "Testing " << dof.get_fe().get_name() << std::endl; @@ -118,12 +120,12 @@ test() TrilinosWrappers::SparseMatrix sparse_matrix; { TrilinosWrappers::SparsityPattern csp(owned_set, MPI_COMM_WORLD); - DoFTools::make_sparsity_pattern( - dof, - csp, - constraints, - true, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(dof, + csp, + constraints, + true, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); csp.compress(); sparse_matrix.reinit(csp); } @@ -159,8 +161,9 @@ test() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } sparse_matrix.compress(VectorOperation::add); diff --git a/tests/matrix_free/mass_operator_03.cc b/tests/matrix_free/mass_operator_03.cc index d378e9f0cb..bad1d17b4b 100644 --- a/tests/matrix_free/mass_operator_03.cc +++ b/tests/matrix_free/mass_operator_03.cc @@ -117,12 +117,12 @@ test() TrilinosWrappers::SparseMatrix sparse_matrix; { TrilinosWrappers::SparsityPattern csp(owned_set, MPI_COMM_WORLD); - DoFTools::make_sparsity_pattern( - dof, - csp, - constraints, - true, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(dof, + csp, + constraints, + true, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); csp.compress(); sparse_matrix.reinit(csp); } @@ -158,8 +158,9 @@ test() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } sparse_matrix.compress(VectorOperation::add); diff --git a/tests/matrix_free/mass_operator_04.cc b/tests/matrix_free/mass_operator_04.cc index 7e49b1c74e..99361c7e37 100644 --- a/tests/matrix_free/mass_operator_04.cc +++ b/tests/matrix_free/mass_operator_04.cc @@ -60,8 +60,10 @@ test() DoFTools::extract_locally_relevant_dofs(dof, relevant_set); ConstraintMatrix constraints_0(relevant_set), constraints_1(relevant_set); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints_0); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints_0); constraints_0.close(); constraints_1.close(); diff --git a/tests/matrix_free/matrix_vector_02.cc b/tests/matrix_free/matrix_vector_02.cc index e97934222c..6a2377c3fa 100644 --- a/tests/matrix_free/matrix_vector_02.cc +++ b/tests/matrix_free/matrix_vector_02.cc @@ -41,8 +41,10 @@ test() DoFHandler dof(tria); dof.distribute_dofs(fe); ConstraintMatrix constraints; - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); do_test(dof, constraints); diff --git a/tests/matrix_free/matrix_vector_03.cc b/tests/matrix_free/matrix_vector_03.cc index a92ebaee84..241a534728 100644 --- a/tests/matrix_free/matrix_vector_03.cc +++ b/tests/matrix_free/matrix_vector_03.cc @@ -68,8 +68,10 @@ test() dof.distribute_dofs(fe); ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); do_test(dof, constraints); diff --git a/tests/matrix_free/matrix_vector_06.cc b/tests/matrix_free/matrix_vector_06.cc index 02d0ad0521..4cf774e549 100644 --- a/tests/matrix_free/matrix_vector_06.cc +++ b/tests/matrix_free/matrix_vector_06.cc @@ -68,8 +68,10 @@ test() dof.distribute_dofs(fe); ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); do_test(dof, constraints); diff --git a/tests/matrix_free/matrix_vector_06_notempl.cc b/tests/matrix_free/matrix_vector_06_notempl.cc index 291d956bee..3eefec09ec 100644 --- a/tests/matrix_free/matrix_vector_06_notempl.cc +++ b/tests/matrix_free/matrix_vector_06_notempl.cc @@ -64,8 +64,10 @@ test() dof.distribute_dofs(fe); ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); // do not enable templates in FEEvaluation diff --git a/tests/matrix_free/matrix_vector_07.cc b/tests/matrix_free/matrix_vector_07.cc index 4b2118db15..13c628353d 100644 --- a/tests/matrix_free/matrix_vector_07.cc +++ b/tests/matrix_free/matrix_vector_07.cc @@ -86,8 +86,10 @@ test() // only interior DoFs on the elements, but try // anyway DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); do_test(dof, constraints); diff --git a/tests/matrix_free/matrix_vector_08.cc b/tests/matrix_free/matrix_vector_08.cc index 4d91936471..1263b68ba1 100644 --- a/tests/matrix_free/matrix_vector_08.cc +++ b/tests/matrix_free/matrix_vector_08.cc @@ -67,8 +67,10 @@ test() dof.distribute_dofs(fe); ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); do_test(dof, constraints); diff --git a/tests/matrix_free/matrix_vector_09.cc b/tests/matrix_free/matrix_vector_09.cc index 653a448d37..49597338cc 100644 --- a/tests/matrix_free/matrix_vector_09.cc +++ b/tests/matrix_free/matrix_vector_09.cc @@ -66,8 +66,10 @@ test() dof.distribute_dofs(fe); ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); do_test(dof, constraints); diff --git a/tests/matrix_free/matrix_vector_10.cc b/tests/matrix_free/matrix_vector_10.cc index aa5c20b50f..32700b6f3d 100644 --- a/tests/matrix_free/matrix_vector_10.cc +++ b/tests/matrix_free/matrix_vector_10.cc @@ -99,8 +99,10 @@ test() ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); deallog << "Testing " << dof.get_fe().get_name() << std::endl; @@ -145,12 +147,12 @@ test() TrilinosWrappers::SparseMatrix sparse_matrix; { TrilinosWrappers::SparsityPattern csp(owned_set, MPI_COMM_WORLD); - DoFTools::make_sparsity_pattern( - dof, - csp, - constraints, - true, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(dof, + csp, + constraints, + true, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); csp.compress(); sparse_matrix.reinit(csp); } @@ -189,8 +191,9 @@ test() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } sparse_matrix.compress(VectorOperation::add); diff --git a/tests/matrix_free/matrix_vector_11.cc b/tests/matrix_free/matrix_vector_11.cc index ccd69cdaf3..b3a108de23 100644 --- a/tests/matrix_free/matrix_vector_11.cc +++ b/tests/matrix_free/matrix_vector_11.cc @@ -92,8 +92,10 @@ test() ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); deallog << "Testing " << dof.get_fe().get_name() << std::endl; diff --git a/tests/matrix_free/matrix_vector_12.cc b/tests/matrix_free/matrix_vector_12.cc index b457a01443..d8724a0d02 100644 --- a/tests/matrix_free/matrix_vector_12.cc +++ b/tests/matrix_free/matrix_vector_12.cc @@ -66,8 +66,9 @@ helmholtz_operator( fe_eval.evaluate(true, true, false); for (unsigned int q = 0; q < n_q_points; ++q) { - fe_eval.submit_value( - make_vectorized_array(Number(10)) * fe_eval.get_value(q), q); + fe_eval.submit_value(make_vectorized_array(Number(10)) * + fe_eval.get_value(q), + q); fe_eval.submit_gradient(fe_eval.get_gradient(q), q); } fe_eval.integrate(true, true); @@ -85,7 +86,8 @@ public: static const std::size_t n_vectors = VectorizedArray::n_array_elements; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void vmult( @@ -94,11 +96,11 @@ public: { for (unsigned int i = 0; i < dst.size(); ++i) dst[i] = 0; - const std::function &, - std::vector> &, - const std::vector> &, - const std::pair &)> + const std::function< + void(const MatrixFree &, + std::vector> &, + const std::vector> &, + const std::pair &)> wrap = helmholtz_operator; data.cell_loop(wrap, dst, src); }; @@ -157,8 +159,10 @@ test() ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); deallog << "Testing " << dof.get_fe().get_name() << std::endl; @@ -204,12 +208,12 @@ test() TrilinosWrappers::SparseMatrix sparse_matrix; { TrilinosWrappers::SparsityPattern csp(owned_set, MPI_COMM_WORLD); - DoFTools::make_sparsity_pattern( - dof, - csp, - constraints, - true, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(dof, + csp, + constraints, + true, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); csp.compress(); sparse_matrix.reinit(csp); } @@ -248,8 +252,9 @@ test() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } sparse_matrix.compress(VectorOperation::add); diff --git a/tests/matrix_free/matrix_vector_13.cc b/tests/matrix_free/matrix_vector_13.cc index 995ad922a8..f371d2bca7 100644 --- a/tests/matrix_free/matrix_vector_13.cc +++ b/tests/matrix_free/matrix_vector_13.cc @@ -66,8 +66,9 @@ helmholtz_operator(const MatrixFree & data, fe_eval.evaluate(true, true, false); for (unsigned int q = 0; q < n_q_points; ++q) { - fe_eval.submit_value( - make_vectorized_array(Number(10)) * fe_eval.get_value(q), q); + fe_eval.submit_value(make_vectorized_array(Number(10)) * + fe_eval.get_value(q), + q); fe_eval.submit_gradient(fe_eval.get_gradient(q), q); } fe_eval.integrate(true, true); @@ -85,18 +86,19 @@ public: static const std::size_t n_vectors = VectorizedArray::n_array_elements; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void vmult(LinearAlgebra::distributed::BlockVector & dst, const LinearAlgebra::distributed::BlockVector &src) const { dst = 0; - const std::function &, - LinearAlgebra::distributed::BlockVector &, - const LinearAlgebra::distributed::BlockVector &, - const std::pair &)> + const std::function< + void(const MatrixFree &, + LinearAlgebra::distributed::BlockVector &, + const LinearAlgebra::distributed::BlockVector &, + const std::pair &)> wrap = helmholtz_operator; data.cell_loop(wrap, dst, src); }; @@ -155,8 +157,10 @@ test() ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); deallog << "Testing " << dof.get_fe().get_name() << std::endl; @@ -244,8 +248,9 @@ test() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } sparse_matrix.compress(VectorOperation::add); diff --git a/tests/matrix_free/matrix_vector_15.cc b/tests/matrix_free/matrix_vector_15.cc index 5a1de2b98e..de44ac2f8b 100644 --- a/tests/matrix_free/matrix_vector_15.cc +++ b/tests/matrix_free/matrix_vector_15.cc @@ -55,9 +55,9 @@ class MatrixFreeTest { public: MatrixFreeTest(const DoFHandler & dof_handler, - const ConstraintMatrix &constraints) : - dof_handler(dof_handler), - constraints(constraints) + const ConstraintMatrix &constraints) + : dof_handler(dof_handler) + , constraints(constraints) {} void @@ -168,8 +168,9 @@ do_test(const DoFHandler & dof, } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } @@ -213,8 +214,10 @@ test() dof.distribute_dofs(fe); ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); do_test(dof, constraints); diff --git a/tests/matrix_free/matrix_vector_16.cc b/tests/matrix_free/matrix_vector_16.cc index 4c0eb98032..83b4ff2a2e 100644 --- a/tests/matrix_free/matrix_vector_16.cc +++ b/tests/matrix_free/matrix_vector_16.cc @@ -55,9 +55,9 @@ class MatrixFreeTest { public: MatrixFreeTest(const DoFHandler & dof_handler, - const ConstraintMatrix &constraints) : - dof_handler(dof_handler), - constraints(constraints) + const ConstraintMatrix &constraints) + : dof_handler(dof_handler) + , constraints(constraints) {} void @@ -80,8 +80,9 @@ public: fe_eval.evaluate(true, true, false); for (unsigned int q = 0; q < fe_eval.n_q_points; ++q) { - fe_eval.submit_value( - make_vectorized_array(10.) * fe_eval.get_value(q), q); + fe_eval.submit_value(make_vectorized_array(10.) * + fe_eval.get_value(q), + q); fe_eval.submit_gradient(fe_eval.get_gradient(q), q); } fe_eval.integrate(true, true); @@ -173,8 +174,9 @@ do_test(const DoFHandler & dof, } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } @@ -219,8 +221,10 @@ test() dof.distribute_dofs(fe); ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(dim), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(dim), + constraints); constraints.close(); do_test(dof, constraints); diff --git a/tests/matrix_free/matrix_vector_17.cc b/tests/matrix_free/matrix_vector_17.cc index 4c852191d2..265480b70d 100644 --- a/tests/matrix_free/matrix_vector_17.cc +++ b/tests/matrix_free/matrix_vector_17.cc @@ -61,8 +61,10 @@ test() dof.distribute_dofs(fe); ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); do_test(dof, constraints); diff --git a/tests/matrix_free/matrix_vector_18.cc b/tests/matrix_free/matrix_vector_18.cc index 704479b9f9..e6e79b8643 100644 --- a/tests/matrix_free/matrix_vector_18.cc +++ b/tests/matrix_free/matrix_vector_18.cc @@ -53,7 +53,8 @@ template &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void vmult(VectorType &dst, const VectorType &src) const @@ -200,8 +201,9 @@ do_test(const DoFHandler & dof, } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } @@ -237,8 +239,10 @@ test() dof.distribute_dofs(fe); ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); do_test(dof, constraints); diff --git a/tests/matrix_free/matrix_vector_19.cc b/tests/matrix_free/matrix_vector_19.cc index 7bb1a332c1..b3ad568614 100644 --- a/tests/matrix_free/matrix_vector_19.cc +++ b/tests/matrix_free/matrix_vector_19.cc @@ -93,8 +93,10 @@ test() ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); deallog << "Testing " << dof.get_fe().get_name() << std::endl; @@ -139,12 +141,12 @@ test() TrilinosWrappers::SparseMatrix sparse_matrix; { TrilinosWrappers::SparsityPattern csp(owned_set, MPI_COMM_WORLD); - DoFTools::make_sparsity_pattern( - dof, - csp, - constraints, - true, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(dof, + csp, + constraints, + true, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); csp.compress(); sparse_matrix.reinit(csp); } @@ -183,8 +185,9 @@ test() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } sparse_matrix.compress(VectorOperation::add); diff --git a/tests/matrix_free/matrix_vector_20.cc b/tests/matrix_free/matrix_vector_20.cc index 9e8fa7215c..7482cd6042 100644 --- a/tests/matrix_free/matrix_vector_20.cc +++ b/tests/matrix_free/matrix_vector_20.cc @@ -72,11 +72,13 @@ helmholtz_operator(const MatrixFree & data, phi1.evaluate(true, true, false); for (unsigned int q = 0; q < n_q_points; ++q) { - phi0.submit_value( - make_vectorized_array(Number(10)) * phi0.get_value(q), q); + phi0.submit_value(make_vectorized_array(Number(10)) * + phi0.get_value(q), + q); phi0.submit_gradient(phi0.get_gradient(q), q); - phi1.submit_value( - make_vectorized_array(Number(10)) * phi1.get_value(q), q); + phi1.submit_value(make_vectorized_array(Number(10)) * + phi1.get_value(q), + q); phi1.submit_gradient(phi1.get_gradient(q), q); } phi0.integrate(true, true); @@ -96,7 +98,8 @@ public: static const std::size_t n_vectors = VectorizedArray::n_array_elements; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void vmult(LinearAlgebra::distributed::BlockVector & dst, @@ -104,11 +107,11 @@ public: { for (unsigned int i = 0; i < dst.size(); ++i) dst[i] = 0; - const std::function &, - LinearAlgebra::distributed::BlockVector &, - const LinearAlgebra::distributed::BlockVector &, - const std::pair &)> + const std::function< + void(const MatrixFree &, + LinearAlgebra::distributed::BlockVector &, + const LinearAlgebra::distributed::BlockVector &, + const std::pair &)> wrap = helmholtz_operator; data.cell_loop(wrap, dst, src); }; @@ -159,8 +162,10 @@ test() ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); deallog << "Testing " << dof.get_fe().get_name() << std::endl; @@ -247,8 +252,9 @@ test() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } diff --git a/tests/matrix_free/matrix_vector_21.cc b/tests/matrix_free/matrix_vector_21.cc index 333d2d2e53..b9ed684ac8 100644 --- a/tests/matrix_free/matrix_vector_21.cc +++ b/tests/matrix_free/matrix_vector_21.cc @@ -68,8 +68,9 @@ helmholtz_operator(const MatrixFree & data, fe_eval.evaluate(true, true, false); for (unsigned int q = 0; q < n_q_points; ++q) { - fe_eval.submit_value( - make_vectorized_array(Number(10)) * fe_eval.get_value(q), q); + fe_eval.submit_value(make_vectorized_array(Number(10)) * + fe_eval.get_value(q), + q); fe_eval.submit_gradient(fe_eval.get_gradient(q), q); } fe_eval.integrate(true, true); @@ -87,7 +88,8 @@ public: static const std::size_t n_vectors = VectorizedArray::n_array_elements; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void vmult(LinearAlgebra::distributed::BlockVector & dst, @@ -95,11 +97,11 @@ public: { for (unsigned int i = 0; i < dst.size(); ++i) dst[i] = 0; - const std::function &, - LinearAlgebra::distributed::BlockVector &, - const LinearAlgebra::distributed::BlockVector &, - const std::pair &)> + const std::function< + void(const MatrixFree &, + LinearAlgebra::distributed::BlockVector &, + const LinearAlgebra::distributed::BlockVector &, + const std::pair &)> wrap = helmholtz_operator; data.cell_loop(wrap, dst, src); }; @@ -150,8 +152,10 @@ test() ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); deallog << "Testing " << dof.get_fe().get_name() << std::endl; @@ -238,8 +242,9 @@ test() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } diff --git a/tests/matrix_free/matrix_vector_22.cc b/tests/matrix_free/matrix_vector_22.cc index 82684a3d3b..8c35881be5 100644 --- a/tests/matrix_free/matrix_vector_22.cc +++ b/tests/matrix_free/matrix_vector_22.cc @@ -67,8 +67,9 @@ helmholtz_operator( fe_eval.evaluate(true, true, false); for (unsigned int q = 0; q < n_q_points; ++q) { - fe_eval.submit_value( - make_vectorized_array(Number(10)) * fe_eval.get_value(q), q); + fe_eval.submit_value(make_vectorized_array(Number(10)) * + fe_eval.get_value(q), + q); fe_eval.submit_gradient(fe_eval.get_gradient(q), q); } fe_eval.integrate(true, true); @@ -86,7 +87,8 @@ public: static const std::size_t n_vectors = VectorizedArray::n_array_elements; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void vmult( @@ -95,11 +97,11 @@ public: { for (unsigned int i = 0; i < dst.size(); ++i) *dst[i] = 0; - const std::function &, - std::vector *> &, - const std::vector *> &, - const std::pair &)> + const std::function< + void(const MatrixFree &, + std::vector *> &, + const std::vector *> &, + const std::pair &)> wrap = helmholtz_operator; data.cell_loop(wrap, dst, src); }; @@ -158,8 +160,10 @@ test() ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); deallog << "Testing " << dof.get_fe().get_name() << std::endl; @@ -211,12 +215,12 @@ test() TrilinosWrappers::SparseMatrix sparse_matrix; { TrilinosWrappers::SparsityPattern csp(owned_set, MPI_COMM_WORLD); - DoFTools::make_sparsity_pattern( - dof, - csp, - constraints, - true, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(dof, + csp, + constraints, + true, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); csp.compress(); sparse_matrix.reinit(csp); } @@ -255,8 +259,9 @@ test() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } sparse_matrix.compress(VectorOperation::add); diff --git a/tests/matrix_free/matrix_vector_23.cc b/tests/matrix_free/matrix_vector_23.cc index 487db37922..a7cc82e9ae 100644 --- a/tests/matrix_free/matrix_vector_23.cc +++ b/tests/matrix_free/matrix_vector_23.cc @@ -72,11 +72,13 @@ helmholtz_operator( fe_eval.evaluate(true, true, false); for (unsigned int q = 0; q < n_q_points; ++q) { - fe_eval.submit_value( - make_vectorized_array(Number(10)) * fe_eval.get_value(q), q); + fe_eval.submit_value(make_vectorized_array(Number(10)) * + fe_eval.get_value(q), + q); fe_eval.submit_gradient(fe_eval.get_gradient(q), q); - fe_eval2.submit_value( - make_vectorized_array(Number(10)) * fe_eval2.get_value(q), q); + fe_eval2.submit_value(make_vectorized_array(Number(10)) * + fe_eval2.get_value(q), + q); fe_eval2.submit_gradient(fe_eval2.get_gradient(q), q); } fe_eval2.integrate(true, true); @@ -97,7 +99,8 @@ public: static const std::size_t n_vectors = VectorizedArray::n_array_elements; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void vmult( @@ -106,11 +109,11 @@ public: { for (unsigned int i = 0; i < dst.size(); ++i) *dst[i] = 0; - const std::function &, - std::vector *> &, - const std::vector *> &, - const std::pair &)> + const std::function< + void(const MatrixFree &, + std::vector *> &, + const std::vector *> &, + const std::pair &)> wrap = helmholtz_operator; data.cell_loop(wrap, dst, src); }; @@ -169,8 +172,10 @@ test() ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); deallog << "Testing " << dof.get_fe().get_name() << std::endl; @@ -224,12 +229,12 @@ test() TrilinosWrappers::SparseMatrix sparse_matrix; { TrilinosWrappers::SparsityPattern csp(owned_set, MPI_COMM_WORLD); - DoFTools::make_sparsity_pattern( - dof, - csp, - constraints, - true, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(dof, + csp, + constraints, + true, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); csp.compress(); sparse_matrix.reinit(csp); } @@ -268,8 +273,9 @@ test() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } sparse_matrix.compress(VectorOperation::add); diff --git a/tests/matrix_free/matrix_vector_blocks.cc b/tests/matrix_free/matrix_vector_blocks.cc index 585622ab83..4d65fa5226 100644 --- a/tests/matrix_free/matrix_vector_blocks.cc +++ b/tests/matrix_free/matrix_vector_blocks.cc @@ -48,7 +48,8 @@ template class MatrixFreeBlock { public: - MatrixFreeBlock(const MatrixFree &data_in) : data(data_in) + MatrixFreeBlock(const MatrixFree &data_in) + : data(data_in) {} void @@ -133,8 +134,10 @@ test() ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); deallog << "Testing " << dof.get_fe().get_name() << std::endl; diff --git a/tests/matrix_free/matrix_vector_common.h b/tests/matrix_free/matrix_vector_common.h index d2897e24fb..cfe5b1daa6 100644 --- a/tests/matrix_free/matrix_vector_common.h +++ b/tests/matrix_free/matrix_vector_common.h @@ -148,8 +148,9 @@ do_test(const DoFHandler & dof, } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } diff --git a/tests/matrix_free/matrix_vector_curl.cc b/tests/matrix_free/matrix_vector_curl.cc index 25ecda706e..4af3c590e5 100644 --- a/tests/matrix_free/matrix_vector_curl.cc +++ b/tests/matrix_free/matrix_vector_curl.cc @@ -62,7 +62,8 @@ public: typedef typename DoFHandler::active_cell_iterator CellIterator; typedef double Number; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void local_apply(const MatrixFree & data, @@ -92,8 +93,10 @@ public: vmult(VectorType &dst, const VectorType &src) const { dst = 0; - data.cell_loop( - &MatrixFreeTest::local_apply, this, dst, src); + data.cell_loop(&MatrixFreeTest::local_apply, + this, + dst, + src); }; private: @@ -236,8 +239,9 @@ test() local_matrix(i, j) = local_matrix(j, i); cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - local_matrix, local_dof_indices, system_matrix); + constraints.distribute_local_to_global(local_matrix, + local_dof_indices, + system_matrix); } } diff --git a/tests/matrix_free/matrix_vector_div.cc b/tests/matrix_free/matrix_vector_div.cc index 8e2e96ec5f..c13be151d6 100644 --- a/tests/matrix_free/matrix_vector_div.cc +++ b/tests/matrix_free/matrix_vector_div.cc @@ -64,7 +64,8 @@ public: typedef typename DoFHandler::active_cell_iterator CellIterator; typedef double Number; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void local_apply(const MatrixFree & data, @@ -96,8 +97,10 @@ public: AssertDimension(dst.size(), dim); for (unsigned int d = 0; d < dim; ++d) dst[d] = 0; - data.cell_loop( - &MatrixFreeTest::local_apply, this, dst, src); + data.cell_loop(&MatrixFreeTest::local_apply, + this, + dst, + src); }; private: @@ -234,8 +237,9 @@ test() local_matrix(i, j) = local_matrix(j, i); cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - local_matrix, local_dof_indices, system_matrix); + constraints.distribute_local_to_global(local_matrix, + local_dof_indices, + system_matrix); } } diff --git a/tests/matrix_free/matrix_vector_faces_12.cc b/tests/matrix_free/matrix_vector_faces_12.cc index 98c122a889..1f459093ea 100644 --- a/tests/matrix_free/matrix_vector_faces_12.cc +++ b/tests/matrix_free/matrix_vector_faces_12.cc @@ -97,12 +97,12 @@ template class PeriodicHillManifold : public ChartManifold { public: - PeriodicHillManifold() : - ChartManifold(), - h(0.028), - x_max(9.0 * h), - y_max(2.036 * h), - y_FoR(h) + PeriodicHillManifold() + : ChartManifold() + , h(0.028) + , x_max(9.0 * h) + , y_max(2.036 * h) + , y_FoR(h) {} virtual std::unique_ptr> @@ -177,9 +177,9 @@ public: Y = Yn; iter++; } - AssertThrow( - iter < maxiter, - ExcMessage("Newton within PullBack did not find the solution. ")); + AssertThrow(iter < maxiter, + ExcMessage( + "Newton within PullBack did not find the solution. ")); xi[1] = Y; } else if (x[0] > x_max / 2.0) @@ -206,9 +206,9 @@ public: Y = Yn; iter++; } - AssertThrow( - iter < maxiter, - ExcMessage("Newton within PullBack did not find the solution. ")); + AssertThrow(iter < maxiter, + ExcMessage( + "Newton within PullBack did not find the solution. ")); xi[1] = Y; } return xi; @@ -247,8 +247,10 @@ test() if (dim == 3) p[2] = -2.25 * h; - GridGenerator::subdivided_hyper_rectangle( - triangulation, refinements, p, coordinates); + GridGenerator::subdivided_hyper_rectangle(triangulation, + refinements, + p, + coordinates); triangulation.last()->vertex(0)[1] = 0.; if (dim == 3) diff --git a/tests/matrix_free/matrix_vector_faces_common.h b/tests/matrix_free/matrix_vector_faces_common.h index dacd42560b..e91cdc04ad 100644 --- a/tests/matrix_free/matrix_vector_faces_common.h +++ b/tests/matrix_free/matrix_vector_faces_common.h @@ -71,7 +71,8 @@ template &data) : data(data) + MatrixFreeTest(const MatrixFree &data) + : data(data) {} void @@ -223,10 +224,10 @@ class MatrixFreeVariant public: MatrixFreeVariant(const MatrixFree &data, const bool zero_within_loop = true, - const unsigned int start_vector_component = 0) : - data(data), - zero_within_loop(zero_within_loop), - start_vector_component(start_vector_component) + const unsigned int start_vector_component = 0) + : data(data) + , zero_within_loop(zero_within_loop) + , start_vector_component(start_vector_component) {} void @@ -416,10 +417,10 @@ class MatrixFreeAdvection public: MatrixFreeAdvection(const MatrixFree &data, const bool zero_within_loop = true, - const unsigned int start_vector_component = 0) : - data(data), - zero_within_loop(zero_within_loop), - start_vector_component(start_vector_component) + const unsigned int start_vector_component = 0) + : data(data) + , zero_within_loop(zero_within_loop) + , start_vector_component(start_vector_component) { for (unsigned int d = 0; d < dim; ++d) advection[d] = 0.4 + 0.12 * d; @@ -470,8 +471,9 @@ private: phi.reinit(cell); phi.gather_evaluate(src, true, false); for (unsigned int q = 0; q < phi.n_q_points; ++q) - phi.submit_gradient( - multiply_by_advection(advection, phi.get_value(q)), q); + phi.submit_gradient(multiply_by_advection(advection, + phi.get_value(q)), + q); phi.integrate_scatter(false, true, dst); } } @@ -647,8 +649,9 @@ MatrixIntegrator::boundary( [GeometryInfo::unit_normal_direction[dinfo.face_number]] * info.fe_values(0).normal_vector(0))); double penalty = normal_volume_fraction * std::max(1U, deg) * (deg + 1.0); - LocalIntegrators::Laplace ::nitsche_matrix( - dinfo.matrix(0, false).matrix, info.fe_values(0), penalty); + LocalIntegrators::Laplace ::nitsche_matrix(dinfo.matrix(0, false).matrix, + info.fe_values(0), + penalty); } @@ -697,8 +700,9 @@ do_test(const DoFHandler & dof, UpdateFlags update_flags = update_values | update_gradients | update_jacobians; info_box.add_update_flags_all(update_flags); - info_box.initialize_gauss_quadrature( - n_q_points_1d, n_q_points_1d, n_q_points_1d); + info_box.initialize_gauss_quadrature(n_q_points_1d, + n_q_points_1d, + n_q_points_1d); info_box.initialize(dof.get_fe(), mapping); MeshWorker::DoFInfo dof_info(dof); @@ -758,8 +762,9 @@ do_test(const DoFHandler & dof, int main(int argc, char **argv) { - Utilities::MPI::MPI_InitFinalize mpi_init( - argc, argv, testing_max_num_threads()); + Utilities::MPI::MPI_InitFinalize mpi_init(argc, + argv, + testing_max_num_threads()); mpi_initlog(); #else int diff --git a/tests/matrix_free/matrix_vector_hp.cc b/tests/matrix_free/matrix_vector_hp.cc index 9cb656a556..81653f494b 100644 --- a/tests/matrix_free/matrix_vector_hp.cc +++ b/tests/matrix_free/matrix_vector_hp.cc @@ -37,7 +37,8 @@ template class MatrixFreeTestHP { public: - MatrixFreeTestHP(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTestHP(const MatrixFree &data_in) + : data(data_in){}; void local_apply(const MatrixFree & data, @@ -49,32 +50,46 @@ public: std::pair subrange_deg = data.create_cell_subrange_hp(cell_range, 1); if (subrange_deg.second > subrange_deg.first) - helmholtz_operator, 2>( - data, dst, src, subrange_deg); + helmholtz_operator, 2>(data, + dst, + src, + subrange_deg); subrange_deg = data.create_cell_subrange_hp(cell_range, 2); if (subrange_deg.second > subrange_deg.first) - helmholtz_operator, 3>( - data, dst, src, subrange_deg); + helmholtz_operator, 3>(data, + dst, + src, + subrange_deg); subrange_deg = data.create_cell_subrange_hp(cell_range, 3); if (subrange_deg.second > subrange_deg.first) - helmholtz_operator, 4>( - data, dst, src, subrange_deg); + helmholtz_operator, 4>(data, + dst, + src, + subrange_deg); subrange_deg = data.create_cell_subrange_hp(cell_range, 4); if (subrange_deg.second > subrange_deg.first) - helmholtz_operator, 5>( - data, dst, src, subrange_deg); + helmholtz_operator, 5>(data, + dst, + src, + subrange_deg); subrange_deg = data.create_cell_subrange_hp(cell_range, 5); if (subrange_deg.second > subrange_deg.first) - helmholtz_operator, 6>( - data, dst, src, subrange_deg); + helmholtz_operator, 6>(data, + dst, + src, + subrange_deg); subrange_deg = data.create_cell_subrange_hp(cell_range, 6); if (subrange_deg.second > subrange_deg.first) - helmholtz_operator, 7>( - data, dst, src, subrange_deg); + helmholtz_operator, 7>(data, + dst, + src, + subrange_deg); subrange_deg = data.create_cell_subrange_hp(cell_range, 7); if (subrange_deg.second > subrange_deg.first) - helmholtz_operator, 8>( - data, dst, src, subrange_deg); + helmholtz_operator, 8>(data, + dst, + src, + subrange_deg); } void @@ -153,8 +168,10 @@ test() dof.distribute_dofs(fe_collection); ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); DynamicSparsityPattern csp(dof.n_dofs(), dof.n_dofs()); DoFTools::make_sparsity_pattern(dof, csp, constraints, false); @@ -210,8 +227,9 @@ test() local_dof_indices.resize(dofs_per_cell); cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, system_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + system_matrix); } } diff --git a/tests/matrix_free/matrix_vector_large_degree_02.cc b/tests/matrix_free/matrix_vector_large_degree_02.cc index d48a4b056b..a6dbc08c5e 100644 --- a/tests/matrix_free/matrix_vector_large_degree_02.cc +++ b/tests/matrix_free/matrix_vector_large_degree_02.cc @@ -77,8 +77,10 @@ test() ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); deallog << "Testing " << dof.get_fe().get_name() << std::endl; @@ -152,8 +154,9 @@ test() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, sparse_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + sparse_matrix); } } diff --git a/tests/matrix_free/matrix_vector_mf.h b/tests/matrix_free/matrix_vector_mf.h index 940b4d19a4..950161ad38 100644 --- a/tests/matrix_free/matrix_vector_mf.h +++ b/tests/matrix_free/matrix_vector_mf.h @@ -66,18 +66,19 @@ class MatrixFreeTest public: typedef VectorizedArray vector_t; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in) + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in) {} void vmult(VectorType &dst, const VectorType &src) const { dst = 0; - const std::function &, - VectorType &, - const VectorType &, - const std::pair &)> + const std::function< + void(const MatrixFree &, + VectorType &, + const VectorType &, + const std::pair &)> wrap = helmholtz_operator; data.cell_loop(wrap, dst, src); } diff --git a/tests/matrix_free/matrix_vector_mg.cc b/tests/matrix_free/matrix_vector_mg.cc index 72bca441b2..5caa72a2bb 100644 --- a/tests/matrix_free/matrix_vector_mg.cc +++ b/tests/matrix_free/matrix_vector_mg.cc @@ -57,8 +57,10 @@ test() dof.distribute_dofs(fe); dof.distribute_mg_dofs(fe); ConstraintMatrix constraints; - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); // std::cout << "Number of cells: " << @@ -74,8 +76,10 @@ test() SparseMatrix system_matrix; { DynamicSparsityPattern csp(dof.n_dofs(), dof.n_dofs()); - DoFTools::make_sparsity_pattern( - static_cast &>(dof), csp, constraints, false); + DoFTools::make_sparsity_pattern(static_cast &>(dof), + csp, + constraints, + false); sparsity.copy_from(csp); } system_matrix.reinit(sparsity); @@ -146,8 +150,9 @@ test() fe_values.JxW(q_point)); } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, system_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + system_matrix); } // now to the MG assembly diff --git a/tests/matrix_free/matrix_vector_stokes.cc b/tests/matrix_free/matrix_vector_stokes.cc index c66590197b..7d8d7dbc1b 100644 --- a/tests/matrix_free/matrix_vector_stokes.cc +++ b/tests/matrix_free/matrix_vector_stokes.cc @@ -62,7 +62,8 @@ public: typedef typename DoFHandler::active_cell_iterator CellIterator; typedef double Number; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void local_apply(const MatrixFree & data, @@ -112,8 +113,10 @@ public: AssertDimension(dst.size(), dim + 1); for (unsigned int d = 0; d < dim + 1; ++d) dst[d] = 0; - data.cell_loop( - &MatrixFreeTest::local_apply, this, dst, src); + data.cell_loop(&MatrixFreeTest::local_apply, + this, + dst, + src); }; private: @@ -259,8 +262,9 @@ test() local_matrix(i, j) = local_matrix(j, i); cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - local_matrix, local_dof_indices, system_matrix); + constraints.distribute_local_to_global(local_matrix, + local_dof_indices, + system_matrix); } } diff --git a/tests/matrix_free/matrix_vector_stokes_base.cc b/tests/matrix_free/matrix_vector_stokes_base.cc index 610a5b9c1e..6486f5fb1b 100644 --- a/tests/matrix_free/matrix_vector_stokes_base.cc +++ b/tests/matrix_free/matrix_vector_stokes_base.cc @@ -220,8 +220,9 @@ test() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - local_matrix, local_dof_indices, system_matrix); + constraints.distribute_local_to_global(local_matrix, + local_dof_indices, + system_matrix); } } diff --git a/tests/matrix_free/matrix_vector_stokes_flux.cc b/tests/matrix_free/matrix_vector_stokes_flux.cc index 33f5c36984..579798952d 100644 --- a/tests/matrix_free/matrix_vector_stokes_flux.cc +++ b/tests/matrix_free/matrix_vector_stokes_flux.cc @@ -65,7 +65,8 @@ public: typedef typename DoFHandler::active_cell_iterator CellIterator; typedef double Number; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in) + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in) {} void @@ -75,10 +76,14 @@ public: const std::pair &cell_range) const { typedef VectorizedArray vector_t; - FEEvaluation velocity( - data, 0, 0, 0); - FEEvaluation pressure( - data, 0, 0, dim); + FEEvaluation velocity(data, + 0, + 0, + 0); + FEEvaluation pressure(data, + 0, + 0, + dim); for (unsigned int cell = cell_range.first; cell < cell_range.second; ++cell) { @@ -116,8 +121,10 @@ public: vmult(VectorType &dst, const VectorType &src) const { dst = 0; - data.cell_loop( - &MatrixFreeTest::local_apply, this, dst, src); + data.cell_loop(&MatrixFreeTest::local_apply, + this, + dst, + src); }; private: @@ -157,13 +164,16 @@ test() no_normal_flux_boundaries.insert(0); no_normal_flux_boundaries.insert(1); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::compute_normal_flux_constraints( - dof_handler, 0, no_normal_flux_boundaries, constraints); + VectorTools::compute_normal_flux_constraints(dof_handler, + 0, + no_normal_flux_boundaries, + constraints); constraints.close(); std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block( - dof_handler, dofs_per_block, stokes_sub_blocks); + DoFTools::count_dofs_per_block(dof_handler, + dofs_per_block, + stokes_sub_blocks); { BlockDynamicSparsityPattern csp(2, 2); @@ -235,8 +245,9 @@ test() local_matrix(i, j) = local_matrix(j, i); cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - local_matrix, local_dof_indices, system_matrix); + constraints.distribute_local_to_global(local_matrix, + local_dof_indices, + system_matrix); } } diff --git a/tests/matrix_free/matrix_vector_stokes_noflux.cc b/tests/matrix_free/matrix_vector_stokes_noflux.cc index 387b5fbc89..ff83545ce2 100644 --- a/tests/matrix_free/matrix_vector_stokes_noflux.cc +++ b/tests/matrix_free/matrix_vector_stokes_noflux.cc @@ -62,7 +62,8 @@ public: typedef typename DoFHandler::active_cell_iterator CellIterator; typedef double Number; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void local_apply(const MatrixFree & data, @@ -111,8 +112,10 @@ public: vmult(VectorType &dst, const VectorType &src) const { dst = 0; - data.cell_loop( - &MatrixFreeTest::local_apply, this, dst, src); + data.cell_loop(&MatrixFreeTest::local_apply, + this, + dst, + src); }; private: @@ -180,8 +183,9 @@ test() constraints_p.close(); std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block( - dof_handler, dofs_per_block, stokes_sub_blocks); + DoFTools::count_dofs_per_block(dof_handler, + dofs_per_block, + stokes_sub_blocks); // std::cout << "Number of active cells: " // << triangulation.n_active_cells() @@ -263,8 +267,9 @@ test() local_matrix(i, j) = local_matrix(j, i); cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - local_matrix, local_dof_indices, system_matrix); + constraints.distribute_local_to_global(local_matrix, + local_dof_indices, + system_matrix); } } diff --git a/tests/matrix_free/matrix_vector_stokes_notempl.cc b/tests/matrix_free/matrix_vector_stokes_notempl.cc index e7b6873529..52438bbc47 100644 --- a/tests/matrix_free/matrix_vector_stokes_notempl.cc +++ b/tests/matrix_free/matrix_vector_stokes_notempl.cc @@ -59,7 +59,8 @@ public: typedef typename DoFHandler::active_cell_iterator CellIterator; typedef double Number; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void local_apply(const MatrixFree & data, @@ -107,8 +108,10 @@ public: vmult(VectorType &dst, const VectorType &src) const { dst = 0; - data.cell_loop( - &MatrixFreeTest::local_apply, this, dst, src); + data.cell_loop(&MatrixFreeTest::local_apply, + this, + dst, + src); }; private: @@ -176,8 +179,9 @@ test(const unsigned int fe_degree) constraints_p.close(); std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block( - dof_handler, dofs_per_block, stokes_sub_blocks); + DoFTools::count_dofs_per_block(dof_handler, + dofs_per_block, + stokes_sub_blocks); // std::cout << "Number of active cells: " // << triangulation.n_active_cells() @@ -259,8 +263,9 @@ test(const unsigned int fe_degree) local_matrix(i, j) = local_matrix(j, i); cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - local_matrix, local_dof_indices, system_matrix); + constraints.distribute_local_to_global(local_matrix, + local_dof_indices, + system_matrix); } } diff --git a/tests/matrix_free/matrix_vector_stokes_onedof.cc b/tests/matrix_free/matrix_vector_stokes_onedof.cc index ec0267c0de..1e7552486c 100644 --- a/tests/matrix_free/matrix_vector_stokes_onedof.cc +++ b/tests/matrix_free/matrix_vector_stokes_onedof.cc @@ -63,7 +63,8 @@ public: typedef typename DoFHandler::active_cell_iterator CellIterator; typedef double Number; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void local_apply(const MatrixFree & data, @@ -72,10 +73,14 @@ public: const std::pair &cell_range) const { typedef VectorizedArray vector_t; - FEEvaluation velocity( - data, 0, 0, 0); - FEEvaluation pressure( - data, 0, 0, dim); + FEEvaluation velocity(data, + 0, + 0, + 0); + FEEvaluation pressure(data, + 0, + 0, + dim); for (unsigned int cell = cell_range.first; cell < cell_range.second; ++cell) { @@ -113,8 +118,10 @@ public: vmult(VectorType &dst, const VectorType &src) const { dst = 0; - data.cell_loop( - &MatrixFreeTest::local_apply, this, dst, src); + data.cell_loop(&MatrixFreeTest::local_apply, + this, + dst, + src); }; private: @@ -238,8 +245,9 @@ test(const FESystem &fe) local_matrix(i, j) = local_matrix(j, i); cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - local_matrix, local_dof_indices, system_matrix); + constraints.distribute_local_to_global(local_matrix, + local_dof_indices, + system_matrix); } } diff --git a/tests/matrix_free/matrix_vector_stokes_qdg0.cc b/tests/matrix_free/matrix_vector_stokes_qdg0.cc index 0d06d6dfcd..167a5a7dc6 100644 --- a/tests/matrix_free/matrix_vector_stokes_qdg0.cc +++ b/tests/matrix_free/matrix_vector_stokes_qdg0.cc @@ -63,7 +63,8 @@ public: typedef typename DoFHandler::active_cell_iterator CellIterator; typedef double Number; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void local_apply(const MatrixFree & data, @@ -114,8 +115,10 @@ public: AssertDimension(dst.size(), dim + 1); for (unsigned int d = 0; d < dim + 1; ++d) dst[d] = 0; - data.cell_loop( - &MatrixFreeTest::local_apply, this, dst, src); + data.cell_loop(&MatrixFreeTest::local_apply, + this, + dst, + src); }; private: @@ -261,8 +264,9 @@ test() local_matrix(i, j) = local_matrix(j, i); cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - local_matrix, local_dof_indices, system_matrix); + constraints.distribute_local_to_global(local_matrix, + local_dof_indices, + system_matrix); } } diff --git a/tests/matrix_free/matrix_vector_stokes_qdg0b.cc b/tests/matrix_free/matrix_vector_stokes_qdg0b.cc index e102f24172..ab040e7a6d 100644 --- a/tests/matrix_free/matrix_vector_stokes_qdg0b.cc +++ b/tests/matrix_free/matrix_vector_stokes_qdg0b.cc @@ -64,7 +64,8 @@ public: typedef typename DoFHandler::active_cell_iterator CellIterator; typedef double Number; - MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : data(data_in){}; void local_apply(const MatrixFree & data, @@ -260,8 +261,9 @@ test(const unsigned int fe_degree) local_matrix(i, j) = local_matrix(j, i); cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - local_matrix, local_dof_indices, system_matrix); + constraints.distribute_local_to_global(local_matrix, + local_dof_indices, + system_matrix); } } diff --git a/tests/matrix_free/multigrid_dg_periodic.cc b/tests/matrix_free/multigrid_dg_periodic.cc index f3bd0f2212..a07084c849 100644 --- a/tests/matrix_free/multigrid_dg_periodic.cc +++ b/tests/matrix_free/multigrid_dg_periodic.cc @@ -496,8 +496,8 @@ class MGTransferMF LinearAlgebra::distributed::Vector> { public: - MGTransferMF(const MGLevelObject &laplace) : - laplace_operator(laplace){}; + MGTransferMF(const MGLevelObject &laplace) + : laplace_operator(laplace){}; /** * Overload copy_to_mg from MGTransferPrebuilt diff --git a/tests/matrix_free/multigrid_dg_sip_01.cc b/tests/matrix_free/multigrid_dg_sip_01.cc index c410f60e1d..e2cdea288a 100644 --- a/tests/matrix_free/multigrid_dg_sip_01.cc +++ b/tests/matrix_free/multigrid_dg_sip_01.cc @@ -503,10 +503,10 @@ class MGTransferMF { public: MGTransferMF(const MGLevelObject &laplace, - const MGConstrainedDoFs & mg_constrained_dofs) : - MGTransferMatrixFree( - mg_constrained_dofs), - laplace_operator(laplace){}; + const MGConstrainedDoFs & mg_constrained_dofs) + : MGTransferMatrixFree( + mg_constrained_dofs) + , laplace_operator(laplace){}; /** * Overload copy_to_mg from MGTransferPrebuilt diff --git a/tests/matrix_free/multigrid_dg_sip_02.cc b/tests/matrix_free/multigrid_dg_sip_02.cc index 64e450bee6..83033d4ab8 100644 --- a/tests/matrix_free/multigrid_dg_sip_02.cc +++ b/tests/matrix_free/multigrid_dg_sip_02.cc @@ -415,10 +415,10 @@ class MGTransferMF { public: MGTransferMF(const MGLevelObject &laplace, - const MGConstrainedDoFs & mg_constrained_dofs) : - MGTransferMatrixFree( - mg_constrained_dofs), - laplace_operator(laplace){}; + const MGConstrainedDoFs & mg_constrained_dofs) + : MGTransferMatrixFree( + mg_constrained_dofs) + , laplace_operator(laplace){}; /** * Overload copy_to_mg from MGTransferPrebuilt diff --git a/tests/matrix_free/no_index_initialize.cc b/tests/matrix_free/no_index_initialize.cc index fd7d5899b6..0839660857 100644 --- a/tests/matrix_free/no_index_initialize.cc +++ b/tests/matrix_free/no_index_initialize.cc @@ -62,9 +62,9 @@ class MatrixFreeTest public: bool read_vector; - MatrixFreeTest(const MatrixFree &data_in) : - read_vector(false), - data(data_in){}; + MatrixFreeTest(const MatrixFree &data_in) + : read_vector(false) + , data(data_in){}; void operator()(const MatrixFree &data, diff --git a/tests/matrix_free/parallel_multigrid.cc b/tests/matrix_free/parallel_multigrid.cc index 005fb9d121..db115e4ef5 100644 --- a/tests/matrix_free/parallel_multigrid.cc +++ b/tests/matrix_free/parallel_multigrid.cc @@ -83,8 +83,9 @@ public: ++it) functions[*it] = &zero; if (level == numbers::invalid_unsigned_int) - VectorTools::interpolate_boundary_values( - dof_handler, functions, constraints); + VectorTools::interpolate_boundary_values(dof_handler, + functions, + constraints); else { std::vector local_dofs; @@ -280,8 +281,8 @@ class MGTransferPrebuiltMF : public MGTransferPrebuilt> { public: - MGTransferPrebuiltMF(const MGLevelObject &laplace) : - laplace_operator(laplace){}; + MGTransferPrebuiltMF(const MGLevelObject &laplace) + : laplace_operator(laplace){}; /** * Overload copy_to_mg from MGTransferPrebuilt to get the vectors compatible diff --git a/tests/matrix_free/parallel_multigrid_02.cc b/tests/matrix_free/parallel_multigrid_02.cc index eb2dbef350..3bce17bd06 100644 --- a/tests/matrix_free/parallel_multigrid_02.cc +++ b/tests/matrix_free/parallel_multigrid_02.cc @@ -111,8 +111,9 @@ do_test(const DoFHandler &dof) ConstraintMatrix constraints; constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(dof, + dirichlet_boundary, + constraints); constraints.close(); // level constraints: @@ -184,10 +185,10 @@ do_test(const DoFHandler &dof) level_constraints, QGauss<1>(n_q_points_1d), mg_additional_data); - mg_matrices[level].initialize( - std::make_shared>(mg_level_data[level]), - mg_constrained_dofs, - level); + mg_matrices[level].initialize(std::make_shared>( + mg_level_data[level]), + mg_constrained_dofs, + level); mg_matrices[level].compute_diagonal(); } diff --git a/tests/matrix_free/parallel_multigrid_adaptive_01.cc b/tests/matrix_free/parallel_multigrid_adaptive_01.cc index d12dad4e9f..ac54052996 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_01.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_01.cc @@ -82,14 +82,16 @@ public: DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_dofs); constraints.reinit(relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(dof_handler, + dirichlet_boundary, + constraints); } else { IndexSet relevant_dofs; - DoFTools::extract_locally_relevant_level_dofs( - dof_handler, level, relevant_dofs); + DoFTools::extract_locally_relevant_level_dofs(dof_handler, + level, + relevant_dofs); constraints.reinit(relevant_dofs); constraints.add_lines(mg_constrained_dofs.get_boundary_indices(level)); @@ -429,10 +431,10 @@ class MGTransferMF { public: MGTransferMF(const MGLevelObject &laplace, - const MGConstrainedDoFs & mg_constrained_dofs) : - MGTransferPrebuilt>( - mg_constrained_dofs), - laplace_operator(laplace) + const MGConstrainedDoFs & mg_constrained_dofs) + : MGTransferPrebuilt>( + mg_constrained_dofs) + , laplace_operator(laplace) {} /** diff --git a/tests/matrix_free/parallel_multigrid_adaptive_02.cc b/tests/matrix_free/parallel_multigrid_adaptive_02.cc index 846862a2e3..5c6f098682 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_02.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_02.cc @@ -60,10 +60,10 @@ class MGTransferMF { public: MGTransferMF(const MGLevelObject &laplace, - const MGConstrainedDoFs & mg_constrained_dofs) : - MGTransferMatrixFree( - mg_constrained_dofs), - laplace_operator(laplace) + const MGConstrainedDoFs & mg_constrained_dofs) + : MGTransferMatrixFree( + mg_constrained_dofs) + , laplace_operator(laplace) {} /** @@ -148,8 +148,9 @@ do_test(const DoFHandler &dof) ConstraintMatrix constraints; constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(dof, + dirichlet_boundary, + constraints); constraints.close(); // level constraints: @@ -234,10 +235,10 @@ do_test(const DoFHandler &dof) level_constraints, QGauss<1>(n_q_points_1d), mg_additional_data); - mg_matrices[level].initialize( - std::make_shared>(mg_level_data[level]), - mg_constrained_dofs, - level); + mg_matrices[level].initialize(std::make_shared>( + mg_level_data[level]), + mg_constrained_dofs, + level); mg_matrices[level].compute_diagonal(); } MGLevelObject> mg_interface_matrices; diff --git a/tests/matrix_free/parallel_multigrid_adaptive_03.cc b/tests/matrix_free/parallel_multigrid_adaptive_03.cc index 05bf236a12..dbec01a1ed 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_03.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_03.cc @@ -88,14 +88,16 @@ public: DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_dofs); constraints.reinit(relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(dof_handler, + dirichlet_boundary, + constraints); } else { IndexSet relevant_dofs; - DoFTools::extract_locally_relevant_level_dofs( - dof_handler, level, relevant_dofs); + DoFTools::extract_locally_relevant_level_dofs(dof_handler, + level, + relevant_dofs); constraints.reinit(relevant_dofs); constraints.add_lines(mg_constrained_dofs.get_boundary_indices(level)); @@ -440,10 +442,10 @@ class MGTransferMF { public: MGTransferMF(const MGLevelObject &laplace, - const MGConstrainedDoFs & mg_constrained_dofs) : - MGTransferMatrixFree( - mg_constrained_dofs), - laplace_operator(laplace) + const MGConstrainedDoFs & mg_constrained_dofs) + : MGTransferMatrixFree( + mg_constrained_dofs) + , laplace_operator(laplace) {} /** @@ -662,8 +664,9 @@ test() int main(int argc, char **argv) { - Utilities::MPI::MPI_InitFinalize mpi_init( - argc, argv, testing_max_num_threads()); + Utilities::MPI::MPI_InitFinalize mpi_init(argc, + argv, + testing_max_num_threads()); mpi_initlog(); diff --git a/tests/matrix_free/parallel_multigrid_adaptive_04.cc b/tests/matrix_free/parallel_multigrid_adaptive_04.cc index fdfe706d01..4be60970b5 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_04.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_04.cc @@ -60,10 +60,10 @@ class MGTransferMF { public: MGTransferMF(const MGLevelObject &laplace, - const MGConstrainedDoFs & mg_constrained_dofs) : - MGTransferMatrixFree( - mg_constrained_dofs), - laplace_operator(laplace) + const MGConstrainedDoFs & mg_constrained_dofs) + : MGTransferMatrixFree( + mg_constrained_dofs) + , laplace_operator(laplace) {} /** @@ -148,8 +148,9 @@ do_test(const DoFHandler &dof) ConstraintMatrix constraints; constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(dof, + dirichlet_boundary, + constraints); constraints.close(); // level constraints: @@ -234,10 +235,10 @@ do_test(const DoFHandler &dof) level_constraints, QGauss<1>(n_q_points_1d), mg_additional_data); - mg_matrices[level].initialize( - std::make_shared>(mg_level_data[level]), - mg_constrained_dofs, - level); + mg_matrices[level].initialize(std::make_shared>( + mg_level_data[level]), + mg_constrained_dofs, + level); mg_matrices[level].compute_diagonal(); } MGLevelObject> mg_interface_matrices; diff --git a/tests/matrix_free/parallel_multigrid_adaptive_05.cc b/tests/matrix_free/parallel_multigrid_adaptive_05.cc index 08b5c2bbe2..c29cce44f5 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_05.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_05.cc @@ -85,14 +85,16 @@ public: DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_dofs); constraints.reinit(relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(dof_handler, + dirichlet_boundary, + constraints); } else { IndexSet relevant_dofs; - DoFTools::extract_locally_relevant_level_dofs( - dof_handler, level, relevant_dofs); + DoFTools::extract_locally_relevant_level_dofs(dof_handler, + level, + relevant_dofs); constraints.reinit(relevant_dofs); constraints.add_lines(mg_constrained_dofs.get_boundary_indices(level)); @@ -437,10 +439,10 @@ class MGTransferMF { public: MGTransferMF(const MGLevelObject &laplace, - const MGConstrainedDoFs & mg_constrained_dofs) : - MGTransferMatrixFree( - mg_constrained_dofs), - laplace_operator(laplace) + const MGConstrainedDoFs & mg_constrained_dofs) + : MGTransferMatrixFree( + mg_constrained_dofs) + , laplace_operator(laplace) {} /** diff --git a/tests/matrix_free/parallel_multigrid_adaptive_06.cc b/tests/matrix_free/parallel_multigrid_adaptive_06.cc index 2939e08a13..9c3abe3fdb 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_06.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_06.cc @@ -83,7 +83,8 @@ public: typedef typename BlockVectorType::value_type value_type; typedef typename BlockVectorType::size_type size_type; - BlockLaplace() : Subscriptor() + BlockLaplace() + : Subscriptor() {} void @@ -232,8 +233,9 @@ do_test(const DoFHandler &dof, const unsigned int nb) ConstraintMatrix constraints; constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(dof, + dirichlet_boundary, + constraints); constraints.close(); // level constraints: @@ -324,10 +326,10 @@ do_test(const DoFHandler &dof, const unsigned int nb) level_constraints, QGauss<1>(n_q_points_1d), mg_additional_data); - mg_matrices[level].initialize( - std::make_shared>(mg_level_data[level]), - mg_constrained_dofs, - level); + mg_matrices[level].initialize(std::make_shared>( + mg_level_data[level]), + mg_constrained_dofs, + level); mg_matrices[level].compute_diagonal(); } diff --git a/tests/matrix_free/parallel_multigrid_adaptive_06ref.cc b/tests/matrix_free/parallel_multigrid_adaptive_06ref.cc index 475f0c4ecd..73741568dc 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_06ref.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_06ref.cc @@ -61,10 +61,10 @@ class MGTransferMF { public: MGTransferMF(const MGLevelObject &laplace, - const MGConstrainedDoFs & mg_constrained_dofs) : - MGTransferMatrixFree( - mg_constrained_dofs), - laplace_operator(laplace) + const MGConstrainedDoFs & mg_constrained_dofs) + : MGTransferMatrixFree( + mg_constrained_dofs) + , laplace_operator(laplace) {} /** @@ -149,8 +149,9 @@ do_test(const DoFHandler &dof) ConstraintMatrix constraints; constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(dof, + dirichlet_boundary, + constraints); constraints.close(); // level constraints: @@ -235,10 +236,10 @@ do_test(const DoFHandler &dof) level_constraints, QGauss<1>(n_q_points_1d), mg_additional_data); - mg_matrices[level].initialize( - std::make_shared>(mg_level_data[level]), - mg_constrained_dofs, - level); + mg_matrices[level].initialize(std::make_shared>( + mg_level_data[level]), + mg_constrained_dofs, + level); mg_matrices[level].compute_diagonal(); } MGLevelObject> mg_interface_matrices; diff --git a/tests/matrix_free/parallel_multigrid_adaptive_07.cc b/tests/matrix_free/parallel_multigrid_adaptive_07.cc index d3758d9a8e..07d67350f1 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_07.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_07.cc @@ -75,7 +75,8 @@ public: typedef typename BlockVectorType::value_type value_type; typedef typename BlockVectorType::size_type size_type; - BlockLaplace() : Subscriptor() + BlockLaplace() + : Subscriptor() {} void @@ -90,10 +91,14 @@ public: const std::vector &mg_constrained_dofs, const unsigned int level) { - laplace1.initialize( - data, mg_constrained_dofs[0], level, std::vector(1, 0)); - laplace2.initialize( - data, mg_constrained_dofs[1], level, std::vector(1, 1)); + laplace1.initialize(data, + mg_constrained_dofs[0], + level, + std::vector(1, 0)); + laplace2.initialize(data, + mg_constrained_dofs[1], + level, + std::vector(1, 1)); } void @@ -249,8 +254,9 @@ do_test(const std::vector *> &dof) { constraints[i].reinit(locally_relevant_dofs[i]); DoFTools::make_hanging_node_constraints(*dof[i], constraints[i]); - VectorTools::interpolate_boundary_values( - *dof[i], dirichlet_boundary, constraints[i]); + VectorTools::interpolate_boundary_values(*dof[i], + dirichlet_boundary, + constraints[i]); constraints[i].close(); constraints_ptrs[i] = &constraints[i]; } @@ -339,8 +345,9 @@ do_test(const std::vector *> &dof) for (unsigned int i = 0; i < dof.size(); ++i) { IndexSet relevant_dofs; - DoFTools::extract_locally_relevant_level_dofs( - *dof[i], level, relevant_dofs); + DoFTools::extract_locally_relevant_level_dofs(*dof[i], + level, + relevant_dofs); level_constraints[i].reinit(relevant_dofs); level_constraints[i].add_lines( mg_constrained_dofs[i].get_boundary_indices(level)); @@ -350,16 +357,17 @@ do_test(const std::vector *> &dof) mg_level_data[level].reinit( mapping, dof, level_constraints_ptrs, quad, mg_additional_data); - mg_matrices[level].initialize( - std::make_shared>(mg_level_data[level]), - mg_constrained_dofs, - level); + mg_matrices[level].initialize(std::make_shared>( + mg_level_data[level]), + mg_constrained_dofs, + level); mg_matrices[level].compute_diagonal(); } MGLevelObject> mg_interface_matrices; - mg_interface_matrices.resize( - 0, dof[0]->get_triangulation().n_global_levels() - 1); + mg_interface_matrices.resize(0, + dof[0]->get_triangulation().n_global_levels() - + 1); for (unsigned int level = 0; level < dof[0]->get_triangulation().n_global_levels(); ++level) diff --git a/tests/matrix_free/parallel_multigrid_mf.cc b/tests/matrix_free/parallel_multigrid_mf.cc index 3b1bb09960..6672523513 100644 --- a/tests/matrix_free/parallel_multigrid_mf.cc +++ b/tests/matrix_free/parallel_multigrid_mf.cc @@ -82,8 +82,9 @@ public: ++it) functions[*it] = &zero; if (level == numbers::invalid_unsigned_int) - VectorTools::interpolate_boundary_values( - dof_handler, functions, constraints); + VectorTools::interpolate_boundary_values(dof_handler, + functions, + constraints); else { std::vector local_dofs; @@ -280,10 +281,10 @@ class MGTransferPrebuiltMF { public: MGTransferPrebuiltMF(const MGLevelObject &laplace, - const MGConstrainedDoFs & mg_constrained_dofs) : - MGTransferMatrixFree( - mg_constrained_dofs), - laplace_operator(laplace){}; + const MGConstrainedDoFs & mg_constrained_dofs) + : MGTransferMatrixFree( + mg_constrained_dofs) + , laplace_operator(laplace){}; /** * Overload copy_to_mg from MGTransferPrebuilt to get the vectors compatible diff --git a/tests/matrix_free/quadrature_points.cc b/tests/matrix_free/quadrature_points.cc index cbbfb274eb..3761c68c3d 100644 --- a/tests/matrix_free/quadrature_points.cc +++ b/tests/matrix_free/quadrature_points.cc @@ -86,8 +86,10 @@ test() double error_points = 0, abs_points = 0; const unsigned int n_cells = mf_data.n_macro_cells(); FEEvaluation fe_eval(mf_data); - FEValues fe_values( - mapping, fe, mf_data.get_quadrature(), update_quadrature_points); + FEValues fe_values(mapping, + fe, + mf_data.get_quadrature(), + update_quadrature_points); typedef VectorizedArray vector_t; for (unsigned int cell = 0; cell < n_cells; ++cell) diff --git a/tests/matrix_free/step-37.cc b/tests/matrix_free/step-37.cc index 11e8de2f8f..882e517b6f 100644 --- a/tests/matrix_free/step-37.cc +++ b/tests/matrix_free/step-37.cc @@ -63,7 +63,8 @@ namespace Step37 class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -172,7 +173,8 @@ namespace Step37 template - LaplaceOperator::LaplaceOperator() : Subscriptor() + LaplaceOperator::LaplaceOperator() + : Subscriptor() {} @@ -219,8 +221,10 @@ namespace Step37 additional_data.level_mg_handler = level; additional_data.mapping_update_flags = (update_gradients | update_JxW_values | update_quadrature_points); - data.reinit( - dof_handler, constraints, QGauss<1>(fe_degree + 1), additional_data); + data.reinit(dof_handler, + constraints, + QGauss<1>(fe_degree + 1), + additional_data); evaluate_coefficient(Coefficient()); } @@ -262,8 +266,9 @@ namespace Step37 phi.read_dof_values(src); phi.evaluate(false, true, false); for (unsigned int q = 0; q < phi.n_q_points; ++q) - phi.submit_gradient( - coefficient[cell * phi.n_q_points + q] * phi.get_gradient(q), q); + phi.submit_gradient(coefficient[cell * phi.n_q_points + q] * + phi.get_gradient(q), + q); phi.integrate(false, true); phi.distribute_local_to_global(dst); } @@ -394,10 +399,10 @@ namespace Step37 template - LaplaceProblem::LaplaceProblem() : - triangulation(Triangulation::limit_level_difference_at_vertices), - fe(degree_finite_element), - dof_handler(triangulation) + LaplaceProblem::LaplaceProblem() + : triangulation(Triangulation::limit_level_difference_at_vertices) + , fe(degree_finite_element) + , dof_handler(triangulation) {} @@ -417,8 +422,10 @@ namespace Step37 << std::endl; constraints.clear(); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); system_matrix.reinit(dof_handler, constraints); @@ -434,8 +441,9 @@ namespace Step37 dirichlet_boundary[0] = &homogeneous_dirichlet_bc; std::vector> boundary_indices( triangulation.n_levels()); - MGTools::make_boundary_list( - dof_handler, dirichlet_boundary, boundary_indices); + MGTools::make_boundary_list(dof_handler, + dirichlet_boundary, + boundary_indices); for (unsigned int level = 0; level < nlevels; ++level) { std::set::iterator bc_it = @@ -456,8 +464,9 @@ namespace Step37 LaplaceProblem::assemble_system() { QGauss quadrature_formula(fe.degree + 1); - FEValues fe_values( - fe, quadrature_formula, update_values | update_JxW_values); + FEValues fe_values(fe, + quadrature_formula, + update_values | update_JxW_values); const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); @@ -531,8 +540,9 @@ namespace Step37 coefficient_values[q] * fe_values.JxW(q)); local_diagonal(i) = local_diag; } - mg_constraints[level].distribute_local_to_global( - local_diagonal, local_dof_indices, diagonals[level]); + mg_constraints[level].distribute_local_to_global(local_diagonal, + local_dof_indices, + diagonals[level]); if (level == 0) { @@ -548,8 +558,9 @@ namespace Step37 coefficient_values[q] * fe_values.JxW(q)); local_matrix(i, j) = add_value; } - mg_constraints[0].distribute_local_to_global( - local_matrix, local_dof_indices, coarse_matrix); + mg_constraints[0].distribute_local_to_global(local_matrix, + local_dof_indices, + coarse_matrix); } } diff --git a/tests/matrix_free/step-48.cc b/tests/matrix_free/step-48.cc index fdb94edcf8..90c7743b2a 100644 --- a/tests/matrix_free/step-48.cc +++ b/tests/matrix_free/step-48.cc @@ -88,9 +88,9 @@ namespace Step48 template SineGordonOperation::SineGordonOperation( const MatrixFree &data_in, - const double time_step) : - data(data_in), - delta_t_sqr(make_vectorized_array(time_step * time_step)) + const double time_step) + : data(data_in) + , delta_t_sqr(make_vectorized_array(time_step * time_step)) { VectorizedArray one = make_vectorized_array(1.); @@ -165,8 +165,10 @@ namespace Step48 const std::vector *> &src) const { dst = 0; - data.cell_loop( - &SineGordonOperation::local_apply, this, dst, src); + data.cell_loop(&SineGordonOperation::local_apply, + this, + dst, + src); dst.scale(inv_mass_matrix); } @@ -176,8 +178,8 @@ namespace Step48 class ExactSolution : public Function { public: - ExactSolution(const unsigned int n_components = 1, const double time = 0.) : - Function(n_components, time) + ExactSolution(const unsigned int n_components = 1, const double time = 0.) + : Function(n_components, time) {} virtual double value(const Point &p, const unsigned int component = 0) const; @@ -242,17 +244,19 @@ namespace Step48 template - SineGordonProblem::SineGordonProblem() : + SineGordonProblem::SineGordonProblem() + : #ifdef DEAL_II_WITH_P4EST - triangulation(MPI_COMM_WORLD), + triangulation(MPI_COMM_WORLD) + , #endif - fe(QGaussLobatto<1>(fe_degree + 1)), - dof_handler(triangulation), - n_global_refinements(8 - 2 * dim), - time(-10), - final_time(-9), - cfl_number(.1 / fe_degree), - output_timestep_skip(200) + fe(QGaussLobatto<1>(fe_degree + 1)) + , dof_handler(triangulation) + , n_global_refinements(8 - 2 * dim) + , time(-10) + , final_time(-9) + , cfl_number(.1 / fe_degree) + , output_timestep_skip(200) {} @@ -306,8 +310,10 @@ namespace Step48 additional_data.tasks_parallel_scheme = MatrixFree::AdditionalData::partition_partition; - matrix_free_data.reinit( - dof_handler, constraints, quadrature, additional_data); + matrix_free_data.reinit(dof_handler, + constraints, + quadrature, + additional_data); matrix_free_data.initialize_dof_vector(solution); old_solution.reinit(solution); @@ -357,10 +363,12 @@ namespace Step48 << std::endl; - VectorTools::interpolate( - dof_handler, ExactSolution(1, time), solution); - VectorTools::interpolate( - dof_handler, ExactSolution(1, time - time_step), old_solution); + VectorTools::interpolate(dof_handler, + ExactSolution(1, time), + solution); + VectorTools::interpolate(dof_handler, + ExactSolution(1, time - time_step), + old_solution); output_results(0); std::vector *> diff --git a/tests/matrix_free/step-48b.cc b/tests/matrix_free/step-48b.cc index bf06c24e9e..b9fc608c65 100644 --- a/tests/matrix_free/step-48b.cc +++ b/tests/matrix_free/step-48b.cc @@ -82,9 +82,9 @@ namespace Step48 template SineGordonOperation::SineGordonOperation( const MatrixFree &data_in, - const double time_step) : - data(data_in), - delta_t_sqr(make_vectorized_array(time_step * time_step)) + const double time_step) + : data(data_in) + , delta_t_sqr(make_vectorized_array(time_step * time_step)) { VectorizedArray one = make_vectorized_array(1.); @@ -175,8 +175,10 @@ namespace Step48 const std::vector *> &src) const { dst = 0; - data.cell_loop( - &SineGordonOperation::local_apply, this, dst, src); + data.cell_loop(&SineGordonOperation::local_apply, + this, + dst, + src); dst.scale(inv_mass_matrix); } @@ -186,8 +188,8 @@ namespace Step48 class ExactSolution : public Function { public: - ExactSolution(const unsigned int n_components = 1, const double time = 0.) : - Function(n_components, time) + ExactSolution(const unsigned int n_components = 1, const double time = 0.) + : Function(n_components, time) {} virtual double value(const Point &p, const unsigned int component = 0) const; @@ -239,14 +241,14 @@ namespace Step48 template - SineGordonProblem::SineGordonProblem() : - fe(QGaussLobatto<1>(fe_degree + 1)), - dof_handler(triangulation), - n_global_refinements(2), - time(-10), - final_time(-9.75), - cfl_number(.1 / fe_degree), - output_timestep_skip(1) + SineGordonProblem::SineGordonProblem() + : fe(QGaussLobatto<1>(fe_degree + 1)) + , dof_handler(triangulation) + , n_global_refinements(2) + , time(-10) + , final_time(-9.75) + , cfl_number(.1 / fe_degree) + , output_timestep_skip(1) {} @@ -274,8 +276,10 @@ namespace Step48 additional_data.tasks_parallel_scheme = MatrixFree::AdditionalData::none; - matrix_free_data.reinit( - dof_handler, constraints, quadrature, additional_data); + matrix_free_data.reinit(dof_handler, + constraints, + quadrature, + additional_data); matrix_free_data.initialize_dof_vector(solution); old_solution.reinit(solution); @@ -322,10 +326,12 @@ namespace Step48 << std::endl; - VectorTools::interpolate( - dof_handler, ExactSolution(1, time), solution); - VectorTools::interpolate( - dof_handler, ExactSolution(1, time - time_step), old_solution); + VectorTools::interpolate(dof_handler, + ExactSolution(1, time), + solution); + VectorTools::interpolate(dof_handler, + ExactSolution(1, time - time_step), + old_solution); output_norm(); std::vector *> diff --git a/tests/matrix_free/step-48c.cc b/tests/matrix_free/step-48c.cc index f8394a3d85..47f9f32e9c 100644 --- a/tests/matrix_free/step-48c.cc +++ b/tests/matrix_free/step-48c.cc @@ -88,9 +88,9 @@ namespace Step48 template SineGordonOperation::SineGordonOperation( const MatrixFree &data_in, - const double time_step) : - data(data_in), - delta_t_sqr(make_vectorized_array(time_step * time_step)) + const double time_step) + : data(data_in) + , delta_t_sqr(make_vectorized_array(time_step * time_step)) { VectorizedArray one = make_vectorized_array(1.); @@ -163,8 +163,10 @@ namespace Step48 const std::vector *> &src) const { dst = 0; - data.cell_loop( - &SineGordonOperation::local_apply, this, dst, src); + data.cell_loop(&SineGordonOperation::local_apply, + this, + dst, + src); dst.scale(inv_mass_matrix); } @@ -174,9 +176,8 @@ namespace Step48 class InitialSolution : public Function { public: - InitialSolution(const unsigned int n_components = 1, - const double time = 0.) : - Function(n_components, time) + InitialSolution(const unsigned int n_components = 1, const double time = 0.) + : Function(n_components, time) {} virtual double value(const Point &p, const unsigned int component = 0) const; @@ -231,17 +232,19 @@ namespace Step48 template - SineGordonProblem::SineGordonProblem() : + SineGordonProblem::SineGordonProblem() + : #ifdef DEAL_II_WITH_P4EST - triangulation(MPI_COMM_WORLD), + triangulation(MPI_COMM_WORLD) + , #endif - fe(QGaussLobatto<1>(fe_degree + 1)), - dof_handler(triangulation), - n_global_refinements(9 - 2 * dim), - time(-10), - final_time(-9), - cfl_number(.1 / fe_degree), - output_timestep_skip(200) + fe(QGaussLobatto<1>(fe_degree + 1)) + , dof_handler(triangulation) + , n_global_refinements(9 - 2 * dim) + , time(-10) + , final_time(-9) + , cfl_number(.1 / fe_degree) + , output_timestep_skip(200) {} @@ -277,8 +280,10 @@ namespace Step48 additional_data.tasks_parallel_scheme = MatrixFree::AdditionalData::partition_partition; - matrix_free_data.reinit( - dof_handler, constraints, quadrature, additional_data); + matrix_free_data.reinit(dof_handler, + constraints, + quadrature, + additional_data); matrix_free_data.initialize_dof_vector(solution); old_solution.reinit(solution); @@ -328,10 +333,12 @@ namespace Step48 << std::endl; - VectorTools::interpolate( - dof_handler, InitialSolution(1, time), solution); - VectorTools::interpolate( - dof_handler, InitialSolution(1, time - time_step), old_solution); + VectorTools::interpolate(dof_handler, + InitialSolution(1, time), + solution); + VectorTools::interpolate(dof_handler, + InitialSolution(1, time - time_step), + old_solution); output_results(0); std::vector *> diff --git a/tests/matrix_free/stokes_computation.cc b/tests/matrix_free/stokes_computation.cc index 785a327c96..cc9a599307 100644 --- a/tests/matrix_free/stokes_computation.cc +++ b/tests/matrix_free/stokes_computation.cc @@ -163,16 +163,16 @@ namespace StokesClass const PreconditionerA & Apreconditioner, const bool do_solve_A, const double A_block_tolerance, - const double S_block_tolerance) : - stokes_matrix(S), - mass_matrix(Mass), - mp_preconditioner(Mppreconditioner), - a_preconditioner(Apreconditioner), - do_solve_A(do_solve_A), - n_iterations_A_(0), - n_iterations_S_(0), - A_block_tolerance(A_block_tolerance), - S_block_tolerance(S_block_tolerance) + const double S_block_tolerance) + : stokes_matrix(S) + , mass_matrix(Mass) + , mp_preconditioner(Mppreconditioner) + , a_preconditioner(Apreconditioner) + , do_solve_A(do_solve_A) + , n_iterations_A_(0) + , n_iterations_S_(0) + , A_block_tolerance(A_block_tolerance) + , S_block_tolerance(S_block_tolerance) {} template > solver( solver_control); try { dst.block(1) = 0.0; - solver.solve( - mass_matrix, dst.block(1), src.block(1), mp_preconditioner); + solver.solve(mass_matrix, + dst.block(1), + src.block(1), + mp_preconditioner); n_iterations_S_ += solver_control.last_step(); } // if the solver fails, report the error from processor 0 with some @@ -387,7 +391,8 @@ namespace StokesClass class ExactSolution_BoundaryValues : public Function { public: - ExactSolution_BoundaryValues() : Function(dim + 1) + ExactSolution_BoundaryValues() + : Function(dim + 1) {} virtual void vector_value(const Point &p, Vector &value) const; @@ -407,7 +412,8 @@ namespace StokesClass class ExactSolution_BoundaryValues_u : public Function { public: - ExactSolution_BoundaryValues_u() : Function(dim) + ExactSolution_BoundaryValues_u() + : Function(dim) {} virtual void vector_value(const Point &p, Vector &value) const; @@ -432,9 +438,9 @@ namespace StokesClass Base> { public: - StokesOperator() : - MatrixFreeOperators:: - Base>() + StokesOperator() + : MatrixFreeOperators:: + Base>() {} void clear(); @@ -562,9 +568,9 @@ namespace StokesClass Base> { public: - MassMatrixOperator() : - MatrixFreeOperators::Base>() + MassMatrixOperator() + : MatrixFreeOperators::Base>() {} void clear(); @@ -649,8 +655,9 @@ namespace StokesClass pressure.read_dof_values(src); pressure.evaluate(true, false); for (unsigned int q = 0; q < pressure.n_q_points; ++q) - pressure.submit_value( - one_over_viscosity(cell, q) * pressure.get_value(q), q); + pressure.submit_value(one_over_viscosity(cell, q) * + pressure.get_value(q), + q); pressure.integrate(true, false); pressure.distribute_local_to_global(dst); } @@ -683,8 +690,10 @@ namespace StokesClass this->data->initialize_dof_vector(inverse_diagonal); this->data->initialize_dof_vector(diagonal); - this->data->cell_loop( - &MassMatrixOperator::local_compute_diagonal, this, diagonal, dummy); + this->data->cell_loop(&MassMatrixOperator::local_compute_diagonal, + this, + diagonal, + dummy); this->set_constrained_entries_to_one(diagonal); inverse_diagonal = diagonal; @@ -719,8 +728,9 @@ namespace StokesClass pressure.evaluate(true, false, false); for (unsigned int q = 0; q < pressure.n_q_points; ++q) - pressure.submit_value( - one_over_viscosity(cell, q) * pressure.get_value(q), q); + pressure.submit_value(one_over_viscosity(cell, q) * + pressure.get_value(q), + q); pressure.integrate(true, false); diagonal[i] = pressure.begin_dof_values()[i]; @@ -738,9 +748,9 @@ namespace StokesClass Base> { public: - ABlockOperator() : - MatrixFreeOperators::Base>() + ABlockOperator() + : MatrixFreeOperators::Base>() {} void clear(); @@ -855,8 +865,10 @@ namespace StokesClass this->inverse_diagonal_entries->get_vector(); this->data->initialize_dof_vector(inverse_diagonal); unsigned int dummy = 0; - this->data->cell_loop( - &ABlockOperator::local_compute_diagonal, this, inverse_diagonal, dummy); + this->data->cell_loop(&ABlockOperator::local_compute_diagonal, + this, + inverse_diagonal, + dummy); this->set_constrained_entries_to_one(inverse_diagonal); @@ -966,19 +978,19 @@ namespace StokesClass template - StokesProblem::StokesProblem() : - degree_u(velocity_degree), - fe_u(FE_Q(degree_u), dim), - fe_p(FE_Q(degree_u - 1)), - triangulation( - MPI_COMM_WORLD, - typename Triangulation::MeshSmoothing( - Triangulation::limit_level_difference_at_vertices | - Triangulation::smoothing_on_refinement | - Triangulation::smoothing_on_coarsening), - parallel::distributed::Triangulation::construct_multigrid_hierarchy), - dof_handler_u(triangulation), - dof_handler_p(triangulation) + StokesProblem::StokesProblem() + : degree_u(velocity_degree) + , fe_u(FE_Q(degree_u), dim) + , fe_p(FE_Q(degree_u - 1)) + , triangulation(MPI_COMM_WORLD, + typename Triangulation::MeshSmoothing( + Triangulation::limit_level_difference_at_vertices | + Triangulation::smoothing_on_refinement | + Triangulation::smoothing_on_coarsening), + parallel::distributed::Triangulation< + dim>::construct_multigrid_hierarchy) + , dof_handler_u(triangulation) + , dof_handler_p(triangulation) {} template @@ -1107,8 +1119,9 @@ namespace StokesClass for (unsigned int level = 0; level < n_levels; ++level) { IndexSet relevant_dofs; - DoFTools::extract_locally_relevant_level_dofs( - dof_handler_u, level, relevant_dofs); + DoFTools::extract_locally_relevant_level_dofs(dof_handler_u, + level, + relevant_dofs); ConstraintMatrix level_constraints; level_constraints.reinit(relevant_dofs); level_constraints.add_lines( @@ -1128,8 +1141,9 @@ namespace StokesClass QGauss<1>(degree_u + 1), additional_data); - mg_matrices[level].initialize( - mg_mf_storage_level, mg_constrained_dofs, level); + mg_matrices[level].initialize(mg_mf_storage_level, + mg_constrained_dofs, + level); mg_matrices[level].evaluate_2_x_viscosity(Viscosity(sinker)); mg_matrices[level].compute_diagonal(); } @@ -1181,8 +1195,10 @@ namespace StokesClass std::shared_ptr> matrix_free_homogeneous( new MatrixFree()); - matrix_free_homogeneous->reinit( - dofs, constraints_no_dirchlet, QGauss<1>(degree_u + 1), data); + matrix_free_homogeneous->reinit(dofs, + constraints_no_dirchlet, + QGauss<1>(degree_u + 1), + data); operator_homogeneous.initialize(matrix_free_homogeneous); operator_homogeneous.evaluate_2_x_viscosity(Viscosity(sinker)); @@ -1258,8 +1274,10 @@ namespace StokesClass PrimitiveVectorMemory mem; - SolverControl solver_control_cheap( - n_cheap_stokes_solver_steps, solver_tolerance, false, false); + SolverControl solver_control_cheap(n_cheap_stokes_solver_steps, + solver_tolerance, + false, + false); typedef MGTransferMatrixFree Transfer; @@ -1318,8 +1336,9 @@ namespace StokesClass mg.set_edge_matrices(mg_interface, mg_interface); - PreconditionMG prec_A( - dof_handler_u, mg, mg_transfer); + PreconditionMG prec_A(dof_handler_u, + mg, + mg_transfer); typedef PreconditionChebyshev MassPrec; MassPrec prec_S; diff --git a/tests/matrix_free/thread_correctness.cc b/tests/matrix_free/thread_correctness.cc index 827f3ecbb3..b12277cab3 100644 --- a/tests/matrix_free/thread_correctness.cc +++ b/tests/matrix_free/thread_correctness.cc @@ -72,8 +72,10 @@ sub_test() dof.distribute_dofs(fe); ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); // std::cout << "Number of cells: " << diff --git a/tests/matrix_free/thread_correctness_hp.cc b/tests/matrix_free/thread_correctness_hp.cc index 87eec332df..169bdd83bd 100644 --- a/tests/matrix_free/thread_correctness_hp.cc +++ b/tests/matrix_free/thread_correctness_hp.cc @@ -38,7 +38,8 @@ template class MatrixFreeTestHP { public: - MatrixFreeTestHP(const MatrixFree &data_in) : data(data_in){}; + MatrixFreeTestHP(const MatrixFree &data_in) + : data(data_in){}; void local_apply(const MatrixFree & data, @@ -49,11 +50,13 @@ public: // Ask MatrixFree for cell_range for different // orders std::pair subrange_deg; -#define CALL_METHOD(degree) \ - subrange_deg = data.create_cell_subrange_hp(cell_range, degree); \ - if (subrange_deg.second > subrange_deg.first) \ - helmholtz_operator, degree + 1>( \ - data, dst, src, subrange_deg) +#define CALL_METHOD(degree) \ + subrange_deg = data.create_cell_subrange_hp(cell_range, degree); \ + if (subrange_deg.second > subrange_deg.first) \ + helmholtz_operator, degree + 1>(data, \ + dst, \ + src, \ + subrange_deg) CALL_METHOD(1); CALL_METHOD(2); @@ -130,8 +133,10 @@ do_test(const unsigned int parallel_option) dof.distribute_dofs(fe_collection); ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); // std::cout << "Number of cells: " << diff --git a/tests/meshworker/mesh_loop_gmg_01.cc b/tests/meshworker/mesh_loop_gmg_01.cc index d800a7de20..de10d882fe 100644 --- a/tests/meshworker/mesh_loop_gmg_01.cc +++ b/tests/meshworker/mesh_loop_gmg_01.cc @@ -38,7 +38,10 @@ struct CopyData unsigned int n_own_cells; unsigned int n_ghost_cells; - CopyData() : n_cells(0), n_own_cells(0), n_ghost_cells(0) + CopyData() + : n_cells(0) + , n_own_cells(0) + , n_ghost_cells(0) {} void @@ -119,8 +122,8 @@ test() std::function empty_cell_worker; - std::function + std::function< + void(const Iterator &, const unsigned int &, ScratchData &, CopyData &)> empty_boundary_worker; auto print_summary = [&]() { diff --git a/tests/meshworker/mesh_loop_mpi_01.cc b/tests/meshworker/mesh_loop_mpi_01.cc index dfa4d367b8..76c4334ba3 100644 --- a/tests/meshworker/mesh_loop_mpi_01.cc +++ b/tests/meshworker/mesh_loop_mpi_01.cc @@ -36,7 +36,10 @@ struct CopyData unsigned int n_own_cells; unsigned int n_ghost_cells; - CopyData() : n_cells(0), n_own_cells(0), n_ghost_cells(0) + CopyData() + : n_cells(0) + , n_own_cells(0) + , n_ghost_cells(0) {} void diff --git a/tests/meshworker/step-11-mesh_loop.cc b/tests/meshworker/step-11-mesh_loop.cc index 58ddae4dc3..dcf7d84d37 100644 --- a/tests/meshworker/step-11-mesh_loop.cc +++ b/tests/meshworker/step-11-mesh_loop.cc @@ -117,10 +117,10 @@ namespace Step11 // denotes the polynomial degree), and mappings of given order. Print to // screen what we are about to do. template - LaplaceProblem::LaplaceProblem(const unsigned int mapping_degree) : - fe(1), - dof_handler(triangulation), - mapping(mapping_degree) + LaplaceProblem::LaplaceProblem(const unsigned int mapping_degree) + : fe(1) + , dof_handler(triangulation) + , mapping(mapping_degree) { deallog << "Using mapping with degree " << mapping_degree << ":\n" << "============================" << std::endl; @@ -142,8 +142,9 @@ namespace Step11 system_rhs.reinit(dof_handler.n_dofs()); std::vector boundary_dofs(dof_handler.n_dofs(), false); - DoFTools::extract_boundary_dofs( - dof_handler, ComponentMask(), boundary_dofs); + DoFTools::extract_boundary_dofs(dof_handler, + ComponentMask(), + boundary_dofs); const unsigned int first_boundary_dof = std::distance( boundary_dofs.begin(), @@ -179,30 +180,30 @@ namespace Step11 { ScratchData(const Mapping & mapping, const FiniteElement &fe, - const unsigned int quadrature_degree) : - fe_values(mapping, - fe, - QGauss(quadrature_degree), - update_values | update_gradients | update_quadrature_points | - update_JxW_values), - fe_face_values(mapping, - fe, - QGauss(quadrature_degree), - update_values | update_quadrature_points | - update_JxW_values | update_normal_vectors) + const unsigned int quadrature_degree) + : fe_values(mapping, + fe, + QGauss(quadrature_degree), + update_values | update_gradients | update_quadrature_points | + update_JxW_values) + , fe_face_values(mapping, + fe, + QGauss(quadrature_degree), + update_values | update_quadrature_points | + update_JxW_values | update_normal_vectors) {} - ScratchData(const ScratchData &scratch_data) : - fe_values(scratch_data.fe_values.get_mapping(), - scratch_data.fe_values.get_fe(), - scratch_data.fe_values.get_quadrature(), - update_values | update_gradients | update_quadrature_points | - update_JxW_values), - fe_face_values(scratch_data.fe_face_values.get_mapping(), - scratch_data.fe_face_values.get_fe(), - scratch_data.fe_face_values.get_quadrature(), - update_values | update_quadrature_points | - update_JxW_values | update_normal_vectors) + ScratchData(const ScratchData &scratch_data) + : fe_values(scratch_data.fe_values.get_mapping(), + scratch_data.fe_values.get_fe(), + scratch_data.fe_values.get_quadrature(), + update_values | update_gradients | update_quadrature_points | + update_JxW_values) + , fe_face_values(scratch_data.fe_face_values.get_mapping(), + scratch_data.fe_face_values.get_fe(), + scratch_data.fe_face_values.get_quadrature(), + update_values | update_quadrature_points | + update_JxW_values | update_normal_vectors) {} FEValues fe_values; @@ -294,9 +295,10 @@ namespace Step11 system_rhs); }; - const unsigned int gauss_degree = std::max( - static_cast(std::ceil(1. * (mapping.get_degree() + 1) / 2)), - 2U); + const unsigned int gauss_degree = + std::max(static_cast( + std::ceil(1. * (mapping.get_degree() + 1) / 2)), + 2U); MeshWorker::mesh_loop(dof_handler.begin_active(), dof_handler.end(), @@ -340,8 +342,10 @@ namespace Step11 // Then, the function just called returns its results as a vector of // values each of which denotes the norm on one cell. To get the global // norm, we do the following: - const double norm = VectorTools::compute_global_error( - triangulation, norm_per_cell, VectorTools::H1_seminorm); + const double norm = + VectorTools::compute_global_error(triangulation, + norm_per_cell, + VectorTools::H1_seminorm); // Last task -- generate output: output_table.add_value("cells", triangulation.n_active_cells()); diff --git a/tests/meshworker/step-50-mesh_loop.cc b/tests/meshworker/step-50-mesh_loop.cc index 9013045abe..0017ec5af7 100644 --- a/tests/meshworker/step-50-mesh_loop.cc +++ b/tests/meshworker/step-50-mesh_loop.cc @@ -89,18 +89,18 @@ namespace Step50 struct ScratchData { ScratchData(const FiniteElement &fe, - const unsigned int quadrature_degree) : - fe_values(fe, - QGauss(quadrature_degree), - update_values | update_gradients | update_quadrature_points | - update_JxW_values) + const unsigned int quadrature_degree) + : fe_values(fe, + QGauss(quadrature_degree), + update_values | update_gradients | update_quadrature_points | + update_JxW_values) {} - ScratchData(const ScratchData &scratch_data) : - fe_values(scratch_data.fe_values.get_fe(), - scratch_data.fe_values.get_quadrature(), - update_values | update_gradients | update_quadrature_points | - update_JxW_values) + ScratchData(const ScratchData &scratch_data) + : fe_values(scratch_data.fe_values.get_fe(), + scratch_data.fe_values.get_quadrature(), + update_values | update_gradients | update_quadrature_points | + update_JxW_values) {} FEValues fe_values; @@ -168,7 +168,8 @@ namespace Step50 class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -215,14 +216,14 @@ namespace Step50 template - LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation( - MPI_COMM_WORLD, - Triangulation::limit_level_difference_at_vertices, - parallel::distributed::Triangulation::construct_multigrid_hierarchy), - fe(degree), - mg_dof_handler(triangulation), - degree(degree) + LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(MPI_COMM_WORLD, + Triangulation::limit_level_difference_at_vertices, + parallel::distributed::Triangulation< + dim>::construct_multigrid_hierarchy) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) {} @@ -248,15 +249,18 @@ namespace Step50 Functions::ConstantFunction homogeneous_dirichlet_bc(1.0); dirichlet_boundary_ids.insert(0); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - VectorTools::interpolate_boundary_values( - mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); DynamicSparsityPattern dsp(mg_dof_handler.n_dofs(), mg_dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(mg_dof_handler, dsp, constraints); - system_matrix.reinit( - mg_dof_handler.locally_owned_dofs(), dsp, MPI_COMM_WORLD, true); + system_matrix.reinit(mg_dof_handler.locally_owned_dofs(), + dsp, + MPI_COMM_WORLD, + true); mg_constrained_dofs.clear(); @@ -289,8 +293,10 @@ namespace Step50 { DynamicSparsityPattern dsp(mg_dof_handler.n_dofs(level), mg_dof_handler.n_dofs(level)); - MGTools::make_interface_sparsity_pattern( - mg_dof_handler, mg_constrained_dofs, dsp, level); + MGTools::make_interface_sparsity_pattern(mg_dof_handler, + mg_constrained_dofs, + dsp, + level); mg_interface_matrices[level].reinit( mg_dof_handler.locally_owned_mg_dofs(level), @@ -362,8 +368,9 @@ namespace Step50 ++level) { IndexSet dofset; - DoFTools::extract_locally_relevant_level_dofs( - mg_dof_handler, level, dofset); + DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler, + level, + dofset); boundary_constraints[level].reinit(dofset); boundary_constraints[level].add_lines( mg_constrained_dofs.get_refinement_edge_indices(level)); diff --git a/tests/mpi/cell_weights_01_back_and_forth_01.cc b/tests/mpi/cell_weights_01_back_and_forth_01.cc index 94e80762a8..690b34defb 100644 --- a/tests/mpi/cell_weights_01_back_and_forth_01.cc +++ b/tests/mpi/cell_weights_01_back_and_forth_01.cc @@ -75,14 +75,16 @@ test() // repartition the mesh as described above, first in some arbitrary // way, and then with all equal weights - tr.signals.cell_weight.connect(std::bind( - &cell_weight_1, std::placeholders::_1, std::placeholders::_2)); + tr.signals.cell_weight.connect(std::bind(&cell_weight_1, + std::placeholders::_1, + std::placeholders::_2)); tr.repartition(); tr.signals.cell_weight.disconnect_all_slots(); - tr.signals.cell_weight.connect(std::bind( - &cell_weight_2, std::placeholders::_1, std::placeholders::_2)); + tr.signals.cell_weight.connect(std::bind(&cell_weight_2, + std::placeholders::_1, + std::placeholders::_2)); tr.repartition(); diff --git a/tests/mpi/cell_weights_01_back_and_forth_02.cc b/tests/mpi/cell_weights_01_back_and_forth_02.cc index b84e11edf8..0a7345dfee 100644 --- a/tests/mpi/cell_weights_01_back_and_forth_02.cc +++ b/tests/mpi/cell_weights_01_back_and_forth_02.cc @@ -64,8 +64,9 @@ test() // repartition the mesh as described above, first in some arbitrary // way, and then with no weights - tr.signals.cell_weight.connect(std::bind( - &cell_weight_1, std::placeholders::_1, std::placeholders::_2)); + tr.signals.cell_weight.connect(std::bind(&cell_weight_1, + std::placeholders::_1, + std::placeholders::_2)); tr.repartition(); tr.signals.cell_weight.disconnect_all_slots(); diff --git a/tests/mpi/condense_01.cc b/tests/mpi/condense_01.cc index 6b4b6e6a16..85b0581bd8 100644 --- a/tests/mpi/condense_01.cc +++ b/tests/mpi/condense_01.cc @@ -80,8 +80,9 @@ test() DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs); PETScWrappers::MPI::Vector vec(locally_owned_dofs, MPI_COMM_WORLD); - PETScWrappers::MPI::Vector vec_ghosted( - locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD); + PETScWrappers::MPI::Vector vec_ghosted(locally_owned_dofs, + locally_relevant_dofs, + MPI_COMM_WORLD); vec = 1; vec_ghosted = vec; vec = -1; diff --git a/tests/mpi/constraint_matrix_condense_01.cc b/tests/mpi/constraint_matrix_condense_01.cc index a97dc23110..25a104b60c 100644 --- a/tests/mpi/constraint_matrix_condense_01.cc +++ b/tests/mpi/constraint_matrix_condense_01.cc @@ -60,8 +60,9 @@ test() constraints.clear(); { IndexSet boundary_dofs(dof_handler.n_dofs()); - DoFTools::extract_boundary_dofs( - dof_handler, std::vector(1, true), boundary_dofs); + DoFTools::extract_boundary_dofs(dof_handler, + std::vector(1, true), + boundary_dofs); unsigned int first_nboundary_dof = 0; while (boundary_dofs.is_element(first_nboundary_dof)) diff --git a/tests/mpi/constraint_matrix_set_zero_02.cc b/tests/mpi/constraint_matrix_set_zero_02.cc index af2b3b6007..18c13e4da1 100644 --- a/tests/mpi/constraint_matrix_set_zero_02.cc +++ b/tests/mpi/constraint_matrix_set_zero_02.cc @@ -45,10 +45,12 @@ test() local_active[1].add_range(myid * 2, myid * 2 + 2); LinearAlgebra::distributed::BlockVector v(2); - v.block(0).reinit( - local_active[0], complete_index_set(numproc), MPI_COMM_WORLD); - v.block(1).reinit( - local_active[1], complete_index_set(2 * numproc), MPI_COMM_WORLD); + v.block(0).reinit(local_active[0], + complete_index_set(numproc), + MPI_COMM_WORLD); + 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) diff --git a/tests/mpi/constraints_consistent_01.cc b/tests/mpi/constraints_consistent_01.cc index 9d6abbf951..8216019ef0 100644 --- a/tests/mpi/constraints_consistent_01.cc +++ b/tests/mpi/constraints_consistent_01.cc @@ -71,11 +71,11 @@ check(parallel::distributed::Triangulation &tria) ConstantFunction(static_cast(id) + 42.0, dim), constraints); - VectorTools::compute_no_normal_flux_constraints( - dof_handler, - 0, /*first component*/ - std::set{2}, - constraints); + VectorTools::compute_no_normal_flux_constraints(dof_handler, + 0, /*first component*/ + std::set{ + 2}, + constraints); constraints.close(); deallog << "LocallyOwned = " << std::flush; diff --git a/tests/mpi/data_out_faces_01.cc b/tests/mpi/data_out_faces_01.cc index 91d6e7a357..b0c96b5b80 100644 --- a/tests/mpi/data_out_faces_01.cc +++ b/tests/mpi/data_out_faces_01.cc @@ -79,11 +79,11 @@ namespace pdd // The constructor and destructor of the class template - PDDProblem::PDDProblem() : - mpi_communicator(MPI_COMM_WORLD), - triangulation(mpi_communicator), - dof_handler(triangulation), - fe(1) + PDDProblem::PDDProblem() + : mpi_communicator(MPI_COMM_WORLD) + , triangulation(mpi_communicator) + , dof_handler(triangulation) + , fe(1) {} @@ -139,8 +139,9 @@ namespace pdd // First generate an output for the cells const unsigned int cycle = 1; - PETScWrappers::MPI::Vector solution( - locally_owned_dofs, locally_relevant_dofs, mpi_communicator); + PETScWrappers::MPI::Vector solution(locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); solution = locally_relevant_solution; DataOut data_out; diff --git a/tests/mpi/data_out_faces_02.cc b/tests/mpi/data_out_faces_02.cc index dc9c898ec6..4bf0518cdc 100644 --- a/tests/mpi/data_out_faces_02.cc +++ b/tests/mpi/data_out_faces_02.cc @@ -81,8 +81,9 @@ main(int argc, char *argv[]) locally_owned_dofs = dof_handler.locally_owned_dofs(); DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs); - locally_relevant_sol.reinit( - locally_owned_dofs, locally_relevant_dofs, mpi_communicator); + locally_relevant_sol.reinit(locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); DataOutFaces data_out_face(false); diff --git a/tests/mpi/data_out_hdf5_02.cc b/tests/mpi/data_out_hdf5_02.cc index 935cc7d81b..dcbea69659 100644 --- a/tests/mpi/data_out_hdf5_02.cc +++ b/tests/mpi/data_out_hdf5_02.cc @@ -101,8 +101,10 @@ check() std::string output_basename = std::to_string(dim) + std::to_string(spacedim); - DataOutBase::write_hdf5_parallel( - patches, data_filter, output_basename + ".h5", MPI_COMM_WORLD); + DataOutBase::write_hdf5_parallel(patches, + data_filter, + output_basename + ".h5", + MPI_COMM_WORLD); const double current_time = 0.0; XDMFEntry entry(output_basename + ".h5", diff --git a/tests/mpi/derivative_approximation_01.cc b/tests/mpi/derivative_approximation_01.cc index 00932715b8..273c0e09a6 100644 --- a/tests/mpi/derivative_approximation_01.cc +++ b/tests/mpi/derivative_approximation_01.cc @@ -88,8 +88,10 @@ test() MappingQGeneric mapping(1); Vector indicators(tr.n_active_cells()); - DerivativeApproximation::approximate_gradient( - mapping, dofh, vec_rel, indicators); + DerivativeApproximation::approximate_gradient(mapping, + dofh, + vec_rel, + indicators); // we got here, so no exception. if (myid == 0) diff --git a/tests/mpi/distribute_flux_sparsity_pattern.cc b/tests/mpi/distribute_flux_sparsity_pattern.cc index bc729496ae..c033eb23c3 100644 --- a/tests/mpi/distribute_flux_sparsity_pattern.cc +++ b/tests/mpi/distribute_flux_sparsity_pattern.cc @@ -89,10 +89,10 @@ namespace LinearAdvectionTest template - AdvectionProblem::AdvectionProblem() : - triangulation(MPI_COMM_WORLD), - fe(1), - dof_handler(triangulation) + AdvectionProblem::AdvectionProblem() + : triangulation(MPI_COMM_WORLD) + , fe(1) + , dof_handler(triangulation) { std::vector repetitions(2); repetitions[0] = 2; @@ -100,8 +100,10 @@ namespace LinearAdvectionTest const Point<2> p0(0.0, 0.0); const Point<2> p1(2.0, 1.0); - GridGenerator::subdivided_hyper_rectangle( - triangulation, repetitions, p0, p1); + GridGenerator::subdivided_hyper_rectangle(triangulation, + repetitions, + p0, + p1); } template @@ -226,12 +228,14 @@ namespace LinearAdvectionTest const UpdateFlags update_flags = update_values | update_quadrature_points | update_JxW_values; - FEFaceValues current_face_values( - fe, face_quadrature, update_flags | update_normal_vectors); + FEFaceValues current_face_values(fe, + face_quadrature, + update_flags | update_normal_vectors); FEFaceValues neighbor_face_values(fe, face_quadrature, update_flags); - FESubfaceValues neighbor_subface_values( - fe, face_quadrature, update_flags); + FESubfaceValues neighbor_subface_values(fe, + face_quadrature, + update_flags); typename DoFHandler::active_cell_iterator current_cell = dof_handler.begin_active(), diff --git a/tests/mpi/distribute_sp_01.cc b/tests/mpi/distribute_sp_01.cc index ec38059482..cb1e28a228 100644 --- a/tests/mpi/distribute_sp_01.cc +++ b/tests/mpi/distribute_sp_01.cc @@ -57,8 +57,10 @@ test_mpi() 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); + 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()); diff --git a/tests/mpi/distribute_sp_02.cc b/tests/mpi/distribute_sp_02.cc index 9476a9433d..ed89eb9df2 100644 --- a/tests/mpi/distribute_sp_02.cc +++ b/tests/mpi/distribute_sp_02.cc @@ -67,8 +67,10 @@ test_mpi() deallog << "size: " << csp.n_rows() << "x" << csp.n_cols() << std::endl; } - SparsityTools::distribute_sparsity_pattern( - csp, locally_owned_dofs_per_cpu, MPI_COMM_WORLD, locally_rel); + SparsityTools::distribute_sparsity_pattern(csp, + locally_owned_dofs_per_cpu, + MPI_COMM_WORLD, + locally_rel); /* { std::ofstream f((std::string("after")+Utilities::int_to_string(myid)).c_str()); @@ -117,8 +119,10 @@ test_mpi() (i + 1) * num_local); - SparsityTools::distribute_sparsity_pattern( - csp, locally_owned_dofs_per_cpu2, MPI_COMM_WORLD, locally_rel); + SparsityTools::distribute_sparsity_pattern(csp, + locally_owned_dofs_per_cpu2, + MPI_COMM_WORLD, + locally_rel); if (myid == 0) { diff --git a/tests/mpi/extract_boundary_dofs.cc b/tests/mpi/extract_boundary_dofs.cc index 139f6529e6..70df4be27c 100644 --- a/tests/mpi/extract_boundary_dofs.cc +++ b/tests/mpi/extract_boundary_dofs.cc @@ -44,8 +44,9 @@ test() dofh.distribute_dofs(fe); IndexSet relevant_set, boundary_dofs; - DoFTools::extract_boundary_dofs( - dofh, std::vector(1, true), boundary_dofs); + DoFTools::extract_boundary_dofs(dofh, + std::vector(1, true), + boundary_dofs); if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) boundary_dofs.write(deallog.get_file_stream()); diff --git a/tests/mpi/fe_field_function_03.cc b/tests/mpi/fe_field_function_03.cc index e5e0779d5d..6fb7373b5c 100644 --- a/tests/mpi/fe_field_function_03.cc +++ b/tests/mpi/fe_field_function_03.cc @@ -75,8 +75,9 @@ test() { parallel::distributed::Triangulation tr(MPI_COMM_WORLD); - GridGenerator::hyper_cube_with_cylindrical_hole( - tr, 0.05 /* cylinder radius */, 0.4 / 2.0 /* box radius */); + GridGenerator::hyper_cube_with_cylindrical_hole(tr, + 0.05 /* cylinder radius */, + 0.4 / 2.0 /* box radius */); tr.refine_global(1); const FE_Q fe(1); diff --git a/tests/mpi/fe_tools_extrapolate_common.h b/tests/mpi/fe_tools_extrapolate_common.h index bc1ea5e5f3..1d23bae9fc 100644 --- a/tests/mpi/fe_tools_extrapolate_common.h +++ b/tests/mpi/fe_tools_extrapolate_common.h @@ -49,7 +49,9 @@ template class TestFunction : public Function { public: - TestFunction(unsigned int deg) : Function(), degree(deg) + TestFunction(unsigned int deg) + : Function() + , degree(deg) {} virtual double @@ -141,8 +143,9 @@ build_ghosted(const IndexSet &owned_indices, const IndexSet &ghosted_indices) { std::vector owned_indices_vector(1, owned_indices); std::vector ghosted_indices_vector(1, ghosted_indices); - return VectorType( - owned_indices_vector, ghosted_indices_vector, MPI_COMM_WORLD); + return VectorType(owned_indices_vector, + ghosted_indices_vector, + MPI_COMM_WORLD); } diff --git a/tests/mpi/flux_edge_01.cc b/tests/mpi/flux_edge_01.cc index d251aa0c14..d5219d58a2 100644 --- a/tests/mpi/flux_edge_01.cc +++ b/tests/mpi/flux_edge_01.cc @@ -97,14 +97,14 @@ namespace Step39 template InteriorPenaltyProblem::InteriorPenaltyProblem( - const FiniteElement &fe) : - triangulation( - MPI_COMM_WORLD, - Triangulation::limit_level_difference_at_vertices, - parallel::distributed::Triangulation::construct_multigrid_hierarchy), - mapping(1), - fe(fe), - dof_handler(triangulation) + const FiniteElement &fe) + : triangulation(MPI_COMM_WORLD, + Triangulation::limit_level_difference_at_vertices, + parallel::distributed::Triangulation< + dim>::construct_multigrid_hierarchy) + , mapping(1) + , fe(fe) + , dof_handler(triangulation) { GridGenerator::hyper_cube_slit(triangulation, -1, 1); } @@ -122,8 +122,10 @@ namespace Step39 DynamicSparsityPattern 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); + matrix.reinit(dof_handler.locally_owned_dofs(), + c_sparsity, + MPI_COMM_WORLD, + true); const unsigned int n_levels = triangulation.n_global_levels(); mg_matrix.resize(0, n_levels - 1); @@ -150,8 +152,9 @@ namespace Step39 DynamicSparsityPattern ci_sparsity; 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); + 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), diff --git a/tests/mpi/has_active_dofs_01.cc b/tests/mpi/has_active_dofs_01.cc index 1d3766f51f..06898f5c50 100644 --- a/tests/mpi/has_active_dofs_01.cc +++ b/tests/mpi/has_active_dofs_01.cc @@ -57,11 +57,12 @@ test() // let each of the processors report whether they own // cells or now by setting a bit mask that we then add up. // output which processor owns something and which don't - const int cells_owned = Utilities::MPI::sum( - tr.n_locally_owned_active_cells() > 0 ? - 1 << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) : - 0, - MPI_COMM_WORLD); + const int cells_owned = + Utilities::MPI::sum(tr.n_locally_owned_active_cells() > 0 ? + 1 << Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD) : + 0, + MPI_COMM_WORLD); if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) { for (unsigned int i = 0; @@ -82,11 +83,12 @@ test() } // now check how many processors own DoFs using the same procedure - const int dofs_owned = Utilities::MPI::sum( - dof_handler.has_active_dofs() ? - 1 << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) : - 0, - MPI_COMM_WORLD); + const int dofs_owned = + Utilities::MPI::sum(dof_handler.has_active_dofs() ? + 1 << Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD) : + 0, + MPI_COMM_WORLD); if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) { for (unsigned int i = 0; diff --git a/tests/mpi/has_active_dofs_02.cc b/tests/mpi/has_active_dofs_02.cc index b06902ee92..146b11d569 100644 --- a/tests/mpi/has_active_dofs_02.cc +++ b/tests/mpi/has_active_dofs_02.cc @@ -59,11 +59,12 @@ test() // let each of the processors report whether they own // cells or now by setting a bit mask that we then add up. // output which processor owns something and which don't - const int cells_owned = Utilities::MPI::sum( - tr.n_locally_owned_active_cells() > 0 ? - 1 << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) : - 0, - MPI_COMM_WORLD); + const int cells_owned = + Utilities::MPI::sum(tr.n_locally_owned_active_cells() > 0 ? + 1 << Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD) : + 0, + MPI_COMM_WORLD); if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) { for (unsigned int i = 0; @@ -84,11 +85,12 @@ test() } // now check how many processors own DoFs using the same procedure - const int dofs_owned = Utilities::MPI::sum( - dof_handler.has_active_dofs() ? - 1 << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) : - 0, - MPI_COMM_WORLD); + const int dofs_owned = + Utilities::MPI::sum(dof_handler.has_active_dofs() ? + 1 << Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD) : + 0, + MPI_COMM_WORLD); if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) { for (unsigned int i = 0; diff --git a/tests/mpi/has_hanging_nodes.cc b/tests/mpi/has_hanging_nodes.cc index cd4fed3999..0998822a0b 100644 --- a/tests/mpi/has_hanging_nodes.cc +++ b/tests/mpi/has_hanging_nodes.cc @@ -86,17 +86,21 @@ test_int(const unsigned int n_global = 0, const unsigned int n_local = 0) { Triangulation triangulation1; Triangulation triangulation2; - GridGenerator::hyper_cube( - triangulation1, -1, 0); // create a square [-1,0]^d domain - GridGenerator::hyper_cube( - triangulation2, -1, 0); // create a square [-1,0]^d domain + GridGenerator::hyper_cube(triangulation1, + -1, + 0); // create a square [-1,0]^d domain + GridGenerator::hyper_cube(triangulation2, + -1, + 0); // create a square [-1,0]^d domain Point shift_vector; shift_vector[0] = 1.0; GridTools::shift(shift_vector, triangulation2); - GridGenerator::merge_triangulations( - triangulation1, triangulation2, tria_distrib); - GridGenerator::merge_triangulations( - triangulation1, triangulation2, tria_sequential); + GridGenerator::merge_triangulations(triangulation1, + triangulation2, + tria_distrib); + GridGenerator::merge_triangulations(triangulation1, + triangulation2, + tria_sequential); } tria_distrib.refine_global(n_global); diff --git a/tests/mpi/hp_step-40.cc b/tests/mpi/hp_step-40.cc index 100021ffe0..84fcb5e28c 100644 --- a/tests/mpi/hp_step-40.cc +++ b/tests/mpi/hp_step-40.cc @@ -109,18 +109,18 @@ namespace Step40 template - LaplaceProblem::LaplaceProblem() : - mpi_communicator(MPI_COMM_WORLD), - triangulation(mpi_communicator, - typename Triangulation::MeshSmoothing( - Triangulation::smoothing_on_refinement | - Triangulation::smoothing_on_coarsening)), - dof_handler(triangulation), - fe(FE_Q(2)), - pcout(Utilities::MPI::this_mpi_process(mpi_communicator) == 0 ? - deallog.get_file_stream() : - std::cout, - (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)) + LaplaceProblem::LaplaceProblem() + : mpi_communicator(MPI_COMM_WORLD) + , triangulation(mpi_communicator, + typename Triangulation::MeshSmoothing( + Triangulation::smoothing_on_refinement | + Triangulation::smoothing_on_coarsening)) + , dof_handler(triangulation) + , fe(FE_Q(2)) + , pcout(Utilities::MPI::this_mpi_process(mpi_communicator) == 0 ? + deallog.get_file_stream() : + std::cout, + (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)) {} @@ -142,20 +142,24 @@ namespace Step40 locally_owned_dofs = dof_handler.locally_owned_dofs(); DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs); - locally_relevant_solution.reinit( - locally_owned_dofs, locally_relevant_dofs, mpi_communicator); + locally_relevant_solution.reinit(locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); system_rhs.reinit(locally_owned_dofs, mpi_communicator); system_rhs = PetscScalar(); constraints.clear(); constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); - DynamicSparsityPattern csp( - dof_handler.n_dofs(), dof_handler.n_dofs(), locally_relevant_dofs); + DynamicSparsityPattern csp(dof_handler.n_dofs(), + dof_handler.n_dofs(), + locally_relevant_dofs); DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false); SparsityTools::distribute_sparsity_pattern( csp, @@ -273,14 +277,14 @@ namespace Step40 10, 10); #else - check_solver_within_range( - solver.solve(system_matrix, - completely_distributed_solution, - system_rhs, - PETScWrappers::PreconditionJacobi(system_matrix)), - solver_control.last_step(), - 120, - 260); + check_solver_within_range(solver.solve(system_matrix, + completely_distributed_solution, + system_rhs, + PETScWrappers::PreconditionJacobi( + system_matrix)), + solver_control.last_step(), + 120, + 260); #endif pcout << " Solved in " << solver_control.last_step() << " iterations." diff --git a/tests/mpi/hp_unify_dof_indices_01.cc b/tests/mpi/hp_unify_dof_indices_01.cc index 20c1e8de05..317dc41a16 100644 --- a/tests/mpi/hp_unify_dof_indices_01.cc +++ b/tests/mpi/hp_unify_dof_indices_01.cc @@ -54,8 +54,10 @@ test() Point top_right; for (unsigned int d = 0; d < dim; ++d) top_right[d] = (d == 0 ? 2 : 1); - GridGenerator::subdivided_hyper_rectangle( - triangulation, reps, Point(), top_right); + GridGenerator::subdivided_hyper_rectangle(triangulation, + reps, + Point(), + top_right); Assert(triangulation.n_global_active_cells() == 2, ExcInternalError()); Assert(triangulation.n_active_cells() == 2, ExcInternalError()); diff --git a/tests/mpi/interpolate_02.cc b/tests/mpi/interpolate_02.cc index 567dde415a..32b12d9454 100644 --- a/tests/mpi/interpolate_02.cc +++ b/tests/mpi/interpolate_02.cc @@ -66,11 +66,13 @@ test() dofh.distribute_dofs(fe); IndexSet owned_set = dofh.locally_owned_dofs(); - PETScWrappers::MPI::Vector x( - MPI_COMM_WORLD, dofh.n_dofs(), owned_set.n_elements()); + PETScWrappers::MPI::Vector x(MPI_COMM_WORLD, + dofh.n_dofs(), + owned_set.n_elements()); - VectorTools::interpolate( - dofh, Functions::ConstantFunction(1), x); + VectorTools::interpolate(dofh, + Functions::ConstantFunction(1), + x); const double norm = x.l2_norm(); if (myid == 0) deallog << dofh.n_locally_owned_dofs() << ' ' << dofh.n_dofs() << std::endl diff --git a/tests/mpi/interpolate_04.cc b/tests/mpi/interpolate_04.cc index f93b840368..dceb5dc597 100644 --- a/tests/mpi/interpolate_04.cc +++ b/tests/mpi/interpolate_04.cc @@ -72,8 +72,9 @@ test() DoFTools::extract_locally_relevant_dofs(dofh2, dof2_locally_relevant_dofs); DoFTools::extract_locally_relevant_dofs(dofh1, dof1_locally_relevant_dofs); - PETScWrappers::MPI::Vector u1( - dof1_locally_owned_dofs, dof1_locally_relevant_dofs, MPI_COMM_WORLD); + 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); diff --git a/tests/mpi/interpolate_05.cc b/tests/mpi/interpolate_05.cc index 595f4a5353..c19bbb5e02 100644 --- a/tests/mpi/interpolate_05.cc +++ b/tests/mpi/interpolate_05.cc @@ -78,8 +78,10 @@ test() // This failed before this test was introduced. // Interpolate onto the first component only. - VectorTools::interpolate( - dofh, Functions::ConstantFunction(1, 2), x, ComponentMask(components)); + VectorTools::interpolate(dofh, + Functions::ConstantFunction(1, 2), + x, + ComponentMask(components)); // Integrate the difference in the first component, if everything went // well, this should be zero. diff --git a/tests/mpi/interpolate_to_different_mesh_01.cc b/tests/mpi/interpolate_to_different_mesh_01.cc index 86eed630c3..7cacf4f6ac 100644 --- a/tests/mpi/interpolate_to_different_mesh_01.cc +++ b/tests/mpi/interpolate_to_different_mesh_01.cc @@ -167,9 +167,10 @@ test() local_errors, QGauss(3), VectorTools::L2_norm); - double total_local_error = local_errors.l2_norm(); - const double total_global_error = std::sqrt(Utilities::MPI::sum( - total_local_error * total_local_error, MPI_COMM_WORLD)); + double total_local_error = local_errors.l2_norm(); + const double total_global_error = + std::sqrt(Utilities::MPI::sum(total_local_error * total_local_error, + MPI_COMM_WORLD)); if (myid == 0) deallog << "err: " << total_global_error << std::endl; } diff --git a/tests/mpi/interpolate_to_different_mesh_02.cc b/tests/mpi/interpolate_to_different_mesh_02.cc index 172b596c95..415057ca73 100644 --- a/tests/mpi/interpolate_to_different_mesh_02.cc +++ b/tests/mpi/interpolate_to_different_mesh_02.cc @@ -83,27 +83,27 @@ private: unsigned int prob_number; }; template -SeventhProblem::SeventhProblem(unsigned int prob_number) : - mpi_communicator(MPI_COMM_WORLD), - settings( - parallel::distributed::Triangulation<2, 2>::no_automatic_repartitioning), - triangulation(mpi_communicator, - typename Triangulation::MeshSmoothing( - Triangulation::smoothing_on_refinement | - Triangulation::smoothing_on_coarsening), - settings), - dof_handler(triangulation), - fe(2), - second_triangulation(mpi_communicator, - typename Triangulation::MeshSmoothing( - Triangulation::smoothing_on_refinement | - Triangulation::smoothing_on_coarsening), - settings), - second_dof_handler(second_triangulation), - second_fe(2), - pcout(deallog.get_file_stream(), - (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)), - prob_number(prob_number) +SeventhProblem::SeventhProblem(unsigned int prob_number) + : mpi_communicator(MPI_COMM_WORLD) + , settings( + parallel::distributed::Triangulation<2, 2>::no_automatic_repartitioning) + , triangulation(mpi_communicator, + typename Triangulation::MeshSmoothing( + Triangulation::smoothing_on_refinement | + Triangulation::smoothing_on_coarsening), + settings) + , dof_handler(triangulation) + , fe(2) + , second_triangulation(mpi_communicator, + typename Triangulation::MeshSmoothing( + Triangulation::smoothing_on_refinement | + Triangulation::smoothing_on_coarsening), + settings) + , second_dof_handler(second_triangulation) + , second_fe(2) + , pcout(deallog.get_file_stream(), + (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)) + , prob_number(prob_number) {} template @@ -120,15 +120,18 @@ SeventhProblem::setup_system() dof_handler.distribute_dofs(fe); locally_owned_dofs = dof_handler.locally_owned_dofs(); DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs); - locally_relevant_solution.reinit( - locally_owned_dofs, locally_relevant_dofs, mpi_communicator); + locally_relevant_solution.reinit(locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); system_rhs.reinit(locally_owned_dofs, mpi_communicator); system_rhs = 0; constraints.clear(); constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); DynamicSparsityPattern csp(locally_relevant_dofs); DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false); @@ -137,8 +140,10 @@ SeventhProblem::setup_system() dof_handler.n_locally_owned_dofs_per_processor(), mpi_communicator, locally_relevant_dofs); - system_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + system_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); } template @@ -149,10 +154,12 @@ SeventhProblem::setup_second_system() second_locally_owned_dofs = second_dof_handler.locally_owned_dofs(); DoFTools::extract_locally_relevant_dofs(second_dof_handler, second_locally_relevant_dofs); - second_locally_relevant_solution.reinit( - second_locally_owned_dofs, second_locally_relevant_dofs, mpi_communicator); - interpolated_locally_relevant_solution.reinit( - second_locally_owned_dofs, second_locally_relevant_dofs, mpi_communicator); + second_locally_relevant_solution.reinit(second_locally_owned_dofs, + second_locally_relevant_dofs, + mpi_communicator); + interpolated_locally_relevant_solution.reinit(second_locally_owned_dofs, + second_locally_relevant_dofs, + mpi_communicator); } template @@ -215,8 +222,10 @@ SeventhProblem::solve() TrilinosWrappers::PreconditionAMG preconditioner; TrilinosWrappers::PreconditionAMG::AdditionalData data; preconditioner.initialize(system_matrix, data); - solver.solve( - system_matrix, completely_distributed_solution, system_rhs, preconditioner); + solver.solve(system_matrix, + completely_distributed_solution, + system_rhs, + preconditioner); pcout << " Solved in " << solver_control.last_step() << " iterations." << std::endl; constraints.distribute(completely_distributed_solution); @@ -279,9 +288,9 @@ SeventhProblem::run(unsigned int cycle) void seventh_grid() { - ConditionalOStream pcout( - deallog.get_file_stream(), - (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)); + ConditionalOStream pcout(deallog.get_file_stream(), + (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == + 0)); pcout << "7th Starting" << std::endl; SeventhProblem<2> lap(1); diff --git a/tests/mpi/mesh_worker_01.cc b/tests/mpi/mesh_worker_01.cc index 6c5cde9ced..322df06ade 100644 --- a/tests/mpi/mesh_worker_01.cc +++ b/tests/mpi/mesh_worker_01.cc @@ -169,8 +169,10 @@ test() std::vector reps; reps.push_back(2); reps.push_back(1); - GridGenerator::subdivided_hyper_rectangle( - tr, reps, Point(), Point(2.0, 1.0)); + GridGenerator::subdivided_hyper_rectangle(tr, + reps, + Point(), + Point(2.0, 1.0)); FE_DGP fe(0); diff --git a/tests/mpi/muelu_periodicity.cc b/tests/mpi/muelu_periodicity.cc index 5714a6a2fe..82151d581e 100644 --- a/tests/mpi/muelu_periodicity.cc +++ b/tests/mpi/muelu_periodicity.cc @@ -107,7 +107,8 @@ namespace Step22 class BoundaryValues : public Function { public: - BoundaryValues() : Function(dim + 1) + BoundaryValues() + : Function(dim + 1) {} virtual double @@ -149,7 +150,8 @@ namespace Step22 class RightHandSide : public Function { public: - RightHandSide() : Function(dim + 1) + RightHandSide() + : Function(dim + 1) {} virtual double @@ -207,11 +209,11 @@ namespace Step22 const Matrix & m, const Preconditioner &preconditioner, const IndexSet & locally_owned, - const MPI_Comm & mpi_communicator) : - matrix(&m), - preconditioner(&preconditioner), - mpi_communicator(&mpi_communicator), - tmp(locally_owned, mpi_communicator) + const MPI_Comm & mpi_communicator) + : matrix(&m) + , preconditioner(&preconditioner) + , mpi_communicator(&mpi_communicator) + , tmp(locally_owned, mpi_communicator) {} @@ -222,8 +224,10 @@ namespace Step22 TrilinosWrappers::MPI::Vector & dst, const TrilinosWrappers::MPI::Vector &src) const { - SolverControl solver_control( - src.size(), 1e-6 * src.l2_norm(), false, false); + SolverControl solver_control(src.size(), + 1e-6 * src.l2_norm(), + false, + false); TrilinosWrappers::SolverCG cg(solver_control, TrilinosWrappers::SolverCG::AdditionalData()); @@ -266,11 +270,11 @@ namespace Step22 & A_inverse, const IndexSet &owned_vel, const IndexSet &relevant_vel, - const MPI_Comm &mpi_communicator) : - system_matrix(&system_matrix), - A_inverse(&A_inverse), - tmp1(owned_vel, mpi_communicator), - tmp2(tmp1) + const MPI_Comm &mpi_communicator) + : system_matrix(&system_matrix) + , A_inverse(&A_inverse) + , tmp1(owned_vel, mpi_communicator) + , tmp2(tmp1) {} @@ -320,8 +324,9 @@ namespace Step22 DoFRenumbering::component_wise(dof_handler, block_component); std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block( - dof_handler, dofs_per_block, block_component); + DoFTools::count_dofs_per_block(dof_handler, + dofs_per_block, + block_component); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; { @@ -395,12 +400,12 @@ namespace Step22 relevant_partitioning, mpi_communicator); - DoFTools::make_sparsity_pattern( - dof_handler, - bsp, - constraints, - false, - Utilities::MPI::this_mpi_process(mpi_communicator)); + DoFTools::make_sparsity_pattern(dof_handler, + bsp, + constraints, + false, + Utilities::MPI::this_mpi_process( + mpi_communicator)); bsp.compress(); @@ -408,8 +413,9 @@ namespace Step22 } system_rhs.reinit(owned_partitioning, mpi_communicator); - solution.reinit( - owned_partitioning, relevant_partitioning, mpi_communicator); + solution.reinit(owned_partitioning, + relevant_partitioning, + mpi_communicator); } @@ -540,8 +546,10 @@ namespace Step22 relevant_partitioning[0], mpi_communicator); - SolverControl solver_control( - solution.block(1).size(), 1e-6 * schur_rhs.l2_norm(), false, false); + SolverControl solver_control(solution.block(1).size(), + 1e-6 * schur_rhs.l2_norm(), + false, + false); SolverCG cg(solver_control); TrilinosWrappers::PreconditionAMGMueLu preconditioner; @@ -676,11 +684,10 @@ namespace Step22 data_out.build_patches(degree + 1); std::ostringstream filename; - filename << "solution-" << Utilities::int_to_string(refinement_cycle, 2) - << "." - << Utilities::int_to_string( - triangulation.locally_owned_subdomain(), 2) - << ".vtu"; + filename + << "solution-" << Utilities::int_to_string(refinement_cycle, 2) << "." + << Utilities::int_to_string(triangulation.locally_owned_subdomain(), 2) + << ".vtu"; std::ofstream output(filename.str().c_str()); data_out.write_vtu(output); diff --git a/tests/mpi/multigrid_adaptive.cc b/tests/mpi/multigrid_adaptive.cc index 7e7ab238b5..877acb441c 100644 --- a/tests/mpi/multigrid_adaptive.cc +++ b/tests/mpi/multigrid_adaptive.cc @@ -115,7 +115,8 @@ namespace Step50 class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -159,14 +160,14 @@ namespace Step50 } template - LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation( - MPI_COMM_WORLD, - Triangulation::limit_level_difference_at_vertices, - parallel::distributed::Triangulation::construct_multigrid_hierarchy), - fe(degree), - mg_dof_handler(triangulation), - degree(degree) + LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(MPI_COMM_WORLD, + Triangulation::limit_level_difference_at_vertices, + parallel::distributed::Triangulation< + dim>::construct_multigrid_hierarchy) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) {} @@ -204,8 +205,10 @@ namespace Step50 DynamicSparsityPattern csp(mg_dof_handler.n_dofs(), mg_dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(mg_dof_handler, csp, constraints); - system_matrix.reinit( - mg_dof_handler.locally_owned_dofs(), csp, MPI_COMM_WORLD, true); + system_matrix.reinit(mg_dof_handler.locally_owned_dofs(), + csp, + MPI_COMM_WORLD, + true); mg_constrained_dofs.clear(); mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); @@ -458,14 +461,16 @@ namespace Step50 temp_solution.reinit(idx, MPI_COMM_WORLD); temp_solution = solution; - KellyErrorEstimator::estimate( - static_cast &>(mg_dof_handler), - QGauss(3), - typename FunctionMap::type(), - temp_solution, - estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + KellyErrorEstimator::estimate(static_cast &>( + mg_dof_handler), + QGauss(3), + typename FunctionMap::type(), + temp_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(); } diff --git a/tests/mpi/multigrid_uniform.cc b/tests/mpi/multigrid_uniform.cc index df26c1754f..75a14149bf 100644 --- a/tests/mpi/multigrid_uniform.cc +++ b/tests/mpi/multigrid_uniform.cc @@ -115,7 +115,8 @@ namespace Step50 class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -159,14 +160,14 @@ namespace Step50 } template - LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation( - MPI_COMM_WORLD, - Triangulation::limit_level_difference_at_vertices, - parallel::distributed::Triangulation::construct_multigrid_hierarchy), - fe(degree), - mg_dof_handler(triangulation), - degree(degree) + LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(MPI_COMM_WORLD, + Triangulation::limit_level_difference_at_vertices, + parallel::distributed::Triangulation< + dim>::construct_multigrid_hierarchy) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) {} @@ -204,8 +205,10 @@ namespace Step50 DynamicSparsityPattern csp(mg_dof_handler.n_dofs(), mg_dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(mg_dof_handler, csp, constraints); - system_matrix.reinit( - mg_dof_handler.locally_owned_dofs(), csp, MPI_COMM_WORLD, true); + system_matrix.reinit(mg_dof_handler.locally_owned_dofs(), + csp, + MPI_COMM_WORLD, + true); mg_constrained_dofs.clear(); mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); @@ -439,14 +442,16 @@ namespace Step50 { Vector estimated_error_per_cell(triangulation.n_active_cells()); - KellyErrorEstimator::estimate( - static_cast &>(mg_dof_handler), - QGauss(3), - typename FunctionMap::type(), - solution, - estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + KellyErrorEstimator::estimate(static_cast &>( + mg_dof_handler), + QGauss(3), + typename FunctionMap::type(), + 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(); } diff --git a/tests/mpi/no_flux_constraints.cc b/tests/mpi/no_flux_constraints.cc index f94a4c6b4e..1567ec26d1 100644 --- a/tests/mpi/no_flux_constraints.cc +++ b/tests/mpi/no_flux_constraints.cc @@ -153,8 +153,9 @@ test() 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); + constraints.distribute_local_to_global(local_vector, + local_dof_indices, + vector); } vector.compress(VectorOperation::add); } diff --git a/tests/mpi/no_flux_constraints_02.cc b/tests/mpi/no_flux_constraints_02.cc index 33f6722014..e20b3bbeb1 100644 --- a/tests/mpi/no_flux_constraints_02.cc +++ b/tests/mpi/no_flux_constraints_02.cc @@ -195,8 +195,9 @@ test() 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); + constraints.distribute_local_to_global(local_vector, + local_dof_indices, + vector); } vector.compress(VectorOperation::add); } diff --git a/tests/mpi/no_flux_constraints_03.cc b/tests/mpi/no_flux_constraints_03.cc index e7dab8cc83..8e3f5aea02 100644 --- a/tests/mpi/no_flux_constraints_03.cc +++ b/tests/mpi/no_flux_constraints_03.cc @@ -169,8 +169,9 @@ test() 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); + constraints.distribute_local_to_global(local_vector, + local_dof_indices, + vector); } vector.compress(VectorOperation::add); } diff --git a/tests/mpi/normal_flux_constraints.cc b/tests/mpi/normal_flux_constraints.cc index 35158c937a..3ad5237c59 100644 --- a/tests/mpi/normal_flux_constraints.cc +++ b/tests/mpi/normal_flux_constraints.cc @@ -152,8 +152,9 @@ test() 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); + constraints.distribute_local_to_global(local_vector, + local_dof_indices, + vector); } vector.compress(VectorOperation::add); } diff --git a/tests/mpi/p4est_2d_constraintmatrix_03.cc b/tests/mpi/p4est_2d_constraintmatrix_03.cc index 5d3029bc98..05cb398ea2 100644 --- a/tests/mpi/p4est_2d_constraintmatrix_03.cc +++ b/tests/mpi/p4est_2d_constraintmatrix_03.cc @@ -117,8 +117,10 @@ test() 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(); diff --git a/tests/mpi/p4est_2d_constraintmatrix_04.cc b/tests/mpi/p4est_2d_constraintmatrix_04.cc index 9a7a1fd2cd..6a7c138306 100644 --- a/tests/mpi/p4est_2d_constraintmatrix_04.cc +++ b/tests/mpi/p4est_2d_constraintmatrix_04.cc @@ -60,7 +60,8 @@ template class FilteredDataOut : public DataOut { public: - FilteredDataOut(const unsigned int subdomain_id) : subdomain_id(subdomain_id) + FilteredDataOut(const unsigned int subdomain_id) + : subdomain_id(subdomain_id) {} virtual typename DataOut::cell_iterator @@ -97,7 +98,8 @@ template class TemperatureInitialValues : public Function { public: - TemperatureInitialValues() : Function(1) + TemperatureInitialValues() + : Function(1) {} virtual double diff --git a/tests/mpi/p4est_3d_constraintmatrix_03.cc b/tests/mpi/p4est_3d_constraintmatrix_03.cc index 4dc2fecf46..3653a31ce7 100644 --- a/tests/mpi/p4est_3d_constraintmatrix_03.cc +++ b/tests/mpi/p4est_3d_constraintmatrix_03.cc @@ -60,7 +60,8 @@ template class FilteredDataOut : public DataOut { public: - FilteredDataOut(const unsigned int subdomain_id) : subdomain_id(subdomain_id) + FilteredDataOut(const unsigned int subdomain_id) + : subdomain_id(subdomain_id) {} virtual typename DataOut::cell_iterator @@ -97,7 +98,8 @@ template class TemperatureInitialValues : public Function { public: - TemperatureInitialValues() : Function(1) + TemperatureInitialValues() + : Function(1) {} virtual double diff --git a/tests/mpi/p4est_save_02.cc b/tests/mpi/p4est_save_02.cc index dbb043c6e0..c4a75f7f85 100644 --- a/tests/mpi/p4est_save_02.cc +++ b/tests/mpi/p4est_save_02.cc @@ -79,8 +79,9 @@ test() DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs); PETScWrappers::MPI::Vector x(locally_owned_dofs, MPI_COMM_WORLD); - PETScWrappers::MPI::Vector solution( - locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD); + PETScWrappers::MPI::Vector solution(locally_owned_dofs, + locally_relevant_dofs, + MPI_COMM_WORLD); parallel::distributed::SolutionTransfer soltrans(dh); diff --git a/tests/mpi/p4est_save_03.cc b/tests/mpi/p4est_save_03.cc index dbef192e2e..3fd41bf6bd 100644 --- a/tests/mpi/p4est_save_03.cc +++ b/tests/mpi/p4est_save_03.cc @@ -81,10 +81,12 @@ test() PETScWrappers::MPI::Vector x(locally_owned_dofs, MPI_COMM_WORLD); PETScWrappers::MPI::Vector x2(locally_owned_dofs, MPI_COMM_WORLD); - PETScWrappers::MPI::Vector solution( - locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD); - PETScWrappers::MPI::Vector solution2( - locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD); + PETScWrappers::MPI::Vector solution(locally_owned_dofs, + locally_relevant_dofs, + MPI_COMM_WORLD); + PETScWrappers::MPI::Vector solution2(locally_owned_dofs, + locally_relevant_dofs, + MPI_COMM_WORLD); parallel::distributed::SolutionTransfer soltrans(dh); diff --git a/tests/mpi/p4est_save_04.cc b/tests/mpi/p4est_save_04.cc index dfbc8ae40a..a21bf3c275 100644 --- a/tests/mpi/p4est_save_04.cc +++ b/tests/mpi/p4est_save_04.cc @@ -81,8 +81,9 @@ test() DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs); PETScWrappers::MPI::Vector x(locally_owned_dofs, com_small); - PETScWrappers::MPI::Vector rel_x( - locally_owned_dofs, locally_relevant_dofs, com_small); + PETScWrappers::MPI::Vector rel_x(locally_owned_dofs, + locally_relevant_dofs, + com_small); parallel::distributed::SolutionTransfer soltrans(dh); diff --git a/tests/mpi/parallel_block_vector_01.cc b/tests/mpi/parallel_block_vector_01.cc index ca10ab1889..ef397d7719 100644 --- a/tests/mpi/parallel_block_vector_01.cc +++ b/tests/mpi/parallel_block_vector_01.cc @@ -50,8 +50,9 @@ test() local_relevant = local_owned; local_relevant.add_range(1, 2); - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); // set local values if (myid < 8) diff --git a/tests/mpi/parallel_block_vector_02.cc b/tests/mpi/parallel_block_vector_02.cc index 38a762d272..dc0964e5be 100644 --- a/tests/mpi/parallel_block_vector_02.cc +++ b/tests/mpi/parallel_block_vector_02.cc @@ -47,8 +47,9 @@ test() local_relevant = local_owned; local_relevant.add_range(1, 2); - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); // set local values if (myid < 8) diff --git a/tests/mpi/parallel_block_vector_04.cc b/tests/mpi/parallel_block_vector_04.cc index c2d4a23e98..84ad84f32e 100644 --- a/tests/mpi/parallel_block_vector_04.cc +++ b/tests/mpi/parallel_block_vector_04.cc @@ -53,10 +53,11 @@ test() local_relevant = local_owned; local_relevant.add_range(1, 2); - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); - std::vector indices; - std::vector values; + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); + std::vector indices; + std::vector values; // set local values if (myid < 8) diff --git a/tests/mpi/parallel_block_vector_05.cc b/tests/mpi/parallel_block_vector_05.cc index 9fe2c6fefd..fe96fa7b37 100644 --- a/tests/mpi/parallel_block_vector_05.cc +++ b/tests/mpi/parallel_block_vector_05.cc @@ -93,8 +93,10 @@ test(const unsigned int n_blocks = 5) ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); std::shared_ptr> mf_data( diff --git a/tests/mpi/parallel_block_vector_06.cc b/tests/mpi/parallel_block_vector_06.cc index 167592102a..6db97844b5 100644 --- a/tests/mpi/parallel_block_vector_06.cc +++ b/tests/mpi/parallel_block_vector_06.cc @@ -95,8 +95,10 @@ test(const unsigned int n_blocks = 5) ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); std::shared_ptr> mf_data( diff --git a/tests/mpi/parallel_block_vector_07.cc b/tests/mpi/parallel_block_vector_07.cc index 7a6e3e5b4a..7e4a03aabb 100644 --- a/tests/mpi/parallel_block_vector_07.cc +++ b/tests/mpi/parallel_block_vector_07.cc @@ -93,8 +93,10 @@ test(const unsigned int n_blocks = 5) ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); std::shared_ptr> mf_data( diff --git a/tests/mpi/parallel_block_vector_08.cc b/tests/mpi/parallel_block_vector_08.cc index c114fd8d64..dd5cf3c53d 100644 --- a/tests/mpi/parallel_block_vector_08.cc +++ b/tests/mpi/parallel_block_vector_08.cc @@ -93,8 +93,10 @@ test(const unsigned int n_blocks = 5) ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); std::shared_ptr> mf_data( diff --git a/tests/mpi/parallel_block_vector_09.cc b/tests/mpi/parallel_block_vector_09.cc index 1a1f326c07..39e90a521f 100644 --- a/tests/mpi/parallel_block_vector_09.cc +++ b/tests/mpi/parallel_block_vector_09.cc @@ -96,8 +96,10 @@ test(const unsigned int n_blocks = 5) ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); std::shared_ptr> mf_data( diff --git a/tests/mpi/parallel_block_vector_10.cc b/tests/mpi/parallel_block_vector_10.cc index ac7621d09d..e212f6a921 100644 --- a/tests/mpi/parallel_block_vector_10.cc +++ b/tests/mpi/parallel_block_vector_10.cc @@ -92,8 +92,10 @@ test(const unsigned int n_blocks = 5) ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); std::shared_ptr> mf_data( diff --git a/tests/mpi/parallel_block_vector_11.cc b/tests/mpi/parallel_block_vector_11.cc index f992be02a2..28ddf80c0d 100644 --- a/tests/mpi/parallel_block_vector_11.cc +++ b/tests/mpi/parallel_block_vector_11.cc @@ -94,8 +94,10 @@ test(const unsigned int n_blocks = 5) ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); std::shared_ptr> mf_data( diff --git a/tests/mpi/parallel_block_vector_12.cc b/tests/mpi/parallel_block_vector_12.cc index 10216597d6..f14416b710 100644 --- a/tests/mpi/parallel_block_vector_12.cc +++ b/tests/mpi/parallel_block_vector_12.cc @@ -94,8 +94,10 @@ test(const unsigned int n = 5, const unsigned int m = 3) ConstraintMatrix constraints(relevant_set); DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); std::shared_ptr> mf_data( diff --git a/tests/mpi/parallel_block_vector_13.cc b/tests/mpi/parallel_block_vector_13.cc index dff18c4767..8189073102 100644 --- a/tests/mpi/parallel_block_vector_13.cc +++ b/tests/mpi/parallel_block_vector_13.cc @@ -49,8 +49,9 @@ test() local_relevant = local_owned; local_relevant.add_range(1, 2); - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); // set local values if (myid < 8) diff --git a/tests/mpi/parallel_vector_01.cc b/tests/mpi/parallel_vector_01.cc index b86bdc1d6a..2a5ee2d38a 100644 --- a/tests/mpi/parallel_vector_01.cc +++ b/tests/mpi/parallel_vector_01.cc @@ -42,8 +42,9 @@ test() IndexSet local_owned(numproc * 2); local_owned.add_range(myid * 2, myid * 2 + 2); - LinearAlgebra::distributed::Vector v( - local_owned, local_owned, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_owned, + MPI_COMM_WORLD); // set local values v(myid * 2) = myid * 2.0; diff --git a/tests/mpi/parallel_vector_02.cc b/tests/mpi/parallel_vector_02.cc index 5802cfd8b9..f9070709a5 100644 --- a/tests/mpi/parallel_vector_02.cc +++ b/tests/mpi/parallel_vector_02.cc @@ -45,8 +45,9 @@ test() local_relevant = local_owned; local_relevant.add_range(1, 2); - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); // set local values and check them v(myid * 2) = myid * 2.0; diff --git a/tests/mpi/parallel_vector_03.cc b/tests/mpi/parallel_vector_03.cc index b196457fa8..d8019cb2f1 100644 --- a/tests/mpi/parallel_vector_03.cc +++ b/tests/mpi/parallel_vector_03.cc @@ -45,8 +45,9 @@ test() local_relevant = local_owned; local_relevant.add_range(1, 2); - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); // set local values and check them v(myid * 2) = myid * 2.0; diff --git a/tests/mpi/parallel_vector_03a.cc b/tests/mpi/parallel_vector_03a.cc index ef465b2195..aad1ca498b 100644 --- a/tests/mpi/parallel_vector_03a.cc +++ b/tests/mpi/parallel_vector_03a.cc @@ -79,8 +79,9 @@ test() local_relevant.add_range(4, 7); } - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); v = 0.; // set local values diff --git a/tests/mpi/parallel_vector_04.cc b/tests/mpi/parallel_vector_04.cc index d2f80bfb2c..fdf072b0f2 100644 --- a/tests/mpi/parallel_vector_04.cc +++ b/tests/mpi/parallel_vector_04.cc @@ -46,8 +46,9 @@ test() local_relevant = local_owned; local_relevant.add_range(1, 2); - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); // set local values and check them v(myid * 2) = myid * 2.0; diff --git a/tests/mpi/parallel_vector_05.cc b/tests/mpi/parallel_vector_05.cc index 7a9a262535..6992236542 100644 --- a/tests/mpi/parallel_vector_05.cc +++ b/tests/mpi/parallel_vector_05.cc @@ -45,8 +45,9 @@ test() local_relevant = local_owned; local_relevant.add_range(1, 2); - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); // set local values and check them v(myid * 2) = myid * 2.0; diff --git a/tests/mpi/parallel_vector_06.cc b/tests/mpi/parallel_vector_06.cc index 645e06bb19..f72afc3c3e 100644 --- a/tests/mpi/parallel_vector_06.cc +++ b/tests/mpi/parallel_vector_06.cc @@ -49,8 +49,9 @@ test() local_relevant = local_owned; local_relevant.add_range(1, 2); - LinearAlgebra::distributed::Vector v( - local_owned, local_owned, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_owned, + MPI_COMM_WORLD); // set local values if (myid < 8) diff --git a/tests/mpi/parallel_vector_07.cc b/tests/mpi/parallel_vector_07.cc index 1054428fd9..b751d75155 100644 --- a/tests/mpi/parallel_vector_07.cc +++ b/tests/mpi/parallel_vector_07.cc @@ -68,8 +68,9 @@ test() 2 * set + 3}; local_relevant.add_indices(&ghost_indices[0], &ghost_indices[0] + 10); - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); // set a few of the local elements for (unsigned i = 0; i < local_size; ++i) diff --git a/tests/mpi/parallel_vector_08.cc b/tests/mpi/parallel_vector_08.cc index 2b5c0dd4a5..896d672cfb 100644 --- a/tests/mpi/parallel_vector_08.cc +++ b/tests/mpi/parallel_vector_08.cc @@ -72,10 +72,12 @@ test() // v has ghosts, w has none. set some entries // on w, copy into v and check if they are // there - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); - LinearAlgebra::distributed::Vector w( - local_owned, local_owned, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector w(local_owned, + local_owned, + MPI_COMM_WORLD); // set a few of the local elements for (unsigned i = 0; i < local_size; ++i) diff --git a/tests/mpi/parallel_vector_09.cc b/tests/mpi/parallel_vector_09.cc index 8779d88427..7c3f679a22 100644 --- a/tests/mpi/parallel_vector_09.cc +++ b/tests/mpi/parallel_vector_09.cc @@ -68,8 +68,9 @@ test() 2 * set + 3}; local_relevant.add_indices(&ghost_indices[0], &ghost_indices[0] + 10); - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); // check number of ghosts everywhere (counted // the above) diff --git a/tests/mpi/parallel_vector_10.cc b/tests/mpi/parallel_vector_10.cc index 664aab89b0..e21efb945a 100644 --- a/tests/mpi/parallel_vector_10.cc +++ b/tests/mpi/parallel_vector_10.cc @@ -45,8 +45,9 @@ test() local_relevant = local_owned; local_relevant.add_range(1, 2); - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); LinearAlgebra::distributed::Vector w(v); // set local values and check them diff --git a/tests/mpi/parallel_vector_11.cc b/tests/mpi/parallel_vector_11.cc index 7c5b581009..801aa64e71 100644 --- a/tests/mpi/parallel_vector_11.cc +++ b/tests/mpi/parallel_vector_11.cc @@ -53,8 +53,9 @@ test() local_relevant = local_owned; local_relevant.add_index(2); - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); AssertDimension(static_cast(actual_local_size), v.local_size()); LinearAlgebra::distributed::Vector w(v), x(v), y(v); diff --git a/tests/mpi/parallel_vector_12.cc b/tests/mpi/parallel_vector_12.cc index 93568b01cf..a571d43109 100644 --- a/tests/mpi/parallel_vector_12.cc +++ b/tests/mpi/parallel_vector_12.cc @@ -59,8 +59,9 @@ test() if (numproc > 2) local_relevant0.add_index(8); - LinearAlgebra::distributed::Vector v0( - local_owned0, local_relevant0, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v0(local_owned0, + local_relevant0, + MPI_COMM_WORLD); // vector1: local size 4 const unsigned int local_size1 = 4; @@ -81,8 +82,9 @@ test() local_relevant1.add_index(10); } - LinearAlgebra::distributed::Vector v1( - local_owned1, local_relevant1, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v1(local_owned1, + local_relevant1, + MPI_COMM_WORLD); v0 = 1; v1 = 2; diff --git a/tests/mpi/parallel_vector_13.cc b/tests/mpi/parallel_vector_13.cc index 754405334a..c10c3b1567 100644 --- a/tests/mpi/parallel_vector_13.cc +++ b/tests/mpi/parallel_vector_13.cc @@ -48,8 +48,9 @@ test() local_relevant.add_range(1, 2); local_relevant.add_range(4, 5); - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); // set local values and check them v(myid * 2) = myid * 2.0; diff --git a/tests/mpi/parallel_vector_14.cc b/tests/mpi/parallel_vector_14.cc index f6e0956708..ea54270b13 100644 --- a/tests/mpi/parallel_vector_14.cc +++ b/tests/mpi/parallel_vector_14.cc @@ -53,8 +53,9 @@ test() // and once where they have not for (unsigned int run = 0; run < 2; ++run) { - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); // set local values if (myid < 2) diff --git a/tests/mpi/parallel_vector_15.cc b/tests/mpi/parallel_vector_15.cc index b355359c02..c377850210 100644 --- a/tests/mpi/parallel_vector_15.cc +++ b/tests/mpi/parallel_vector_15.cc @@ -49,8 +49,9 @@ test() if (numproc > 1) local_relevant.add_range(3, 4); - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); // set local values if (myid < 2) diff --git a/tests/mpi/parallel_vector_16.cc b/tests/mpi/parallel_vector_16.cc index b7db51e69e..51f4cf6a43 100644 --- a/tests/mpi/parallel_vector_16.cc +++ b/tests/mpi/parallel_vector_16.cc @@ -52,8 +52,9 @@ test() local_relevant.add_range(min_index + 38, min_index + 40); local_relevant.add_range(min_index + 41, min_index + 43); - LinearAlgebra::distributed::Vector v( - local_owned, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_relevant, + MPI_COMM_WORLD); deallog << "Local range of proc 0: " << v.local_range().first << " " << v.local_range().second << std::endl; diff --git a/tests/mpi/parallel_vector_18.cc b/tests/mpi/parallel_vector_18.cc index 8509eefb53..76ba0e2431 100644 --- a/tests/mpi/parallel_vector_18.cc +++ b/tests/mpi/parallel_vector_18.cc @@ -48,8 +48,9 @@ test() local_relevant = local_owned; local_relevant.add_range(1, 2); - LinearAlgebra::distributed::Vector v( - local_owned, local_owned, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_owned, + MPI_COMM_WORLD); // set local values if (myid < 8) diff --git a/tests/mpi/parallel_vector_19.cc b/tests/mpi/parallel_vector_19.cc index f14b7c9da1..65281ba7bf 100644 --- a/tests/mpi/parallel_vector_19.cc +++ b/tests/mpi/parallel_vector_19.cc @@ -50,8 +50,9 @@ test() local_relevant = local_owned; local_relevant.add_range(1, 2); - LinearAlgebra::distributed::Vector v( - local_owned, local_owned, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_owned, + local_owned, + MPI_COMM_WORLD); // set local values if (myid < 8) diff --git a/tests/mpi/parallel_vector_21.cc b/tests/mpi/parallel_vector_21.cc index 577538555e..c3eca463a1 100644 --- a/tests/mpi/parallel_vector_21.cc +++ b/tests/mpi/parallel_vector_21.cc @@ -40,8 +40,9 @@ test() ghost_set.add_index(0); ghost_set.add_index(2); - LinearAlgebra::distributed::Vector v( - locally_owned, ghost_set, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(locally_owned, + ghost_set, + MPI_COMM_WORLD); // create vector without actually setting the entries since they will be // overwritten soon anyway diff --git a/tests/mpi/parallel_vector_back_interpolate.cc b/tests/mpi/parallel_vector_back_interpolate.cc index 2935db9eac..3f5bc5dc9a 100644 --- a/tests/mpi/parallel_vector_back_interpolate.cc +++ b/tests/mpi/parallel_vector_back_interpolate.cc @@ -65,8 +65,9 @@ test() IndexSet locally_relevant_dofs2; DoFTools::extract_locally_relevant_dofs(dof2, locally_relevant_dofs2); - LinearAlgebra::distributed::Vector v2( - dof2.locally_owned_dofs(), locally_relevant_dofs2, MPI_COMM_WORLD), + LinearAlgebra::distributed::Vector v2(dof2.locally_owned_dofs(), + locally_relevant_dofs2, + MPI_COMM_WORLD), v2_interpolated(v2); // set first vector to 1 diff --git a/tests/mpi/parallel_vector_interpolate.cc b/tests/mpi/parallel_vector_interpolate.cc index be561e1f8f..087ceca2c5 100644 --- a/tests/mpi/parallel_vector_interpolate.cc +++ b/tests/mpi/parallel_vector_interpolate.cc @@ -58,8 +58,9 @@ test() DoFTools::extract_locally_relevant_dofs(dof1, locally_relevant_dofs1); DoFTools::extract_locally_relevant_dofs(dof2, locally_relevant_dofs2); - LinearAlgebra::distributed::Vector v1( - dof1.locally_owned_dofs(), locally_relevant_dofs1, MPI_COMM_WORLD), + LinearAlgebra::distributed::Vector v1(dof1.locally_owned_dofs(), + locally_relevant_dofs1, + MPI_COMM_WORLD), v2(dof2.locally_owned_dofs(), locally_relevant_dofs2, MPI_COMM_WORLD); // set first vector to 1 diff --git a/tests/mpi/periodic_neighbor_01.cc b/tests/mpi/periodic_neighbor_01.cc index f90e33c0ac..aea5efd98c 100644 --- a/tests/mpi/periodic_neighbor_01.cc +++ b/tests/mpi/periodic_neighbor_01.cc @@ -128,10 +128,10 @@ struct periodicity_tests }; template -periodicity_tests::periodicity_tests() : - refn_cycle(0), - mpi_comm(MPI_COMM_WORLD), - the_grid(mpi_comm) +periodicity_tests::periodicity_tests() + : refn_cycle(0) + , mpi_comm(MPI_COMM_WORLD) + , the_grid(mpi_comm) { Assert(dim == 2 || dim == 3, ExcMessage("Only implemented for the 2D and 3D case!")); diff --git a/tests/mpi/periodicity_01.cc b/tests/mpi/periodicity_01.cc index fd1ee6f3c2..0687bbe4fc 100644 --- a/tests/mpi/periodicity_01.cc +++ b/tests/mpi/periodicity_01.cc @@ -115,15 +115,15 @@ namespace Step40 }; template - LaplaceProblem::LaplaceProblem() : - mpi_communicator(MPI_COMM_WORLD), - triangulation(mpi_communicator), - 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)) + LaplaceProblem::LaplaceProblem() + : mpi_communicator(MPI_COMM_WORLD) + , triangulation(mpi_communicator) + , 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)) {} @@ -142,8 +142,9 @@ namespace Step40 locally_owned_dofs = dof_handler.locally_owned_dofs(); DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs); - locally_relevant_solution.reinit( - locally_owned_dofs, locally_relevant_dofs, mpi_communicator); + locally_relevant_solution.reinit(locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); system_rhs.reinit(mpi_communicator, dof_handler.n_dofs(), dof_handler.n_locally_owned_dofs()); @@ -160,12 +161,15 @@ namespace Step40 /*direction*/ i, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); - DynamicSparsityPattern csp( - dof_handler.n_dofs(), dof_handler.n_dofs(), locally_relevant_dofs); + DynamicSparsityPattern csp(dof_handler.n_dofs(), + dof_handler.n_dofs(), + locally_relevant_dofs); DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false); SparsityTools::distribute_sparsity_pattern( csp, @@ -313,8 +317,10 @@ namespace Step40 GridTools::find_active_cell_around_point(dof_handler, point); if (cell->is_locally_owned()) - VectorTools::point_value( - dof_handler, locally_relevant_solution, point, value); + VectorTools::point_value(dof_handler, + locally_relevant_solution, + point, + value); std::vector tmp(value.size()); std::vector tmp2(value.size()); diff --git a/tests/mpi/periodicity_02.cc b/tests/mpi/periodicity_02.cc index ce4dd55707..6462e91ce1 100644 --- a/tests/mpi/periodicity_02.cc +++ b/tests/mpi/periodicity_02.cc @@ -109,7 +109,8 @@ namespace Step22 class BoundaryValues : public Function { public: - BoundaryValues() : Function(dim + 1) + BoundaryValues() + : Function(dim + 1) {} virtual double @@ -151,7 +152,8 @@ namespace Step22 class RightHandSide : public Function { public: - RightHandSide() : Function(dim + 1) + RightHandSide() + : Function(dim + 1) {} virtual double @@ -209,11 +211,11 @@ namespace Step22 const Matrix & m, const Preconditioner &preconditioner, const IndexSet & locally_owned, - const MPI_Comm & mpi_communicator) : - matrix(&m), - preconditioner(&preconditioner), - mpi_communicator(&mpi_communicator), - tmp(locally_owned, mpi_communicator) + const MPI_Comm & mpi_communicator) + : matrix(&m) + , preconditioner(&preconditioner) + , mpi_communicator(&mpi_communicator) + , tmp(locally_owned, mpi_communicator) {} @@ -224,8 +226,10 @@ namespace Step22 TrilinosWrappers::MPI::Vector & dst, const TrilinosWrappers::MPI::Vector &src) const { - SolverControl solver_control( - src.size(), 1e-6 * src.l2_norm(), false, false); + SolverControl solver_control(src.size(), + 1e-6 * src.l2_norm(), + false, + false); TrilinosWrappers::SolverCG cg(solver_control, TrilinosWrappers::SolverCG::AdditionalData()); @@ -268,11 +272,11 @@ namespace Step22 & A_inverse, const IndexSet &owned_vel, const IndexSet &relevant_vel, - const MPI_Comm &mpi_communicator) : - system_matrix(&system_matrix), - A_inverse(&A_inverse), - tmp1(owned_vel, mpi_communicator), - tmp2(tmp1) + const MPI_Comm &mpi_communicator) + : system_matrix(&system_matrix) + , A_inverse(&A_inverse) + , tmp1(owned_vel, mpi_communicator) + , tmp2(tmp1) {} @@ -322,8 +326,9 @@ namespace Step22 DoFRenumbering::component_wise(dof_handler, block_component); std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block( - dof_handler, dofs_per_block, block_component); + DoFTools::count_dofs_per_block(dof_handler, + dofs_per_block, + block_component); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; { @@ -398,12 +403,12 @@ namespace Step22 relevant_partitioning, mpi_communicator); - DoFTools::make_sparsity_pattern( - dof_handler, - bsp, - constraints, - false, - Utilities::MPI::this_mpi_process(mpi_communicator)); + DoFTools::make_sparsity_pattern(dof_handler, + bsp, + constraints, + false, + Utilities::MPI::this_mpi_process( + mpi_communicator)); bsp.compress(); @@ -411,8 +416,9 @@ namespace Step22 } system_rhs.reinit(owned_partitioning, mpi_communicator); - solution.reinit( - owned_partitioning, relevant_partitioning, mpi_communicator); + solution.reinit(owned_partitioning, + relevant_partitioning, + mpi_communicator); } @@ -543,8 +549,10 @@ namespace Step22 relevant_partitioning[0], mpi_communicator); - SolverControl solver_control( - solution.block(1).size(), 1e-6 * schur_rhs.l2_norm(), false, false); + SolverControl solver_control(solution.block(1).size(), + 1e-6 * schur_rhs.l2_norm(), + false, + false); // TrilinosWrappers::SolverCG cg (solver_control, // TrilinosWrappers::SolverCG::AdditionalData(true)); SolverCG cg(solver_control); @@ -685,11 +693,10 @@ namespace Step22 data_out.build_patches(degree + 1); std::ostringstream filename; - filename << "solution-" << Utilities::int_to_string(refinement_cycle, 2) - << "." - << Utilities::int_to_string( - triangulation.locally_owned_subdomain(), 2) - << ".vtu"; + filename + << "solution-" << Utilities::int_to_string(refinement_cycle, 2) << "." + << Utilities::int_to_string(triangulation.locally_owned_subdomain(), 2) + << ".vtu"; std::ofstream output(filename.str().c_str()); data_out.write_vtu(output); diff --git a/tests/mpi/periodicity_03.cc b/tests/mpi/periodicity_03.cc index a6377c6fb5..33cbcff451 100644 --- a/tests/mpi/periodicity_03.cc +++ b/tests/mpi/periodicity_03.cc @@ -134,11 +134,11 @@ namespace Step22 const Matrix & m, const Preconditioner &preconditioner, const IndexSet & locally_owned, - const MPI_Comm & mpi_communicator) : - matrix(&m), - preconditioner(&preconditioner), - mpi_communicator(&mpi_communicator), - tmp(locally_owned, mpi_communicator) + const MPI_Comm & mpi_communicator) + : matrix(&m) + , preconditioner(&preconditioner) + , mpi_communicator(&mpi_communicator) + , tmp(locally_owned, mpi_communicator) {} @@ -149,8 +149,10 @@ namespace Step22 TrilinosWrappers::MPI::Vector & dst, const TrilinosWrappers::MPI::Vector &src) const { - SolverControl solver_control( - src.size(), 1e-6 * src.l2_norm(), false, false); + SolverControl solver_control(src.size(), + 1e-6 * src.l2_norm(), + false, + false); SolverCG cg(solver_control); tmp = 0.; @@ -190,11 +192,11 @@ namespace Step22 const InverseMatrix & A_inverse, const IndexSet &owned_vel, - const MPI_Comm &mpi_communicator) : - system_matrix(&system_matrix), - A_inverse(&A_inverse), - tmp1(owned_vel, mpi_communicator), - tmp2(tmp1) + const MPI_Comm &mpi_communicator) + : system_matrix(&system_matrix) + , A_inverse(&A_inverse) + , tmp1(owned_vel, mpi_communicator) + , tmp2(tmp1) {} @@ -252,8 +254,9 @@ namespace Step22 DoFRenumbering::component_wise(dof_handler, block_component); std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block( - dof_handler, dofs_per_block, block_component); + DoFTools::count_dofs_per_block(dof_handler, + dofs_per_block, + block_component); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; { @@ -294,33 +297,33 @@ namespace Step22 fe.component_mask(velocities), first_vector_components); - VectorTools::interpolate_boundary_values( - dof_handler, - 1, - Functions::ZeroFunction(dim + 1), - constraints, - fe.component_mask(velocities)); - - VectorTools::interpolate_boundary_values( - dof_handler, - 2, - Functions::ZeroFunction(dim + 1), - constraints, - fe.component_mask(velocities)); - - VectorTools::interpolate_boundary_values( - dof_handler, - 3, - Functions::ZeroFunction(dim + 1), - constraints, - fe.component_mask(velocities)); - - VectorTools::interpolate_boundary_values( - dof_handler, - 5, - Functions::ZeroFunction(dim + 1), - constraints, - fe.component_mask(velocities)); + VectorTools::interpolate_boundary_values(dof_handler, + 1, + Functions::ZeroFunction( + dim + 1), + constraints, + fe.component_mask(velocities)); + + VectorTools::interpolate_boundary_values(dof_handler, + 2, + Functions::ZeroFunction( + dim + 1), + constraints, + fe.component_mask(velocities)); + + VectorTools::interpolate_boundary_values(dof_handler, + 3, + Functions::ZeroFunction( + dim + 1), + constraints, + fe.component_mask(velocities)); + + VectorTools::interpolate_boundary_values(dof_handler, + 5, + Functions::ZeroFunction( + dim + 1), + constraints, + fe.component_mask(velocities)); } constraints.close(); @@ -330,12 +333,12 @@ namespace Step22 relevant_partitioning, mpi_communicator); - DoFTools::make_sparsity_pattern( - dof_handler, - bsp, - constraints, - false, - Utilities::MPI::this_mpi_process(mpi_communicator)); + DoFTools::make_sparsity_pattern(dof_handler, + bsp, + constraints, + false, + Utilities::MPI::this_mpi_process( + mpi_communicator)); bsp.compress(); @@ -343,8 +346,9 @@ namespace Step22 } system_rhs.reinit(owned_partitioning, mpi_communicator); - solution.reinit( - owned_partitioning, relevant_partitioning, mpi_communicator); + solution.reinit(owned_partitioning, + relevant_partitioning, + mpi_communicator); } @@ -464,8 +468,10 @@ namespace Step22 SchurComplement schur_complement( system_matrix, A_inverse, owned_partitioning[0], mpi_communicator); - SolverControl solver_control( - solution.block(1).size(), 1e-6 * schur_rhs.l2_norm(), false, false); + SolverControl solver_control(solution.block(1).size(), + 1e-6 * schur_rhs.l2_norm(), + false, + false); SolverCG cg(solver_control); TrilinosWrappers::PreconditionAMG preconditioner; @@ -774,11 +780,10 @@ namespace Step22 data_out.build_patches(degree + 1); std::ostringstream filename; - filename << "solution-" << Utilities::int_to_string(refinement_cycle, 2) - << "." - << Utilities::int_to_string( - triangulation.locally_owned_subdomain(), 2) - << ".vtu"; + filename + << "solution-" << Utilities::int_to_string(refinement_cycle, 2) << "." + << Utilities::int_to_string(triangulation.locally_owned_subdomain(), 2) + << ".vtu"; std::ofstream output(filename.str().c_str()); data_out.write_vtu(output); diff --git a/tests/mpi/periodicity_04.cc b/tests/mpi/periodicity_04.cc index e7b72849ed..859ef76c85 100644 --- a/tests/mpi/periodicity_04.cc +++ b/tests/mpi/periodicity_04.cc @@ -208,8 +208,9 @@ check(const unsigned int orientation, bool reverse) unsigned int n_local_constraints = 0; std::map> support_points; - DoFTools::map_dofs_to_support_points( - MappingQGeneric(1), dof_handler, support_points); + DoFTools::map_dofs_to_support_points(MappingQGeneric(1), + dof_handler, + support_points); IndexSet constraints_lines = constraints.get_local_lines(); for (unsigned int i = 0; i < constraints_lines.n_elements(); ++i) diff --git a/tests/mpi/petsc_01.cc b/tests/mpi/petsc_01.cc index 09fea732e6..86dd8706e5 100644 --- a/tests/mpi/petsc_01.cc +++ b/tests/mpi/petsc_01.cc @@ -54,8 +54,9 @@ test() 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.add((2 * myid + 2) % (2 * numprocs), + (2 * myid + 2) % (2 * numprocs), + 0.1); mat.compress(VectorOperation::add); @@ -71,8 +72,9 @@ test() 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.add((2 * myid + 2) % (2 * numprocs), + (2 * myid + 2) % (2 * numprocs), + 0.1); mat.compress(VectorOperation::add); // mat.write_ascii(); diff --git a/tests/mpi/petsc_bug_ghost_vector_01.cc b/tests/mpi/petsc_bug_ghost_vector_01.cc index a5a3eae3ed..24b4d97f78 100644 --- a/tests/mpi/petsc_bug_ghost_vector_01.cc +++ b/tests/mpi/petsc_bug_ghost_vector_01.cc @@ -137,16 +137,17 @@ test() for (unsigned int i = 0; i < v_space_cells; ++i) step_sizes[1].push_back(cell_size_y); - GridGenerator::subdivided_hyper_rectangle( - tmp_rectangle, - step_sizes, - Point<2>(h_distance, 0), - Point<2>(length + h_distance, v_distance), - false); + GridGenerator::subdivided_hyper_rectangle(tmp_rectangle, + step_sizes, + Point<2>(h_distance, 0), + Point<2>(length + h_distance, + v_distance), + false); tmp_tria_buffer.copy_triangulation(tmp_tria_fluid); - GridGenerator::merge_triangulations( - tmp_tria_buffer, tmp_rectangle, tmp_tria_fluid); + GridGenerator::merge_triangulations(tmp_tria_buffer, + tmp_rectangle, + tmp_tria_fluid); tmp_tria_buffer.clear(); tmp_rectangle.clear(); @@ -158,16 +159,17 @@ test() for (unsigned int i = 0; i < (h_cells - v_space_cells - solid_cells_y); ++i) step_sizes[1].push_back(cell_size_y); - GridGenerator::subdivided_hyper_rectangle( - tmp_rectangle, - step_sizes, - Point<2>(h_distance, solid_top), - Point<2>(h_distance + length, height), - false); + GridGenerator::subdivided_hyper_rectangle(tmp_rectangle, + step_sizes, + Point<2>(h_distance, solid_top), + Point<2>(h_distance + length, + height), + false); tmp_tria_buffer.copy_triangulation(tmp_tria_fluid); - GridGenerator::merge_triangulations( - tmp_tria_buffer, tmp_rectangle, tmp_tria_fluid); + GridGenerator::merge_triangulations(tmp_tria_buffer, + tmp_rectangle, + tmp_tria_fluid); tmp_tria_buffer.clear(); tmp_rectangle.clear(); // @@ -185,8 +187,9 @@ test() false); tmp_tria_buffer.copy_triangulation(tmp_tria_fluid); - GridGenerator::merge_triangulations( - tmp_tria_buffer, tmp_rectangle, tmp_tria_fluid); + GridGenerator::merge_triangulations(tmp_tria_buffer, + tmp_rectangle, + tmp_tria_fluid); //-----------COPY to distributed fluid_triangulation.copy_triangulation(tmp_tria_fluid); diff --git a/tests/mpi/petsc_distribute_01_block.cc b/tests/mpi/petsc_distribute_01_block.cc index 32fd3952d7..5133cf72e4 100644 --- a/tests/mpi/petsc_distribute_01_block.cc +++ b/tests/mpi/petsc_distribute_01_block.cc @@ -38,8 +38,10 @@ test() Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); // create a vector that consists of elements indexed from 0 to n - PETScWrappers::MPI::BlockVector vec( - 2, MPI_COMM_WORLD, 100 * n_processes, 100); + PETScWrappers::MPI::BlockVector vec(2, + MPI_COMM_WORLD, + 100 * n_processes, + 100); vec.block(0).reinit(MPI_COMM_WORLD, 100 * n_processes, 100); vec.block(1).reinit(MPI_COMM_WORLD, 100 * n_processes, 100); vec.collect_sizes(); @@ -124,16 +126,16 @@ test() // verify correctness if (myid != 0) - AssertThrow( - get_real_assert_zero_imag(vec(vec.block(0).local_range().first + 10)) == - vec.block(0).local_range().first - 25, - ExcInternalError()); + AssertThrow(get_real_assert_zero_imag( + vec(vec.block(0).local_range().first + 10)) == + vec.block(0).local_range().first - 25, + ExcInternalError()); if (myid != n_processes - 1) - AssertThrow( - get_real_assert_zero_imag(vec(vec.block(0).local_range().first + 90)) == - vec.block(0).local_range().first + 105, - ExcInternalError()); + AssertThrow(get_real_assert_zero_imag( + vec(vec.block(0).local_range().first + 90)) == + vec.block(0).local_range().first + 105, + ExcInternalError()); if (myid != 0) AssertThrow(get_real_assert_zero_imag( diff --git a/tests/mpi/petsc_locally_owned_elements.cc b/tests/mpi/petsc_locally_owned_elements.cc index 0e641a36aa..e37fd48f65 100644 --- a/tests/mpi/petsc_locally_owned_elements.cc +++ b/tests/mpi/petsc_locally_owned_elements.cc @@ -38,8 +38,10 @@ test() Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); // create a vector that consists of elements indexed from 0 to n - PETScWrappers::MPI::BlockVector vec( - 2, MPI_COMM_WORLD, 100 * n_processes, 100); + PETScWrappers::MPI::BlockVector vec(2, + MPI_COMM_WORLD, + 100 * n_processes, + 100); vec.block(0).reinit(MPI_COMM_WORLD, 100 * n_processes, 100); vec.block(1).reinit(MPI_COMM_WORLD, 100 * n_processes, 100); vec.collect_sizes(); diff --git a/tests/mpi/point_value_01.cc b/tests/mpi/point_value_01.cc index fb221dcfdf..0e932ec294 100644 --- a/tests/mpi/point_value_01.cc +++ b/tests/mpi/point_value_01.cc @@ -86,8 +86,10 @@ test() { try { - VectorTools::point_value( - dof_handler, locally_owned_solution, *point_iterator, value); + VectorTools::point_value(dof_handler, + locally_owned_solution, + *point_iterator, + value); if (std::abs(value[0] - 1.) > 1e-8) ExcInternalError(); } diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_01.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_01.cc index 7be0e232f2..7556453c5f 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_01.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_01.cc @@ -47,8 +47,10 @@ test() std::vector sub(2); sub[0] = 5 * Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); sub[1] = 1; - GridGenerator::subdivided_hyper_rectangle( - static_cast &>(tr), sub, Point<2>(0, 0), Point<2>(1, 1)); + GridGenerator::subdivided_hyper_rectangle(static_cast &>(tr), + sub, + Point<2>(0, 0), + Point<2>(1, 1)); tr.refine_global(1); Vector indicators(tr.n_active_cells()); diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_02.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_02.cc index bf074c2883..5c41a9cfda 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_02.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_02.cc @@ -51,8 +51,10 @@ test() std::vector sub(2); sub[0] = 5 * Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); sub[1] = 1; - GridGenerator::subdivided_hyper_rectangle( - static_cast &>(tr), sub, Point<2>(0, 0), Point<2>(1, 1)); + GridGenerator::subdivided_hyper_rectangle(static_cast &>(tr), + sub, + Point<2>(0, 0), + Point<2>(1, 1)); tr.refine_global(1); Vector indicators(tr.n_active_cells()); diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_03.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_03.cc index a9cd6d06d1..227900f8b8 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_03.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_03.cc @@ -56,8 +56,10 @@ test() std::vector sub(2); sub[0] = 5 * Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); sub[1] = 1; - GridGenerator::subdivided_hyper_rectangle( - static_cast &>(tr), sub, Point<2>(0, 0), Point<2>(1, 1)); + GridGenerator::subdivided_hyper_rectangle(static_cast &>(tr), + sub, + Point<2>(0, 0), + Point<2>(1, 1)); tr.refine_global(1); Vector indicators(tr.n_active_cells()); diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_04.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_04.cc index bb2a1dc4c5..4dc951eb69 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_04.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_04.cc @@ -103,8 +103,10 @@ test() // only works because we are // working on only a single // processor - dealii::GridRefinement ::refine_and_coarsen_fixed_fraction( - tr, indicators, 2. / 3, 1. / 6); + dealii::GridRefinement ::refine_and_coarsen_fixed_fraction(tr, + indicators, + 2. / 3, + 1. / 6); { float coarsen_indicator = min_indicator - 1, refine_indicator = max_indicator + 1; diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_05.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_05.cc index 002ec18b5f..b16beadb10 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_05.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_05.cc @@ -100,8 +100,10 @@ test() // only works because we are // working on only a single // processor - dealii::GridRefinement ::refine_and_coarsen_fixed_fraction( - tr, indicators, 2. / 3, 1. / 6); + dealii::GridRefinement ::refine_and_coarsen_fixed_fraction(tr, + indicators, + 2. / 3, + 1. / 6); { float coarsen_indicator = min_indicator - 1, refine_indicator = max_indicator + 1; diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_06.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_06.cc index ff44c3a23d..d9a429faf1 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_06.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_06.cc @@ -115,8 +115,10 @@ test() // only works because we are // working on only a single // processor - dealii::GridRefinement ::refine_and_coarsen_fixed_fraction( - tr, indicators, 0.6, 0.2); + dealii::GridRefinement ::refine_and_coarsen_fixed_fraction(tr, + indicators, + 0.6, + 0.2); { float coarsen_indicator = min_indicator - 1, refine_indicator = max_indicator + 1; diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_07.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_07.cc index ffede1b8cf..eaf6a6704f 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_07.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_07.cc @@ -51,8 +51,10 @@ test() std::vector subdivisions(2); subdivisions[0] = 120; subdivisions[1] = 1; - GridGenerator::subdivided_hyper_rectangle( - triangulation, subdivisions, Point<2>(), Point<2>(1, 1)); + GridGenerator::subdivided_hyper_rectangle(triangulation, + subdivisions, + Point<2>(), + Point<2>(1, 1)); // initialize the refinement indicators with a set of particular values from // the original testcase const double values[] = { diff --git a/tests/mpi/refine_and_coarsen_fixed_number_01.cc b/tests/mpi/refine_and_coarsen_fixed_number_01.cc index 0948785e30..fb39679505 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_01.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_01.cc @@ -47,8 +47,10 @@ test() std::vector sub(2); sub[0] = 5 * Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); sub[1] = 1; - GridGenerator::subdivided_hyper_rectangle( - static_cast &>(tr), sub, Point<2>(0, 0), Point<2>(1, 1)); + GridGenerator::subdivided_hyper_rectangle(static_cast &>(tr), + sub, + Point<2>(0, 0), + Point<2>(1, 1)); tr.refine_global(1); Vector indicators(tr.n_active_cells()); diff --git a/tests/mpi/refine_and_coarsen_fixed_number_02.cc b/tests/mpi/refine_and_coarsen_fixed_number_02.cc index c8fa4fe32f..acda506a28 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_02.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_02.cc @@ -48,8 +48,10 @@ test() std::vector sub(2); sub[0] = 5 * Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); sub[1] = 1; - GridGenerator::subdivided_hyper_rectangle( - static_cast &>(tr), sub, Point<2>(0, 0), Point<2>(1, 1)); + GridGenerator::subdivided_hyper_rectangle(static_cast &>(tr), + sub, + Point<2>(0, 0), + Point<2>(1, 1)); tr.refine_global(1); Vector indicators(tr.n_active_cells()); diff --git a/tests/mpi/refine_and_coarsen_fixed_number_03.cc b/tests/mpi/refine_and_coarsen_fixed_number_03.cc index 7ef1ca2bfc..823ff7256e 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_03.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_03.cc @@ -45,8 +45,10 @@ test() std::vector sub(2); sub[0] = 5 * Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); sub[1] = 1; - GridGenerator::subdivided_hyper_rectangle( - static_cast &>(tr), sub, Point<2>(0, 0), Point<2>(1, 1)); + GridGenerator::subdivided_hyper_rectangle(static_cast &>(tr), + sub, + Point<2>(0, 0), + Point<2>(1, 1)); tr.refine_global(1); Vector indicators(tr.n_active_cells()); diff --git a/tests/mpi/refine_and_coarsen_fixed_number_04.cc b/tests/mpi/refine_and_coarsen_fixed_number_04.cc index fd8ec531f0..5148e7955d 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_04.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_04.cc @@ -103,8 +103,10 @@ test() // only works because we are // working on only a single // processor - dealii::GridRefinement ::refine_and_coarsen_fixed_number( - tr, indicators, 2. / 3, 1. / 6); + dealii::GridRefinement ::refine_and_coarsen_fixed_number(tr, + indicators, + 2. / 3, + 1. / 6); { float coarsen_indicator = min_indicator - 1, refine_indicator = max_indicator + 1; diff --git a/tests/mpi/refine_and_coarsen_fixed_number_05.cc b/tests/mpi/refine_and_coarsen_fixed_number_05.cc index 81df909f81..dc53e52920 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_05.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_05.cc @@ -101,8 +101,10 @@ test() // only works because we are // working on only a single // processor - dealii::GridRefinement ::refine_and_coarsen_fixed_number( - tr, indicators, 2. / 3, 1. / 6); + dealii::GridRefinement ::refine_and_coarsen_fixed_number(tr, + indicators, + 2. / 3, + 1. / 6); { float coarsen_indicator = min_indicator - 1, refine_indicator = max_indicator + 1; diff --git a/tests/mpi/refine_and_coarsen_fixed_number_07.cc b/tests/mpi/refine_and_coarsen_fixed_number_07.cc index cdf02cb0b7..3a2074ce2a 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_07.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_07.cc @@ -45,8 +45,10 @@ test(const double max_n_cell_ratio) std::vector sub(2); sub[0] = 5 * Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); sub[1] = 1; - GridGenerator::subdivided_hyper_rectangle( - static_cast &>(tr), sub, Point<2>(0, 0), Point<2>(1, 1)); + GridGenerator::subdivided_hyper_rectangle(static_cast &>(tr), + sub, + Point<2>(0, 0), + Point<2>(1, 1)); tr.refine_global(3); Vector indicators(tr.n_active_cells()); diff --git a/tests/mpi/renumber_cuthill_mckee.cc b/tests/mpi/renumber_cuthill_mckee.cc index d1ae103ef0..d948991640 100644 --- a/tests/mpi/renumber_cuthill_mckee.cc +++ b/tests/mpi/renumber_cuthill_mckee.cc @@ -71,28 +71,29 @@ test() // send everything to processor 0 for output std::vector complete_renumbering(dofh.n_dofs()); - std::copy( - renumbering.begin(), renumbering.end(), complete_renumbering.begin()); + std::copy(renumbering.begin(), + renumbering.end(), + complete_renumbering.begin()); unsigned int offset = renumbering.size(); for (unsigned int i = 1; i < nprocs; ++i) { if (myid == i) - MPI_Send( - &renumbering[0], - renumbering.size(), - Utilities::MPI::internal::mpi_type_id(&complete_renumbering[0]), - 0, - i, - MPI_COMM_WORLD); + MPI_Send(&renumbering[0], + renumbering.size(), + Utilities::MPI::internal::mpi_type_id( + &complete_renumbering[0]), + 0, + i, + MPI_COMM_WORLD); else if (myid == 0) - MPI_Recv( - &complete_renumbering[offset], - dofh.locally_owned_dofs_per_processor()[i].n_elements(), - Utilities::MPI::internal::mpi_type_id(&complete_renumbering[0]), - i, - i, - MPI_COMM_WORLD, - MPI_STATUSES_IGNORE); + MPI_Recv(&complete_renumbering[offset], + dofh.locally_owned_dofs_per_processor()[i].n_elements(), + Utilities::MPI::internal::mpi_type_id( + &complete_renumbering[0]), + i, + i, + MPI_COMM_WORLD, + MPI_STATUSES_IGNORE); offset += dofh.locally_owned_dofs_per_processor()[i].n_elements(); } diff --git a/tests/mpi/renumber_cuthill_mckee_02.cc b/tests/mpi/renumber_cuthill_mckee_02.cc index 1c4aef5692..0c4e7cb303 100644 --- a/tests/mpi/renumber_cuthill_mckee_02.cc +++ b/tests/mpi/renumber_cuthill_mckee_02.cc @@ -74,28 +74,29 @@ test() // send everything to processor 0 for output std::vector complete_renumbering(dofh.n_dofs()); - std::copy( - renumbering.begin(), renumbering.end(), complete_renumbering.begin()); + std::copy(renumbering.begin(), + renumbering.end(), + complete_renumbering.begin()); unsigned int offset = renumbering.size(); for (unsigned int i = 1; i < nprocs; ++i) { if (myid == i) - MPI_Send( - &renumbering[0], - renumbering.size(), - Utilities::MPI::internal::mpi_type_id(&complete_renumbering[0]), - 0, - i, - MPI_COMM_WORLD); + MPI_Send(&renumbering[0], + renumbering.size(), + Utilities::MPI::internal::mpi_type_id( + &complete_renumbering[0]), + 0, + i, + MPI_COMM_WORLD); else if (myid == 0) - MPI_Recv( - &complete_renumbering[offset], - dofh.locally_owned_dofs_per_processor()[i].n_elements(), - Utilities::MPI::internal::mpi_type_id(&complete_renumbering[0]), - i, - i, - MPI_COMM_WORLD, - MPI_STATUSES_IGNORE); + MPI_Recv(&complete_renumbering[offset], + dofh.locally_owned_dofs_per_processor()[i].n_elements(), + Utilities::MPI::internal::mpi_type_id( + &complete_renumbering[0]), + i, + i, + MPI_COMM_WORLD, + MPI_STATUSES_IGNORE); offset += dofh.locally_owned_dofs_per_processor()[i].n_elements(); } diff --git a/tests/mpi/renumber_z_order_01.cc b/tests/mpi/renumber_z_order_01.cc index 560d740b7c..a2b8b20762 100644 --- a/tests/mpi/renumber_z_order_01.cc +++ b/tests/mpi/renumber_z_order_01.cc @@ -115,8 +115,9 @@ test() fe_values.JxW(q); } } - cm.distribute_local_to_global( - local_vector, local_dof_indices, vector); + cm.distribute_local_to_global(local_vector, + local_dof_indices, + vector); } vector.compress(VectorOperation::add); } diff --git a/tests/mpi/renumber_z_order_02.cc b/tests/mpi/renumber_z_order_02.cc index 2e36c80508..a544241b14 100644 --- a/tests/mpi/renumber_z_order_02.cc +++ b/tests/mpi/renumber_z_order_02.cc @@ -116,8 +116,9 @@ test() fe_values.JxW(q); } } - cm.distribute_local_to_global( - local_vector, local_dof_indices, vector); + cm.distribute_local_to_global(local_vector, + local_dof_indices, + vector); } vector.compress(VectorOperation::add); } diff --git a/tests/mpi/renumber_z_order_04.cc b/tests/mpi/renumber_z_order_04.cc index 7563119667..90db691332 100644 --- a/tests/mpi/renumber_z_order_04.cc +++ b/tests/mpi/renumber_z_order_04.cc @@ -55,8 +55,10 @@ test() unsigned int myid = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); parallel::distributed::Triangulation<2> tr(MPI_COMM_WORLD); - GridGenerator::subdivided_hyper_rectangle( - tr, std::vector{{2, 2}}, Point<2>(), Point<2>(2, 2)); + GridGenerator::subdivided_hyper_rectangle(tr, + std::vector{{2, 2}}, + Point<2>(), + Point<2>(2, 2)); const FE_Q<2> fe(1); diff --git a/tests/mpi/solution_transfer_01.cc b/tests/mpi/solution_transfer_01.cc index 9ccff40da4..52c0d7989c 100644 --- a/tests/mpi/solution_transfer_01.cc +++ b/tests/mpi/solution_transfer_01.cc @@ -71,8 +71,9 @@ test() DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs); - PETScWrappers::MPI::Vector solution( - locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD); + PETScWrappers::MPI::Vector solution(locally_owned_dofs, + locally_relevant_dofs, + MPI_COMM_WORLD); parallel::distributed::SolutionTransfer<2, PETScWrappers::MPI::Vector> soltrans(dh); diff --git a/tests/mpi/step-37.cc b/tests/mpi/step-37.cc index 094cafa709..1e8ea85fe8 100644 --- a/tests/mpi/step-37.cc +++ b/tests/mpi/step-37.cc @@ -139,21 +139,24 @@ namespace Step37 template - LaplaceProblem::LaplaceProblem() : + LaplaceProblem::LaplaceProblem() + : #ifdef DEAL_II_WITH_P4EST triangulation( MPI_COMM_WORLD, Triangulation::limit_level_difference_at_vertices, - parallel::distributed::Triangulation::construct_multigrid_hierarchy), + parallel::distributed::Triangulation::construct_multigrid_hierarchy) + , #else - triangulation(Triangulation::limit_level_difference_at_vertices), + triangulation(Triangulation::limit_level_difference_at_vertices) + , #endif - fe(degree_finite_element), - dof_handler(triangulation), - fe_euler(degree_finite_element), - fe_system(fe_euler, dim), - dof_euler(triangulation), - pcout(std::cout, Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) + fe(degree_finite_element) + , dof_handler(triangulation) + , fe_euler(degree_finite_element) + , fe_system(fe_euler, dim) + , dof_euler(triangulation) + , pcout(std::cout, Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) {} @@ -182,8 +185,9 @@ namespace Step37 IndexSet locally_relevant_euler; DoFTools::extract_locally_relevant_dofs(dof_euler, locally_relevant_euler); - euler_positions.reinit( - dof_euler.locally_owned_dofs(), locally_relevant_euler, MPI_COMM_WORLD); + euler_positions.reinit(dof_euler.locally_owned_dofs(), + locally_relevant_euler, + MPI_COMM_WORLD); } // Set up a quadrature formula based on the support points of FE_Q and go @@ -212,8 +216,10 @@ namespace Step37 constraints.clear(); constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); { @@ -249,8 +255,9 @@ namespace Step37 for (unsigned int level = 0; level < nlevels; ++level) { IndexSet relevant_dofs; - DoFTools::extract_locally_relevant_level_dofs( - dof_handler, level, relevant_dofs); + DoFTools::extract_locally_relevant_level_dofs(dof_handler, + level, + relevant_dofs); ConstraintMatrix level_constraints; level_constraints.reinit(relevant_dofs); level_constraints.add_lines( @@ -270,8 +277,9 @@ namespace Step37 QGauss<1>(fe.degree + 1), additional_data); - mg_matrices[level].initialize( - mg_mf_storage_level, mg_constrained_dofs, level); + mg_matrices[level].initialize(mg_mf_storage_level, + mg_constrained_dofs, + level); mg_matrices[level].compute_diagonal(); } } @@ -282,10 +290,10 @@ namespace Step37 class PotentialBCFunction : public Function { public: - PotentialBCFunction(const double &charge, const Point &dipole) : - Function(1), - charge(charge), - x0(std::abs(charge) < 1e-10 ? Point() : dipole / charge) + PotentialBCFunction(const double &charge, const Point &dipole) + : Function(1) + , charge(charge) + , x0(std::abs(charge) < 1e-10 ? Point() : dipole / charge) {} virtual ~PotentialBCFunction() = default; @@ -481,8 +489,9 @@ namespace Step37 { std::map> support_points; MappingQ mapping(degree_finite_element); - DoFTools::map_dofs_to_support_points( - mapping, dof_handler, support_points); + DoFTools::map_dofs_to_support_points(mapping, + dof_handler, + support_points); const std::string base_filename = "grid" + dealii::Utilities::int_to_string(dim) + "_" + diff --git a/tests/mpi/step-39-block.cc b/tests/mpi/step-39-block.cc index 0c02c419a2..bef2052a22 100644 --- a/tests/mpi/step-39-block.cc +++ b/tests/mpi/step-39-block.cc @@ -443,15 +443,15 @@ namespace Step39 template InteriorPenaltyProblem::InteriorPenaltyProblem( - const FiniteElement &fe) : - triangulation( - MPI_COMM_WORLD, - Triangulation::limit_level_difference_at_vertices, - parallel::distributed::Triangulation::construct_multigrid_hierarchy), - mapping(1), - fe(fe), - dof_handler(triangulation), - estimates(1) + const FiniteElement &fe) + : triangulation(MPI_COMM_WORLD, + Triangulation::limit_level_difference_at_vertices, + parallel::distributed::Triangulation< + dim>::construct_multigrid_hierarchy) + , mapping(1) + , fe(fe) + , dof_handler(triangulation) + , estimates(1) { GridGenerator::hyper_L(triangulation, -1, 1); } @@ -471,8 +471,10 @@ namespace Step39 DynamicSparsityPattern 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); + matrix.reinit(dof_handler.locally_owned_dofs(), + c_sparsity, + MPI_COMM_WORLD, + true); const unsigned int n_levels = triangulation.n_global_levels(); mg_matrix.resize(0, n_levels - 1); @@ -499,8 +501,9 @@ namespace Step39 DynamicSparsityPattern ci_sparsity; 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); + 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), @@ -655,18 +658,21 @@ namespace Step39 l <= smoother_data.max_level(); ++l) { - DoFTools::make_cell_patches( - smoother_data[l].block_list, this->dof_handler, l); + DoFTools::make_cell_patches(smoother_data[l].block_list, + this->dof_handler, + l); if (smoother_data[l].block_list.n_rows() > 0) smoother_data[l].block_list.compress(); smoother_data[l].relaxation = 0.7; smoother_data[l].inversion = PreconditionBlockBase::svd; TrilinosWrappers::MPI::Vector *ghost = &(temp_vectors[l]); IndexSet relevant_dofs; - DoFTools::extract_locally_relevant_level_dofs( - dof_handler, l, relevant_dofs); - ghost->reinit( - dof_handler.locally_owned_mg_dofs(l), relevant_dofs, MPI_COMM_WORLD); + DoFTools::extract_locally_relevant_level_dofs(dof_handler, + l, + relevant_dofs); + ghost->reinit(dof_handler.locally_owned_mg_dofs(l), + relevant_dofs, + MPI_COMM_WORLD); smoother_data[l].temp_ghost_vector = ghost; } @@ -716,8 +722,9 @@ namespace Step39 MeshWorker::IntegrationInfoBox 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 + 1, n_gauss_points); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points + 1, + n_gauss_points); AnyData solution_data; solution_data.add(&ghost, "solution"); @@ -773,8 +780,10 @@ namespace Step39 else { parallel::distributed::GridRefinement:: - refine_and_coarsen_fixed_fraction( - triangulation, estimates.block(0), 0.5, 0.0); + refine_and_coarsen_fixed_fraction(triangulation, + estimates.block(0), + 0.5, + 0.0); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/mpi/step-39.cc b/tests/mpi/step-39.cc index 48e71cea0f..a590884b6c 100644 --- a/tests/mpi/step-39.cc +++ b/tests/mpi/step-39.cc @@ -444,15 +444,15 @@ namespace Step39 template InteriorPenaltyProblem::InteriorPenaltyProblem( - const FiniteElement &fe) : - triangulation( - MPI_COMM_WORLD, - Triangulation::limit_level_difference_at_vertices, - parallel::distributed::Triangulation::construct_multigrid_hierarchy), - mapping(1), - fe(fe), - dof_handler(triangulation), - estimates(1) + const FiniteElement &fe) + : triangulation(MPI_COMM_WORLD, + Triangulation::limit_level_difference_at_vertices, + parallel::distributed::Triangulation< + dim>::construct_multigrid_hierarchy) + , mapping(1) + , fe(fe) + , dof_handler(triangulation) + , estimates(1) { GridGenerator::hyper_L(triangulation, -1, 1); } @@ -472,8 +472,10 @@ namespace Step39 DynamicSparsityPattern 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); + matrix.reinit(dof_handler.locally_owned_dofs(), + c_sparsity, + MPI_COMM_WORLD, + true); const unsigned int n_levels = triangulation.n_global_levels(); mg_matrix.resize(0, n_levels - 1); @@ -500,8 +502,9 @@ namespace Step39 DynamicSparsityPattern ci_sparsity; 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); + 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), @@ -689,8 +692,9 @@ namespace Step39 MeshWorker::IntegrationInfoBox 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 + 1, n_gauss_points); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points + 1, + n_gauss_points); AnyData solution_data; solution_data.add(&ghost, "solution"); @@ -746,8 +750,10 @@ namespace Step39 else { parallel::distributed::GridRefinement:: - refine_and_coarsen_fixed_fraction( - triangulation, estimates.block(0), 0.5, 0.0); + refine_and_coarsen_fixed_fraction(triangulation, + estimates.block(0), + 0.5, + 0.0); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/mpi/step-40.cc b/tests/mpi/step-40.cc index db839d2bdb..5716f451e2 100644 --- a/tests/mpi/step-40.cc +++ b/tests/mpi/step-40.cc @@ -103,18 +103,18 @@ namespace Step40 template - LaplaceProblem::LaplaceProblem() : - mpi_communicator(MPI_COMM_WORLD), - triangulation(mpi_communicator, - typename Triangulation::MeshSmoothing( - Triangulation::smoothing_on_refinement | - Triangulation::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)) + LaplaceProblem::LaplaceProblem() + : mpi_communicator(MPI_COMM_WORLD) + , triangulation(mpi_communicator, + typename Triangulation::MeshSmoothing( + Triangulation::smoothing_on_refinement | + Triangulation::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)) {} @@ -136,20 +136,24 @@ namespace Step40 locally_owned_dofs = dof_handler.locally_owned_dofs(); DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs); - locally_relevant_solution.reinit( - locally_owned_dofs, locally_relevant_dofs, mpi_communicator); + locally_relevant_solution.reinit(locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); system_rhs.reinit(locally_owned_dofs, mpi_communicator); system_rhs = PetscScalar(); constraints.clear(); constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); - DynamicSparsityPattern csp( - dof_handler.n_dofs(), dof_handler.n_dofs(), locally_relevant_dofs); + DynamicSparsityPattern csp(dof_handler.n_dofs(), + dof_handler.n_dofs(), + locally_relevant_dofs); DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false); SparsityTools::distribute_sparsity_pattern( csp, @@ -258,14 +262,14 @@ namespace Step40 10, 10); #else - check_solver_within_range( - solver.solve(system_matrix, - completely_distributed_solution, - system_rhs, - PETScWrappers::PreconditionJacobi(system_matrix)), - solver_control.last_step(), - 120, - 260); + check_solver_within_range(solver.solve(system_matrix, + completely_distributed_solution, + system_rhs, + PETScWrappers::PreconditionJacobi( + system_matrix)), + solver_control.last_step(), + 120, + 260); #endif pcout << " Solved in " << solver_control.last_step() << " iterations." diff --git a/tests/mpi/step-40_cuthill_mckee.cc b/tests/mpi/step-40_cuthill_mckee.cc index 2e2e502846..41ef9fd705 100644 --- a/tests/mpi/step-40_cuthill_mckee.cc +++ b/tests/mpi/step-40_cuthill_mckee.cc @@ -108,18 +108,18 @@ namespace Step40 template - LaplaceProblem::LaplaceProblem() : - mpi_communicator(MPI_COMM_WORLD), - triangulation(mpi_communicator, - typename Triangulation::MeshSmoothing( - Triangulation::smoothing_on_refinement | - Triangulation::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)) + LaplaceProblem::LaplaceProblem() + : mpi_communicator(MPI_COMM_WORLD) + , triangulation(mpi_communicator, + typename Triangulation::MeshSmoothing( + Triangulation::smoothing_on_refinement | + Triangulation::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)) {} @@ -145,11 +145,12 @@ namespace Step40 const QGauss face_quadrature_formula(fe.degree + 1); - FEFaceValues fe_face_values( - fe, - face_quadrature_formula, - update_values | update_quadrature_points | update_normal_vectors | - update_JxW_values); + FEFaceValues fe_face_values(fe, + face_quadrature_formula, + update_values | + update_quadrature_points | + update_normal_vectors | + update_JxW_values); Tensor<1, dim> u; Point down{0, -1}; @@ -199,20 +200,24 @@ namespace Step40 locally_relevant_dofs); } - locally_relevant_solution.reinit( - locally_owned_dofs, locally_relevant_dofs, mpi_communicator); + locally_relevant_solution.reinit(locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); system_rhs.reinit(locally_owned_dofs, mpi_communicator); system_rhs = PetscScalar(); constraints.clear(); constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); - DynamicSparsityPattern csp( - dof_handler.n_dofs(), dof_handler.n_dofs(), locally_relevant_dofs); + DynamicSparsityPattern csp(dof_handler.n_dofs(), + dof_handler.n_dofs(), + locally_relevant_dofs); DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false); SparsityTools::distribute_sparsity_pattern( csp, @@ -321,14 +326,14 @@ namespace Step40 11, 11); #else - check_solver_within_range( - solver.solve(system_matrix, - completely_distributed_solution, - system_rhs, - PETScWrappers::PreconditionJacobi(system_matrix)), - solver_control.last_step(), - 120, - 260); + check_solver_within_range(solver.solve(system_matrix, + completely_distributed_solution, + system_rhs, + PETScWrappers::PreconditionJacobi( + system_matrix)), + solver_control.last_step(), + 120, + 260); #endif pcout << " Solved in " << solver_control.last_step() << " iterations." diff --git a/tests/mpi/step-40_cuthill_mckee_MPI-subset.cc b/tests/mpi/step-40_cuthill_mckee_MPI-subset.cc index 5d46d8a8d1..892ebfdc94 100644 --- a/tests/mpi/step-40_cuthill_mckee_MPI-subset.cc +++ b/tests/mpi/step-40_cuthill_mckee_MPI-subset.cc @@ -109,18 +109,18 @@ namespace Step40 template - LaplaceProblem::LaplaceProblem(MPI_Comm comm) : - mpi_communicator(comm), - triangulation(mpi_communicator, - typename Triangulation::MeshSmoothing( - Triangulation::smoothing_on_refinement | - Triangulation::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)) + LaplaceProblem::LaplaceProblem(MPI_Comm comm) + : mpi_communicator(comm) + , triangulation(mpi_communicator, + typename Triangulation::MeshSmoothing( + Triangulation::smoothing_on_refinement | + Triangulation::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)) {} @@ -146,11 +146,12 @@ namespace Step40 const QGauss face_quadrature_formula(fe.degree + 1); - FEFaceValues fe_face_values( - fe, - face_quadrature_formula, - update_values | update_quadrature_points | update_normal_vectors | - update_JxW_values); + FEFaceValues fe_face_values(fe, + face_quadrature_formula, + update_values | + update_quadrature_points | + update_normal_vectors | + update_JxW_values); Tensor<1, dim> u; Point down{0, -1}; @@ -200,20 +201,24 @@ namespace Step40 locally_relevant_dofs); } - locally_relevant_solution.reinit( - locally_owned_dofs, locally_relevant_dofs, mpi_communicator); + locally_relevant_solution.reinit(locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); system_rhs.reinit(locally_owned_dofs, mpi_communicator); system_rhs = PetscScalar(); constraints.clear(); constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); - DynamicSparsityPattern csp( - dof_handler.n_dofs(), dof_handler.n_dofs(), locally_relevant_dofs); + DynamicSparsityPattern csp(dof_handler.n_dofs(), + dof_handler.n_dofs(), + locally_relevant_dofs); DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false); SparsityTools::distribute_sparsity_pattern( csp, @@ -322,14 +327,14 @@ namespace Step40 11, 11); #else - check_solver_within_range( - solver.solve(system_matrix, - completely_distributed_solution, - system_rhs, - PETScWrappers::PreconditionJacobi(system_matrix)), - solver_control.last_step(), - 120, - 260); + check_solver_within_range(solver.solve(system_matrix, + completely_distributed_solution, + system_rhs, + PETScWrappers::PreconditionJacobi( + system_matrix)), + solver_control.last_step(), + 120, + 260); #endif pcout << " Solved in " << solver_control.last_step() << " iterations." diff --git a/tests/mpi/step-40_direct_solver.cc b/tests/mpi/step-40_direct_solver.cc index 2691e888f9..9c97afd7ff 100644 --- a/tests/mpi/step-40_direct_solver.cc +++ b/tests/mpi/step-40_direct_solver.cc @@ -103,18 +103,18 @@ namespace Step40 template - LaplaceProblem::LaplaceProblem() : - mpi_communicator(MPI_COMM_WORLD), - triangulation(mpi_communicator, - typename Triangulation::MeshSmoothing( - Triangulation::smoothing_on_refinement | - Triangulation::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)) + LaplaceProblem::LaplaceProblem() + : mpi_communicator(MPI_COMM_WORLD) + , triangulation(mpi_communicator, + typename Triangulation::MeshSmoothing( + Triangulation::smoothing_on_refinement | + Triangulation::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)) {} @@ -136,20 +136,24 @@ namespace Step40 locally_owned_dofs = dof_handler.locally_owned_dofs(); DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs); - locally_relevant_solution.reinit( - locally_owned_dofs, locally_relevant_dofs, mpi_communicator); + locally_relevant_solution.reinit(locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); system_rhs.reinit(locally_owned_dofs, mpi_communicator); system_rhs = PetscScalar(); constraints.clear(); constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(), + constraints); constraints.close(); - DynamicSparsityPattern csp( - dof_handler.n_dofs(), dof_handler.n_dofs(), locally_relevant_dofs); + DynamicSparsityPattern csp(dof_handler.n_dofs(), + dof_handler.n_dofs(), + locally_relevant_dofs); DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false); SparsityTools::distribute_sparsity_pattern( csp, diff --git a/tests/mpi/tria_signals_02.cc b/tests/mpi/tria_signals_02.cc index 4776d13f7c..ec5d673857 100644 --- a/tests/mpi/tria_signals_02.cc +++ b/tests/mpi/tria_signals_02.cc @@ -35,9 +35,9 @@ template class SignalListener { public: - SignalListener(Triangulation &tria_in) : - n_active_cells(tria_in.n_active_cells()), - tria(tria_in) + SignalListener(Triangulation &tria_in) + : n_active_cells(tria_in.n_active_cells()) + , tria(tria_in) { tria_in.signals.post_refinement_on_cell.connect( std::bind(&SignalListener::count_on_refine, diff --git a/tests/mpi/tria_signals_03.cc b/tests/mpi/tria_signals_03.cc index 1dcf3e6c6a..c8af054932 100644 --- a/tests/mpi/tria_signals_03.cc +++ b/tests/mpi/tria_signals_03.cc @@ -38,9 +38,9 @@ template class SignalListener { public: - SignalListener(Triangulation &tria_in) : - n_active_cells(tria_in.n_active_cells()), - tria(tria_in) + SignalListener(Triangulation &tria_in) + : n_active_cells(tria_in.n_active_cells()) + , tria(tria_in) { tria_in.signals.post_refinement_on_cell.connect( std::bind(&SignalListener::count_on_refine, diff --git a/tests/mpi/tria_signals_04.cc b/tests/mpi/tria_signals_04.cc index db1e869ec1..01f5638070 100644 --- a/tests/mpi/tria_signals_04.cc +++ b/tests/mpi/tria_signals_04.cc @@ -39,9 +39,9 @@ template class SignalListener { public: - SignalListener(Triangulation &tria_in) : - n_active_cells(tria_in.n_active_cells()), - tria(tria_in) + SignalListener(Triangulation &tria_in) + : n_active_cells(tria_in.n_active_cells()) + , tria(tria_in) { tria_in.signals.post_refinement_on_cell.connect( std::bind(&SignalListener::count_on_refine, diff --git a/tests/mpi/tria_signals_05.cc b/tests/mpi/tria_signals_05.cc index 10a46193c9..460e1979c9 100644 --- a/tests/mpi/tria_signals_05.cc +++ b/tests/mpi/tria_signals_05.cc @@ -39,9 +39,9 @@ template class SignalListener { public: - SignalListener(Triangulation &tria_in) : - n_active_cells(tria_in.n_active_cells()), - tria(tria_in) + SignalListener(Triangulation &tria_in) + : n_active_cells(tria_in.n_active_cells()) + , tria(tria_in) { tria_in.signals.post_refinement_on_cell.connect( std::bind(&SignalListener::count_on_refine, diff --git a/tests/mpi/tria_signals_06.cc b/tests/mpi/tria_signals_06.cc index cd7cf24499..e64e6c538b 100644 --- a/tests/mpi/tria_signals_06.cc +++ b/tests/mpi/tria_signals_06.cc @@ -38,9 +38,9 @@ template class SignalListener { public: - SignalListener(Triangulation &tria_in) : - n_active_cells(tria_in.n_active_cells()), - tria(tria_in) + SignalListener(Triangulation &tria_in) + : n_active_cells(tria_in.n_active_cells()) + , tria(tria_in) { // tria_in.signals.post_refinement_on_cell.connect // (std::bind (&SignalListener::count_on_refine, diff --git a/tests/mpi/trilinos_matvec_01.cc b/tests/mpi/trilinos_matvec_01.cc index fbe72e3ddd..e1ed488f12 100644 --- a/tests/mpi/trilinos_matvec_01.cc +++ b/tests/mpi/trilinos_matvec_01.cc @@ -68,8 +68,9 @@ test() else Assert(false, ExcNotImplemented()); - TrilinosWrappers::SparsityPattern sp( - row_partitioning, col_partitioning, MPI_COMM_WORLD); + TrilinosWrappers::SparsityPattern sp(row_partitioning, + col_partitioning, + MPI_COMM_WORLD); if (my_id == 0) { sp.add(0, 0); @@ -95,8 +96,9 @@ test() x.reinit(col_partitioning, MPI_COMM_WORLD); y.reinit(row_partitioning, MPI_COMM_WORLD); - LinearAlgebra::distributed::Vector dx( - col_partitioning, col_partitioning, MPI_COMM_WORLD), + LinearAlgebra::distributed::Vector 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) diff --git a/tests/mpi/trilinos_matvec_02.cc b/tests/mpi/trilinos_matvec_02.cc index d1257401ad..3b1400a89b 100644 --- a/tests/mpi/trilinos_matvec_02.cc +++ b/tests/mpi/trilinos_matvec_02.cc @@ -68,8 +68,9 @@ test() else Assert(false, ExcNotImplemented()); - TrilinosWrappers::SparsityPattern sp( - row_partitioning, col_partitioning, MPI_COMM_WORLD); + TrilinosWrappers::SparsityPattern sp(row_partitioning, + col_partitioning, + MPI_COMM_WORLD); if (my_id == 0) { sp.add(0, 0); @@ -95,8 +96,9 @@ test() x.reinit(col_partitioning, MPI_COMM_WORLD); y.reinit(row_partitioning, MPI_COMM_WORLD); - LinearAlgebra::distributed::Vector dx( - col_partitioning, col_partitioning, MPI_COMM_WORLD), + LinearAlgebra::distributed::Vector 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) diff --git a/tests/mpi/trilinos_matvec_03.cc b/tests/mpi/trilinos_matvec_03.cc index 5e5da93e51..91d04f4940 100644 --- a/tests/mpi/trilinos_matvec_03.cc +++ b/tests/mpi/trilinos_matvec_03.cc @@ -64,8 +64,9 @@ test() else Assert(false, ExcNotImplemented()); - TrilinosWrappers::SparsityPattern sp( - row_partitioning, col_partitioning, MPI_COMM_WORLD); + TrilinosWrappers::SparsityPattern sp(row_partitioning, + col_partitioning, + MPI_COMM_WORLD); if (my_id == 0) { sp.add(0, 0); @@ -89,8 +90,9 @@ test() x.reinit(col_partitioning, MPI_COMM_WORLD); y.reinit(row_partitioning, MPI_COMM_WORLD); - LinearAlgebra::distributed::Vector dx( - col_partitioning, col_partitioning, MPI_COMM_WORLD), + LinearAlgebra::distributed::Vector 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) diff --git a/tests/mpi/trilinos_sparse_matrix_01.cc b/tests/mpi/trilinos_sparse_matrix_01.cc index cd995d4308..262912ef5a 100644 --- a/tests/mpi/trilinos_sparse_matrix_01.cc +++ b/tests/mpi/trilinos_sparse_matrix_01.cc @@ -68,8 +68,9 @@ test() else Assert(false, ExcNotImplemented()); - TrilinosWrappers::SparsityPattern sp( - row_partitioning, col_partitioning, MPI_COMM_WORLD); + TrilinosWrappers::SparsityPattern sp(row_partitioning, + col_partitioning, + MPI_COMM_WORLD); if (my_id == 0) { sp.add(0, 0); diff --git a/tests/mpi/trilinos_sparse_matrix_02.cc b/tests/mpi/trilinos_sparse_matrix_02.cc index 5cc707c17a..b9d12ca113 100644 --- a/tests/mpi/trilinos_sparse_matrix_02.cc +++ b/tests/mpi/trilinos_sparse_matrix_02.cc @@ -57,8 +57,9 @@ test() else Assert(false, ExcNotImplemented()); - TrilinosWrappers::SparsityPattern sp( - locally_owned, locally_owned, MPI_COMM_WORLD); + TrilinosWrappers::SparsityPattern sp(locally_owned, + locally_owned, + MPI_COMM_WORLD); if (my_id == 0) { sp.add(0, 0); diff --git a/tests/mpi/trilinos_sparse_matrix_03.cc b/tests/mpi/trilinos_sparse_matrix_03.cc index 30f37d8939..3aaa4da4bc 100644 --- a/tests/mpi/trilinos_sparse_matrix_03.cc +++ b/tests/mpi/trilinos_sparse_matrix_03.cc @@ -67,8 +67,9 @@ test() else Assert(false, ExcNotImplemented()); - TrilinosWrappers::SparsityPattern sp( - row_partitioning, col_partitioning, MPI_COMM_WORLD); + TrilinosWrappers::SparsityPattern sp(row_partitioning, + col_partitioning, + MPI_COMM_WORLD); if (my_id == 0) { sp.add(0, 0); diff --git a/tests/mpi/trilinos_sparse_matrix_04.cc b/tests/mpi/trilinos_sparse_matrix_04.cc index 67861c8702..82f1670433 100644 --- a/tests/mpi/trilinos_sparse_matrix_04.cc +++ b/tests/mpi/trilinos_sparse_matrix_04.cc @@ -68,8 +68,9 @@ test() else Assert(false, ExcNotImplemented()); - TrilinosWrappers::SparsityPattern sp( - row_partitioning, col_partitioning, MPI_COMM_WORLD); + TrilinosWrappers::SparsityPattern sp(row_partitioning, + col_partitioning, + MPI_COMM_WORLD); if (my_id == 0) { sp.add(0, 0); diff --git a/tests/mpi/trilinos_sparse_matrix_05.cc b/tests/mpi/trilinos_sparse_matrix_05.cc index d179f42d8c..5934a8e0d6 100644 --- a/tests/mpi/trilinos_sparse_matrix_05.cc +++ b/tests/mpi/trilinos_sparse_matrix_05.cc @@ -71,8 +71,9 @@ test() else Assert(false, ExcNotImplemented()); - TrilinosWrappers::SparsityPattern sp( - row_partitioning, col_partitioning, MPI_COMM_WORLD); + TrilinosWrappers::SparsityPattern sp(row_partitioning, + col_partitioning, + MPI_COMM_WORLD); if (my_id == 0) { sp.add(0, 0); diff --git a/tests/mpi/trilinos_sparse_matrix_mmult_01.cc b/tests/mpi/trilinos_sparse_matrix_mmult_01.cc index 5d20560a1a..615332fa70 100644 --- a/tests/mpi/trilinos_sparse_matrix_mmult_01.cc +++ b/tests/mpi/trilinos_sparse_matrix_mmult_01.cc @@ -72,8 +72,9 @@ test() const unsigned int local_index[n_entries] = {1, 1}; const double local_value[n_entries] = {1.0, 1.0}; - TrilinosWrappers::SparsityPattern sp( - row_partitioning, col_partitioning, MPI_COMM_WORLD); + TrilinosWrappers::SparsityPattern sp(row_partitioning, + col_partitioning, + MPI_COMM_WORLD); for (unsigned int i = 0; i < n_entries; ++i) if (row_partitioning.is_element(line[i])) sp.add(line[i], local_index[i]); diff --git a/tests/mpi/trilinos_sparse_matrix_print_01.cc b/tests/mpi/trilinos_sparse_matrix_print_01.cc index 1d403c672c..f2b85fcce8 100644 --- a/tests/mpi/trilinos_sparse_matrix_print_01.cc +++ b/tests/mpi/trilinos_sparse_matrix_print_01.cc @@ -65,8 +65,9 @@ test() else Assert(false, ExcNotImplemented()); - TrilinosWrappers::SparsityPattern sp( - row_partitioning, col_partitioning, MPI_COMM_WORLD); + TrilinosWrappers::SparsityPattern sp(row_partitioning, + col_partitioning, + MPI_COMM_WORLD); if ((n_procs == 1) || (my_id == 1)) sp.add(2, 3); sp.compress(); diff --git a/tests/multigrid/constrained_dofs_03.cc b/tests/multigrid/constrained_dofs_03.cc index 233b687129..848536c270 100644 --- a/tests/multigrid/constrained_dofs_03.cc +++ b/tests/multigrid/constrained_dofs_03.cc @@ -64,8 +64,9 @@ check_fe(FiniteElement &fe, ComponentMask &component_mask) boundary_indicators.insert(0); mg_constrained_dofs.initialize(dofh); - mg_constrained_dofs.make_zero_boundary_constraints( - dofh, boundary_indicators, component_mask); + mg_constrained_dofs.make_zero_boundary_constraints(dofh, + boundary_indicators, + component_mask); const unsigned int n_levels = tr.n_global_levels(); for (unsigned int level = 0; level < n_levels; ++level) diff --git a/tests/multigrid/events_01.cc b/tests/multigrid/events_01.cc index 20b5a4330c..0f65791191 100644 --- a/tests/multigrid/events_01.cc +++ b/tests/multigrid/events_01.cc @@ -128,14 +128,14 @@ namespace Step50 template - LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation( - MPI_COMM_WORLD, - Triangulation::limit_level_difference_at_vertices, - parallel::distributed::Triangulation::construct_multigrid_hierarchy), - fe(degree), - mg_dof_handler(triangulation), - degree(degree) + LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(MPI_COMM_WORLD, + Triangulation::limit_level_difference_at_vertices, + parallel::distributed::Triangulation< + dim>::construct_multigrid_hierarchy) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) {} @@ -157,15 +157,18 @@ namespace Step50 typename FunctionMap::type dirichlet_boundary; Functions::ConstantFunction homogeneous_dirichlet_bc(0.0); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - VectorTools::interpolate_boundary_values( - mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); DynamicSparsityPattern dsp(mg_dof_handler.n_dofs(), mg_dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(mg_dof_handler, dsp, constraints); - system_matrix.reinit( - mg_dof_handler.locally_owned_dofs(), dsp, MPI_COMM_WORLD, true); + system_matrix.reinit(mg_dof_handler.locally_owned_dofs(), + dsp, + MPI_COMM_WORLD, + true); mg_constrained_dofs.clear(); @@ -280,8 +283,9 @@ namespace Step50 ++level) { IndexSet dofset; - DoFTools::extract_locally_relevant_level_dofs( - mg_dof_handler, level, dofset); + DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler, + level, + dofset); boundary_constraints[level].reinit(dofset); boundary_constraints[level].add_lines( mg_constrained_dofs.get_refinement_edge_indices(level)); @@ -360,10 +364,9 @@ namespace Step50 class MGCoarseAMG : public MGCoarseGridBase { public: - MGCoarseAMG( - const LA::MPI::SparseMatrix & coarse_matrix, - const LA::MPI::PreconditionAMG::AdditionalData additional_data) : - count(0) + MGCoarseAMG(const LA::MPI::SparseMatrix & coarse_matrix, + const LA::MPI::PreconditionAMG::AdditionalData additional_data) + : count(0) { precondition_amg.initialize(coarse_matrix, additional_data); } @@ -497,12 +500,12 @@ namespace Step50 temp_solution.reinit(locally_relevant_set, MPI_COMM_WORLD); temp_solution = solution; - KellyErrorEstimator::estimate( - static_cast &>(mg_dof_handler), - QGauss(degree + 1), - typename FunctionMap::type(), - temp_solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate(static_cast &>( + mg_dof_handler), + QGauss(degree + 1), + typename FunctionMap::type(), + temp_solution, + estimated_error_per_cell); parallel::distributed::GridRefinement::refine_and_coarsen_fixed_fraction( triangulation, estimated_error_per_cell, 0.3, 0.0); diff --git a/tests/multigrid/interface_matrix_entry_01.cc b/tests/multigrid/interface_matrix_entry_01.cc index 3e552c43dd..97ca541e83 100644 --- a/tests/multigrid/interface_matrix_entry_01.cc +++ b/tests/multigrid/interface_matrix_entry_01.cc @@ -100,8 +100,9 @@ test() Functions::ConstantFunction homogeneous_dirichlet_bc(0.0); dirichlet_boundary_ids.insert(0); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - VectorTools::interpolate_boundary_values( - mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); mg_constrained_dofs.clear(); @@ -113,8 +114,10 @@ test() { DynamicSparsityPattern dsp(mg_dof_handler.n_dofs(level), mg_dof_handler.n_dofs(level)); - MGTools::make_interface_sparsity_pattern( - mg_dof_handler, mg_constrained_dofs, dsp, level); + MGTools::make_interface_sparsity_pattern(mg_dof_handler, + mg_constrained_dofs, + dsp, + level); dsp.print(deallog.get_file_stream()); } } diff --git a/tests/multigrid/mg_coarse_01.cc b/tests/multigrid/mg_coarse_01.cc index 3250887411..ff4a19f265 100644 --- a/tests/multigrid/mg_coarse_01.cc +++ b/tests/multigrid/mg_coarse_01.cc @@ -131,7 +131,9 @@ namespace Step50 class Coefficient : public Function { public: - Coefficient(int K) : Function(), K(K) + Coefficient(int K) + : Function() + , K(K) {} virtual double @@ -182,15 +184,15 @@ namespace Step50 template - LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation( - MPI_COMM_WORLD, - Triangulation::limit_level_difference_at_vertices, - parallel::distributed::Triangulation::construct_multigrid_hierarchy), - fe(degree), - mg_dof_handler(triangulation), - degree(degree), - K(3) + LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(MPI_COMM_WORLD, + Triangulation::limit_level_difference_at_vertices, + parallel::distributed::Triangulation< + dim>::construct_multigrid_hierarchy) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) + , K(3) {} @@ -212,15 +214,18 @@ namespace Step50 typename FunctionMap::type dirichlet_boundary; Functions::ConstantFunction homogeneous_dirichlet_bc(0.0); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - VectorTools::interpolate_boundary_values( - mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); DynamicSparsityPattern dsp(mg_dof_handler.n_dofs(), mg_dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(mg_dof_handler, dsp, constraints); - system_matrix.reinit( - mg_dof_handler.locally_owned_dofs(), dsp, MPI_COMM_WORLD, true); + system_matrix.reinit(mg_dof_handler.locally_owned_dofs(), + dsp, + MPI_COMM_WORLD, + true); mg_constrained_dofs.clear(); @@ -345,8 +350,9 @@ namespace Step50 ++level) { IndexSet dofset; - DoFTools::extract_locally_relevant_level_dofs( - mg_dof_handler, level, dofset); + DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler, + level, + dofset); boundary_constraints[level].reinit(dofset); boundary_constraints[level].add_lines( mg_constrained_dofs.get_refinement_edge_indices(level)); @@ -429,10 +435,9 @@ namespace Step50 class MGCoarseAMG : public MGCoarseGridBase { public: - MGCoarseAMG( - const LA::MPI::SparseMatrix & coarse_matrix, - const LA::MPI::PreconditionAMG::AdditionalData additional_data) : - count(0) + MGCoarseAMG(const LA::MPI::SparseMatrix & coarse_matrix, + const LA::MPI::PreconditionAMG::AdditionalData additional_data) + : count(0) { precondition_amg.initialize(coarse_matrix, additional_data); } @@ -582,12 +587,12 @@ namespace Step50 temp_solution.reinit(locally_relevant_set, MPI_COMM_WORLD); temp_solution = solution; - KellyErrorEstimator::estimate( - static_cast &>(mg_dof_handler), - QGauss(degree + 1), - typename FunctionMap::type(), - temp_solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate(static_cast &>( + mg_dof_handler), + QGauss(degree + 1), + typename FunctionMap::type(), + temp_solution, + estimated_error_per_cell); parallel::distributed::GridRefinement::refine_and_coarsen_fixed_fraction( triangulation, estimated_error_per_cell, 0.3, 0.0); diff --git a/tests/multigrid/mg_renumbered_01.cc b/tests/multigrid/mg_renumbered_01.cc index f78bceff6e..7524f8aebf 100644 --- a/tests/multigrid/mg_renumbered_01.cc +++ b/tests/multigrid/mg_renumbered_01.cc @@ -195,12 +195,12 @@ private: template -LaplaceProblem::LaplaceProblem(const unsigned int deg) : - triangulation(Triangulation::limit_level_difference_at_vertices), - fe(FE_Q(deg), 2, FE_Q(deg), 2), - mg_dof_handler(triangulation), - mg_dof_handler_renumbered(triangulation), - degree(deg) +LaplaceProblem::LaplaceProblem(const unsigned int deg) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , fe(FE_Q(deg), 2, FE_Q(deg), 2) + , mg_dof_handler(triangulation) + , mg_dof_handler_renumbered(triangulation) + , degree(deg) {} @@ -224,8 +224,9 @@ LaplaceProblem::setup_system() // DoFRenumbering::Cuthill_McKee (dof); for (unsigned int level = 0; level < nlevels; ++level) { - DoFRenumbering::component_wise( - mg_dof_handler_renumbered, level, block_component); + DoFRenumbering::component_wise(mg_dof_handler_renumbered, + level, + block_component); // DoFRenumbering::Cuthill_McKee (mg_dof_handler_renumbered, level); } @@ -261,8 +262,9 @@ LaplaceProblem::setup_system() 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); + 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]); @@ -284,15 +286,17 @@ LaplaceProblem::test_interface_dofs() boundary_interface_dofs.push_back(tmp); } - MGTools::extract_inner_interface_dofs( - mg_dof_handler_renumbered, interface_dofs, boundary_interface_dofs); + 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); @@ -406,8 +410,9 @@ LaplaceProblem::test() preconditioner(mg_dof_handler, mg, mg_transfer); PreconditionMG, MGTransferPrebuilt>> - preconditioner_renumbered( - mg_dof_handler_renumbered, mg_renumbered, mg_transfer_renumbered); + preconditioner_renumbered(mg_dof_handler_renumbered, + mg_renumbered, + mg_transfer_renumbered); Vector test, dst, dst_renumbered; test.reinit(mg_dof_handler.n_dofs()); diff --git a/tests/multigrid/mg_renumbered_02.cc b/tests/multigrid/mg_renumbered_02.cc index d6ed0f1cfc..237133e1bd 100644 --- a/tests/multigrid/mg_renumbered_02.cc +++ b/tests/multigrid/mg_renumbered_02.cc @@ -207,12 +207,12 @@ private: template -LaplaceProblem::LaplaceProblem(const unsigned int deg) : - triangulation(Triangulation::limit_level_difference_at_vertices), - mapping(1), - fe(FE_Q(deg), 3), - mg_dof_handler_renumbered(triangulation), - degree(deg) +LaplaceProblem::LaplaceProblem(const unsigned int deg) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , mapping(1) + , fe(FE_Q(deg), 3) + , mg_dof_handler_renumbered(triangulation) + , degree(deg) {} @@ -295,8 +295,9 @@ LaplaceProblem::test_boundary() typename FunctionMap::type dirichlet_boundary; Functions::ZeroFunction dirichlet_bc(fe.n_components()); dirichlet_boundary[0] = &dirichlet_bc; - MGTools::make_boundary_list( - mg_dof_handler_renumbered, dirichlet_boundary, boundary_indices_renumbered); + MGTools::make_boundary_list(mg_dof_handler_renumbered, + dirichlet_boundary, + boundary_indices_renumbered); MGLevelObject> u(0, triangulation.n_levels() - 1); MGLevelObject> d(0, triangulation.n_levels() - 1); diff --git a/tests/multigrid/mg_renumbered_03.cc b/tests/multigrid/mg_renumbered_03.cc index 513d1efe9a..3e59056a3b 100644 --- a/tests/multigrid/mg_renumbered_03.cc +++ b/tests/multigrid/mg_renumbered_03.cc @@ -256,13 +256,13 @@ private: template -LaplaceProblem::LaplaceProblem(const unsigned int deg) : - triangulation(Triangulation::limit_level_difference_at_vertices), - mapping(1), - fe(FE_Q(deg), 3), - mg_dof_handler(triangulation), - mg_dof_handler_renumbered(triangulation), - degree(deg) +LaplaceProblem::LaplaceProblem(const unsigned int deg) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , mapping(1) + , fe(FE_Q(deg), 3) + , mg_dof_handler(triangulation) + , mg_dof_handler_renumbered(triangulation) + , degree(deg) {} diff --git a/tests/multigrid/smoother_block.cc b/tests/multigrid/smoother_block.cc index d5e5e4d71b..82fed27efb 100644 --- a/tests/multigrid/smoother_block.cc +++ b/tests/multigrid/smoother_block.cc @@ -83,7 +83,8 @@ private: //----------------------------------------------------------------------// template -ScalingMatrix::ScalingMatrix(number factor) : factor(factor) +ScalingMatrix::ScalingMatrix(number factor) + : factor(factor) {} diff --git a/tests/multigrid/step-16-02.cc b/tests/multigrid/step-16-02.cc index 25d97a4299..a76317db6f 100644 --- a/tests/multigrid/step-16-02.cc +++ b/tests/multigrid/step-16-02.cc @@ -86,8 +86,8 @@ public: template -LaplaceMatrix::LaplaceMatrix() : - MeshWorker::LocalIntegrator(true, false, false) +LaplaceMatrix::LaplaceMatrix() + : MeshWorker::LocalIntegrator(true, false, false) {} @@ -177,7 +177,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -222,12 +223,12 @@ Coefficient::value_list(const std::vector> &points, template -LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation(Triangulation::limit_level_difference_at_vertices), - fe(degree), - mg_dof_handler(triangulation), - degree(degree), - matrix_integrator() +LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) + , matrix_integrator() {} @@ -258,8 +259,10 @@ LaplaceProblem::setup_system() Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; MappingQGeneric mapping(1); - VectorTools::interpolate_boundary_values( - mapping, mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mapping, + mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); constraints.condense(sparsity_pattern); sparsity_pattern.compress(); @@ -458,8 +461,9 @@ LaplaceProblem::assemble_multigrid(const bool &use_mw) cell_matrix(i, j) = 0; boundary_interface_constraints[cell->level()] - .distribute_local_to_global( - cell_matrix, local_dof_indices, mg_interface_in[cell->level()]); + .distribute_local_to_global(cell_matrix, + local_dof_indices, + mg_interface_in[cell->level()]); } } } diff --git a/tests/multigrid/step-16-03.cc b/tests/multigrid/step-16-03.cc index fda7738873..e269627258 100644 --- a/tests/multigrid/step-16-03.cc +++ b/tests/multigrid/step-16-03.cc @@ -102,7 +102,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -147,12 +148,12 @@ Coefficient::value_list(const std::vector> &points, template -LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation(Triangulation::limit_level_difference_at_vertices), - fe(degree), - mg_dof_handler(triangulation), - degree(degree), - min_level(2) +LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) + , min_level(2) {} @@ -177,8 +178,10 @@ LaplaceProblem::setup_system() Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; MappingQGeneric mapping(1); - VectorTools::interpolate_boundary_values( - mapping, mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mapping, + mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); constraints.condense(sparsity_pattern); sparsity_pattern.compress(); @@ -333,11 +336,12 @@ LaplaceProblem::assemble_multigrid() !mg_constrained_dofs.is_boundary_index( lvl, local_dof_indices[j])) // ( !boundary(i) && !boundary(j) ) - || (mg_constrained_dofs.is_boundary_index( - lvl, local_dof_indices[i]) && - local_dof_indices[i] == - local_dof_indices[j]) // ( boundary(i) && boundary(j) && - // i==j ) + || + (mg_constrained_dofs.is_boundary_index(lvl, + local_dof_indices[i]) && + local_dof_indices[i] == + local_dof_indices[j]) // ( boundary(i) && boundary(j) && + // i==j ) )) { // do nothing, so add entries to interface matrix @@ -415,14 +419,16 @@ LaplaceProblem::refine_grid() { Vector estimated_error_per_cell(triangulation.n_active_cells()); - KellyErrorEstimator::estimate( - static_cast &>(mg_dof_handler), - QGauss(3), - typename FunctionMap::type(), - solution, - estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + KellyErrorEstimator::estimate(static_cast &>( + mg_dof_handler), + QGauss(3), + typename FunctionMap::type(), + 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(); } diff --git a/tests/multigrid/step-16-04.cc b/tests/multigrid/step-16-04.cc index e3cd2b3f82..dfe915b35c 100644 --- a/tests/multigrid/step-16-04.cc +++ b/tests/multigrid/step-16-04.cc @@ -104,7 +104,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -150,12 +151,12 @@ Coefficient::value_list(const std::vector> &points, template -LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation(Triangulation::limit_level_difference_at_vertices), - fe(degree), - mg_dof_handler(triangulation), - degree(degree), - min_level(2) +LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) + , min_level(2) {} @@ -181,8 +182,10 @@ LaplaceProblem::setup_system() Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; MappingQGeneric mapping(1); - VectorTools::interpolate_boundary_values( - mapping, mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mapping, + mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); constraints.condense(sparsity_pattern); sparsity_pattern.compress(); @@ -342,11 +345,12 @@ LaplaceProblem::assemble_multigrid() !mg_constrained_dofs.is_boundary_index( lvl, local_dof_indices[j])) // ( !boundary(i) && !boundary(j) ) - || (mg_constrained_dofs.is_boundary_index( - lvl, local_dof_indices[i]) && - local_dof_indices[i] == - local_dof_indices[j]) // ( boundary(i) && boundary(j) && - // i==j ) + || + (mg_constrained_dofs.is_boundary_index(lvl, + local_dof_indices[i]) && + local_dof_indices[i] == + local_dof_indices[j]) // ( boundary(i) && boundary(j) && + // i==j ) )) { // do nothing, so add entries to interface matrix @@ -440,14 +444,16 @@ LaplaceProblem::refine_grid() { Vector estimated_error_per_cell(triangulation.n_active_cells()); - KellyErrorEstimator::estimate( - static_cast &>(mg_dof_handler), - QGauss(3), - typename FunctionMap::type(), - solution, - estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + KellyErrorEstimator::estimate(static_cast &>( + mg_dof_handler), + QGauss(3), + typename FunctionMap::type(), + 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(); } diff --git a/tests/multigrid/step-16-05.cc b/tests/multigrid/step-16-05.cc index 036c3bf149..fa53e04454 100644 --- a/tests/multigrid/step-16-05.cc +++ b/tests/multigrid/step-16-05.cc @@ -101,7 +101,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -147,12 +148,12 @@ Coefficient::value_list(const std::vector> &points, template -LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation(Triangulation::limit_level_difference_at_vertices), - fe(degree), - mg_dof_handler(triangulation), - degree(degree), - min_level(2) +LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) + , min_level(2) {} @@ -181,8 +182,10 @@ LaplaceProblem::setup_system() Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; MappingQGeneric mapping(1); - VectorTools::interpolate_boundary_values( - mapping, mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mapping, + mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); hanging_node_constraints.close(); constraints.condense(sparsity_pattern); @@ -343,11 +346,12 @@ LaplaceProblem::assemble_multigrid() !mg_constrained_dofs.is_boundary_index( lvl, local_dof_indices[j])) // ( !boundary(i) && !boundary(j) ) - || (mg_constrained_dofs.is_boundary_index( - lvl, local_dof_indices[i]) && - local_dof_indices[i] == - local_dof_indices[j]) // ( boundary(i) && boundary(j) && - // i==j ) + || + (mg_constrained_dofs.is_boundary_index(lvl, + local_dof_indices[i]) && + local_dof_indices[i] == + local_dof_indices[j]) // ( boundary(i) && boundary(j) && + // i==j ) )) { // do nothing, so add entries to interface matrix diff --git a/tests/multigrid/step-16-06.cc b/tests/multigrid/step-16-06.cc index 4fa41b0dde..b6057e3892 100644 --- a/tests/multigrid/step-16-06.cc +++ b/tests/multigrid/step-16-06.cc @@ -101,7 +101,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -147,12 +148,12 @@ Coefficient::value_list(const std::vector> &points, template -LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation(Triangulation::limit_level_difference_at_vertices), - fe(degree), - mg_dof_handler(triangulation), - degree(degree), - min_level(2) +LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) + , min_level(2) {} @@ -181,8 +182,10 @@ LaplaceProblem::setup_system() Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; MappingQGeneric mapping(1); - VectorTools::interpolate_boundary_values( - mapping, mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mapping, + mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); hanging_node_constraints.close(); constraints.condense(sparsity_pattern); @@ -343,11 +346,12 @@ LaplaceProblem::assemble_multigrid() !mg_constrained_dofs.is_boundary_index( lvl, local_dof_indices[j])) // ( !boundary(i) && !boundary(j) ) - || (mg_constrained_dofs.is_boundary_index( - lvl, local_dof_indices[i]) && - local_dof_indices[i] == - local_dof_indices[j]) // ( boundary(i) && boundary(j) && - // i==j ) + || + (mg_constrained_dofs.is_boundary_index(lvl, + local_dof_indices[i]) && + local_dof_indices[i] == + local_dof_indices[j]) // ( boundary(i) && boundary(j) && + // i==j ) )) { // do nothing, so add entries to interface matrix diff --git a/tests/multigrid/step-16-07.cc b/tests/multigrid/step-16-07.cc index d52fc147d9..f90c3f16fc 100644 --- a/tests/multigrid/step-16-07.cc +++ b/tests/multigrid/step-16-07.cc @@ -103,7 +103,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -148,11 +149,11 @@ Coefficient::value_list(const std::vector> &points, template -LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation(Triangulation::limit_level_difference_at_vertices), - fe(degree), - mg_dof_handler(triangulation), - degree(degree) +LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) {} @@ -183,8 +184,10 @@ LaplaceProblem::setup_system() Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; MappingQGeneric mapping(1); - VectorTools::interpolate_boundary_values( - mapping, mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mapping, + mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); constraints.condense(sparsity_pattern); sparsity_pattern.compress(); @@ -382,11 +385,12 @@ LaplaceProblem::assemble_multigrid() !mg_constrained_dofs.is_boundary_index( lvl, local_dof_indices[j])) // ( !boundary(i) && !boundary(j) ) - || (mg_constrained_dofs.is_boundary_index( - lvl, local_dof_indices[i]) && - local_dof_indices[i] == - local_dof_indices[j]) // ( boundary(i) && boundary(j) && - // i==j ) + || + (mg_constrained_dofs.is_boundary_index(lvl, + local_dof_indices[i]) && + local_dof_indices[i] == + local_dof_indices[j]) // ( boundary(i) && boundary(j) && + // i==j ) )) { // do nothing, so add entries to interface matrix @@ -510,14 +514,16 @@ LaplaceProblem::refine_grid() { Vector estimated_error_per_cell(triangulation.n_active_cells()); - KellyErrorEstimator::estimate( - static_cast &>(mg_dof_handler), - QGauss(3), - typename FunctionMap::type(), - solution, - estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + KellyErrorEstimator::estimate(static_cast &>( + mg_dof_handler), + QGauss(3), + typename FunctionMap::type(), + 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(); } diff --git a/tests/multigrid/step-16-50-mpi-linear-operator.cc b/tests/multigrid/step-16-50-mpi-linear-operator.cc index 0f267ff3b0..4ce9efa67f 100644 --- a/tests/multigrid/step-16-50-mpi-linear-operator.cc +++ b/tests/multigrid/step-16-50-mpi-linear-operator.cc @@ -132,7 +132,8 @@ namespace Step50 class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -178,14 +179,14 @@ namespace Step50 template - LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation( - MPI_COMM_WORLD, - Triangulation::limit_level_difference_at_vertices, - parallel::distributed::Triangulation::construct_multigrid_hierarchy), - fe(degree), - mg_dof_handler(triangulation), - degree(degree) + LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(MPI_COMM_WORLD, + Triangulation::limit_level_difference_at_vertices, + parallel::distributed::Triangulation< + dim>::construct_multigrid_hierarchy) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) {} @@ -209,15 +210,18 @@ namespace Step50 typename FunctionMap::type dirichlet_boundary; Functions::ZeroFunction homogeneous_dirichlet_bc; dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - VectorTools::interpolate_boundary_values( - mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); DynamicSparsityPattern dsp(mg_dof_handler.n_dofs(), mg_dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(mg_dof_handler, dsp, constraints); - system_matrix.reinit( - mg_dof_handler.locally_owned_dofs(), dsp, MPI_COMM_WORLD, true); + system_matrix.reinit(mg_dof_handler.locally_owned_dofs(), + dsp, + MPI_COMM_WORLD, + true); mg_constrained_dofs.clear(); @@ -347,8 +351,9 @@ namespace Step50 ++level) { IndexSet dofset; - DoFTools::extract_locally_relevant_level_dofs( - mg_dof_handler, level, dofset); + DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler, + level, + dofset); boundary_constraints[level].reinit(dofset); boundary_constraints[level].add_lines( mg_constrained_dofs.get_refinement_edge_indices(level)); @@ -499,12 +504,12 @@ namespace Step50 temp_solution.reinit(locally_relevant_set, MPI_COMM_WORLD); temp_solution = solution; - KellyErrorEstimator::estimate( - static_cast &>(mg_dof_handler), - QGauss(degree + 1), - typename FunctionMap::type(), - temp_solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate(static_cast &>( + mg_dof_handler), + QGauss(degree + 1), + typename FunctionMap::type(), + temp_solution, + estimated_error_per_cell); const double threshold = 0.6 * Utilities::MPI::max(estimated_error_per_cell.linfty_norm(), diff --git a/tests/multigrid/step-16-50-mpi-smoother.cc b/tests/multigrid/step-16-50-mpi-smoother.cc index 81f7b9ea02..45159e0ed1 100644 --- a/tests/multigrid/step-16-50-mpi-smoother.cc +++ b/tests/multigrid/step-16-50-mpi-smoother.cc @@ -132,7 +132,8 @@ namespace Step50 class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -178,14 +179,14 @@ namespace Step50 template - LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation( - MPI_COMM_WORLD, - Triangulation::limit_level_difference_at_vertices, - parallel::distributed::Triangulation::construct_multigrid_hierarchy), - fe(degree), - mg_dof_handler(triangulation), - degree(degree) + LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(MPI_COMM_WORLD, + Triangulation::limit_level_difference_at_vertices, + parallel::distributed::Triangulation< + dim>::construct_multigrid_hierarchy) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) {} @@ -209,15 +210,18 @@ namespace Step50 typename FunctionMap::type dirichlet_boundary; Functions::ZeroFunction homogeneous_dirichlet_bc; dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - VectorTools::interpolate_boundary_values( - mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); DynamicSparsityPattern dsp(mg_dof_handler.n_dofs(), mg_dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(mg_dof_handler, dsp, constraints); - system_matrix.reinit( - mg_dof_handler.locally_owned_dofs(), dsp, MPI_COMM_WORLD, true); + system_matrix.reinit(mg_dof_handler.locally_owned_dofs(), + dsp, + MPI_COMM_WORLD, + true); mg_constrained_dofs.clear(); @@ -347,8 +351,9 @@ namespace Step50 ++level) { IndexSet dofset; - DoFTools::extract_locally_relevant_level_dofs( - mg_dof_handler, level, dofset); + DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler, + level, + dofset); boundary_constraints[level].reinit(dofset); boundary_constraints[level].add_lines( mg_constrained_dofs.get_refinement_edge_indices(level)); @@ -488,12 +493,12 @@ namespace Step50 temp_solution.reinit(locally_relevant_set, MPI_COMM_WORLD); temp_solution = solution; - KellyErrorEstimator::estimate( - static_cast &>(mg_dof_handler), - QGauss(degree + 1), - typename FunctionMap::type(), - temp_solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate(static_cast &>( + mg_dof_handler), + QGauss(degree + 1), + typename FunctionMap::type(), + temp_solution, + estimated_error_per_cell); const double threshold = 0.6 * Utilities::MPI::max(estimated_error_per_cell.linfty_norm(), diff --git a/tests/multigrid/step-16-50-mpi.cc b/tests/multigrid/step-16-50-mpi.cc index b99eb00100..8a2831c7fd 100644 --- a/tests/multigrid/step-16-50-mpi.cc +++ b/tests/multigrid/step-16-50-mpi.cc @@ -132,7 +132,8 @@ namespace Step50 class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -178,14 +179,14 @@ namespace Step50 template - LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation( - MPI_COMM_WORLD, - Triangulation::limit_level_difference_at_vertices, - parallel::distributed::Triangulation::construct_multigrid_hierarchy), - fe(degree), - mg_dof_handler(triangulation), - degree(degree) + LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(MPI_COMM_WORLD, + Triangulation::limit_level_difference_at_vertices, + parallel::distributed::Triangulation< + dim>::construct_multigrid_hierarchy) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) {} @@ -209,15 +210,18 @@ namespace Step50 typename FunctionMap::type dirichlet_boundary; Functions::ZeroFunction homogeneous_dirichlet_bc; dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - VectorTools::interpolate_boundary_values( - mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); DynamicSparsityPattern dsp(mg_dof_handler.n_dofs(), mg_dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(mg_dof_handler, dsp, constraints); - system_matrix.reinit( - mg_dof_handler.locally_owned_dofs(), dsp, MPI_COMM_WORLD, true); + system_matrix.reinit(mg_dof_handler.locally_owned_dofs(), + dsp, + MPI_COMM_WORLD, + true); mg_constrained_dofs.clear(); @@ -347,8 +351,9 @@ namespace Step50 ++level) { IndexSet dofset; - DoFTools::extract_locally_relevant_level_dofs( - mg_dof_handler, level, dofset); + DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler, + level, + dofset); boundary_constraints[level].reinit(dofset); boundary_constraints[level].add_lines( mg_constrained_dofs.get_refinement_edge_indices(level)); @@ -485,12 +490,12 @@ namespace Step50 temp_solution.reinit(locally_relevant_set, MPI_COMM_WORLD); temp_solution = solution; - KellyErrorEstimator::estimate( - static_cast &>(mg_dof_handler), - QGauss(degree + 1), - typename FunctionMap::type(), - temp_solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate(static_cast &>( + mg_dof_handler), + QGauss(degree + 1), + typename FunctionMap::type(), + temp_solution, + estimated_error_per_cell); const double threshold = 0.6 * Utilities::MPI::max(estimated_error_per_cell.linfty_norm(), diff --git a/tests/multigrid/step-16-50-serial.cc b/tests/multigrid/step-16-50-serial.cc index 35e017e322..9a7c30f006 100644 --- a/tests/multigrid/step-16-50-serial.cc +++ b/tests/multigrid/step-16-50-serial.cc @@ -106,7 +106,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -151,11 +152,11 @@ Coefficient::value_list(const std::vector> &points, template -LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation(Triangulation::limit_level_difference_at_vertices), - fe(degree), - mg_dof_handler(triangulation), - degree(degree) +LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) {} @@ -181,8 +182,10 @@ LaplaceProblem::setup_system() Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; MappingQGeneric mapping(1); - VectorTools::interpolate_boundary_values( - mapping, mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mapping, + mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); constraints.condense(sparsity_pattern); sparsity_pattern.compress(); @@ -335,11 +338,12 @@ LaplaceProblem::assemble_multigrid() !mg_constrained_dofs.is_boundary_index( lvl, local_dof_indices[j])) // ( !boundary(i) && !boundary(j) ) - || (mg_constrained_dofs.is_boundary_index( - lvl, local_dof_indices[i]) && - local_dof_indices[i] == - local_dof_indices[j]) // ( boundary(i) && boundary(j) && - // i==j ) + || + (mg_constrained_dofs.is_boundary_index(lvl, + local_dof_indices[i]) && + local_dof_indices[i] == + local_dof_indices[j]) // ( boundary(i) && boundary(j) && + // i==j ) )) { } @@ -410,12 +414,12 @@ LaplaceProblem::refine_grid() { Vector estimated_error_per_cell(triangulation.n_active_cells()); - KellyErrorEstimator::estimate( - static_cast &>(mg_dof_handler), - QGauss(degree + 1), - typename FunctionMap::type(), - solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate(static_cast &>( + mg_dof_handler), + QGauss(degree + 1), + typename FunctionMap::type(), + solution, + estimated_error_per_cell); const double threshold = 0.6 * estimated_error_per_cell.linfty_norm(); GridRefinement::refine(triangulation, estimated_error_per_cell, threshold); diff --git a/tests/multigrid/step-16-bdry1.cc b/tests/multigrid/step-16-bdry1.cc index 2a63f69e95..2bde093414 100644 --- a/tests/multigrid/step-16-bdry1.cc +++ b/tests/multigrid/step-16-bdry1.cc @@ -87,8 +87,8 @@ public: template -LaplaceMatrix::LaplaceMatrix() : - MeshWorker::LocalIntegrator(true, false, false) +LaplaceMatrix::LaplaceMatrix() + : MeshWorker::LocalIntegrator(true, false, false) {} @@ -178,7 +178,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -223,12 +224,12 @@ Coefficient::value_list(const std::vector> &points, template -LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation(Triangulation::limit_level_difference_at_vertices), - fe(degree), - mg_dof_handler(triangulation), - degree(degree), - matrix_integrator() +LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) + , matrix_integrator() {} @@ -259,8 +260,10 @@ LaplaceProblem::setup_system() Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; MappingQGeneric mapping(1); - VectorTools::interpolate_boundary_values( - mapping, mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mapping, + mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); constraints.condense(sparsity_pattern); sparsity_pattern.compress(); diff --git a/tests/multigrid/step-16.cc b/tests/multigrid/step-16.cc index 3370350c45..ad77d3632b 100644 --- a/tests/multigrid/step-16.cc +++ b/tests/multigrid/step-16.cc @@ -103,7 +103,8 @@ template class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -148,11 +149,11 @@ Coefficient::value_list(const std::vector> &points, template -LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation(Triangulation::limit_level_difference_at_vertices), - fe(degree), - mg_dof_handler(triangulation), - degree(degree) +LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) {} @@ -183,8 +184,10 @@ LaplaceProblem::setup_system() Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; MappingQGeneric mapping(1); - VectorTools::interpolate_boundary_values( - mapping, mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mapping, + mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); constraints.condense(sparsity_pattern); sparsity_pattern.compress(); @@ -382,11 +385,12 @@ LaplaceProblem::assemble_multigrid() !mg_constrained_dofs.is_boundary_index( lvl, local_dof_indices[j])) // ( !boundary(i) && !boundary(j) ) - || (mg_constrained_dofs.is_boundary_index( - lvl, local_dof_indices[i]) && - local_dof_indices[i] == - local_dof_indices[j]) // ( boundary(i) && boundary(j) && - // i==j ) + || + (mg_constrained_dofs.is_boundary_index(lvl, + local_dof_indices[i]) && + local_dof_indices[i] == + local_dof_indices[j]) // ( boundary(i) && boundary(j) && + // i==j ) )) { // do nothing, so add entries to interface matrix @@ -511,14 +515,16 @@ LaplaceProblem::refine_grid() { Vector estimated_error_per_cell(triangulation.n_active_cells()); - KellyErrorEstimator::estimate( - static_cast &>(mg_dof_handler), - QGauss(3), - typename FunctionMap::type(), - solution, - estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + KellyErrorEstimator::estimate(static_cast &>( + mg_dof_handler), + QGauss(3), + typename FunctionMap::type(), + 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(); } diff --git a/tests/multigrid/step-39-02.cc b/tests/multigrid/step-39-02.cc index 94af002f15..2ed9245312 100644 --- a/tests/multigrid/step-39-02.cc +++ b/tests/multigrid/step-39-02.cc @@ -436,12 +436,12 @@ namespace Step39 template InteriorPenaltyProblem::InteriorPenaltyProblem( - const FiniteElement &fe) : - triangulation(Triangulation::limit_level_difference_at_vertices), - mapping(1), - fe(fe), - dof_handler(triangulation), - estimates(1) + const FiniteElement &fe) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , mapping(1) + , fe(fe) + , dof_handler(triangulation) + , estimates(1) { GridGenerator::hyper_cube_slit(triangulation, -1, 1); } @@ -642,8 +642,9 @@ namespace Step39 MeshWorker::IntegrationInfoBox 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 + 1, n_gauss_points); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points + 1, + n_gauss_points); AnyData solution_data; solution_data.add *>(&solution, "solution"); @@ -692,8 +693,9 @@ namespace Step39 MeshWorker::IntegrationInfoBox 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 + 1, n_gauss_points); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points + 1, + n_gauss_points); AnyData solution_data; solution_data.add *>(&solution, "solution"); diff --git a/tests/multigrid/step-39-02a.cc b/tests/multigrid/step-39-02a.cc index 96cafa38c2..c355d1cead 100644 --- a/tests/multigrid/step-39-02a.cc +++ b/tests/multigrid/step-39-02a.cc @@ -439,12 +439,12 @@ namespace Step39 template InteriorPenaltyProblem::InteriorPenaltyProblem( - const FiniteElement &fe) : - triangulation(Triangulation::limit_level_difference_at_vertices), - mapping(1), - fe(fe), - dof_handler(triangulation), - estimates(1) + const FiniteElement &fe) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , mapping(1) + , fe(fe) + , dof_handler(triangulation) + , estimates(1) { GridGenerator::hyper_cube_slit(triangulation, -1, 1); } @@ -649,8 +649,9 @@ namespace Step39 MeshWorker::IntegrationInfoBox 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 + 1, n_gauss_points); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points + 1, + n_gauss_points); AnyData solution_data; solution_data.add *>(&solution, "solution"); @@ -699,8 +700,9 @@ namespace Step39 MeshWorker::IntegrationInfoBox 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 + 1, n_gauss_points); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points + 1, + n_gauss_points); AnyData solution_data; solution_data.add *>(&solution, "solution"); diff --git a/tests/multigrid/step-39-03.cc b/tests/multigrid/step-39-03.cc index 32960a6fe4..16bbe86727 100644 --- a/tests/multigrid/step-39-03.cc +++ b/tests/multigrid/step-39-03.cc @@ -442,12 +442,12 @@ namespace Step39 template InteriorPenaltyProblem::InteriorPenaltyProblem( - const FiniteElement &fe) : - triangulation(Triangulation::limit_level_difference_at_vertices), - mapping(1), - fe(fe), - dof_handler(triangulation), - estimates(1) + const FiniteElement &fe) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , mapping(1) + , fe(fe) + , dof_handler(triangulation) + , estimates(1) { GridGenerator::hyper_cube_slit(triangulation, -1, 1); } @@ -648,8 +648,9 @@ namespace Step39 MeshWorker::IntegrationInfoBox 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 + 1, n_gauss_points); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points + 1, + n_gauss_points); AnyData solution_data; solution_data.add *>(&solution, "solution"); @@ -698,8 +699,9 @@ namespace Step39 MeshWorker::IntegrationInfoBox 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 + 1, n_gauss_points); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points + 1, + n_gauss_points); AnyData solution_data; solution_data.add *>(&solution, "solution"); diff --git a/tests/multigrid/step-39.cc b/tests/multigrid/step-39.cc index 1a666a8fc5..4c6936398a 100644 --- a/tests/multigrid/step-39.cc +++ b/tests/multigrid/step-39.cc @@ -436,12 +436,12 @@ namespace Step39 template InteriorPenaltyProblem::InteriorPenaltyProblem( - const FiniteElement &fe) : - triangulation(Triangulation::limit_level_difference_at_vertices), - mapping(1), - fe(fe), - dof_handler(triangulation), - estimates(1) + const FiniteElement &fe) + : triangulation(Triangulation::limit_level_difference_at_vertices) + , mapping(1) + , fe(fe) + , dof_handler(triangulation) + , estimates(1) { GridGenerator::hyper_cube_slit(triangulation, -1, 1); } @@ -630,8 +630,9 @@ namespace Step39 MeshWorker::IntegrationInfoBox 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 + 1, n_gauss_points); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points + 1, + n_gauss_points); AnyData solution_data; solution_data.add *>(&solution, "solution"); @@ -680,8 +681,9 @@ namespace Step39 MeshWorker::IntegrationInfoBox 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 + 1, n_gauss_points); + info_box.initialize_gauss_quadrature(n_gauss_points, + n_gauss_points + 1, + n_gauss_points); AnyData solution_data; solution_data.add *>(&solution, "solution"); diff --git a/tests/multigrid/step-50_01.cc b/tests/multigrid/step-50_01.cc index 194042e657..0050d02314 100644 --- a/tests/multigrid/step-50_01.cc +++ b/tests/multigrid/step-50_01.cc @@ -128,7 +128,9 @@ namespace Step50 class Coefficient : public Function { public: - Coefficient(int K) : Function(), K(K) + Coefficient(int K) + : Function() + , K(K) {} virtual double @@ -179,15 +181,15 @@ namespace Step50 template - LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation( - MPI_COMM_WORLD, - Triangulation::limit_level_difference_at_vertices, - parallel::distributed::Triangulation::construct_multigrid_hierarchy), - fe(degree), - mg_dof_handler(triangulation), - degree(degree), - K(4) + LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation(MPI_COMM_WORLD, + Triangulation::limit_level_difference_at_vertices, + parallel::distributed::Triangulation< + dim>::construct_multigrid_hierarchy) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) + , K(4) {} @@ -209,15 +211,18 @@ namespace Step50 typename FunctionMap::type dirichlet_boundary; Functions::ConstantFunction homogeneous_dirichlet_bc(0.0); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - VectorTools::interpolate_boundary_values( - mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); DynamicSparsityPattern dsp(mg_dof_handler.n_dofs(), mg_dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(mg_dof_handler, dsp, constraints); - system_matrix.reinit( - mg_dof_handler.locally_owned_dofs(), dsp, MPI_COMM_WORLD, true); + system_matrix.reinit(mg_dof_handler.locally_owned_dofs(), + dsp, + MPI_COMM_WORLD, + true); mg_constrained_dofs.clear(); @@ -342,8 +347,9 @@ namespace Step50 ++level) { IndexSet dofset; - DoFTools::extract_locally_relevant_level_dofs( - mg_dof_handler, level, dofset); + DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler, + level, + dofset); boundary_constraints[level].reinit(dofset); boundary_constraints[level].add_lines( mg_constrained_dofs.get_refinement_edge_indices(level)); @@ -507,12 +513,12 @@ namespace Step50 temp_solution.reinit(locally_relevant_set, MPI_COMM_WORLD); temp_solution = solution; - KellyErrorEstimator::estimate( - static_cast &>(mg_dof_handler), - QGauss(degree + 1), - typename FunctionMap::type(), - temp_solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate(static_cast &>( + mg_dof_handler), + QGauss(degree + 1), + typename FunctionMap::type(), + temp_solution, + estimated_error_per_cell); parallel::distributed::GridRefinement::refine_and_coarsen_fixed_fraction( triangulation, estimated_error_per_cell, 0.3, 0.0); diff --git a/tests/multigrid/step-50_02.cc b/tests/multigrid/step-50_02.cc index 27526be9ee..4bb3190c25 100644 --- a/tests/multigrid/step-50_02.cc +++ b/tests/multigrid/step-50_02.cc @@ -132,7 +132,8 @@ namespace Step50 class Coefficient : public Function { public: - Coefficient() : Function() + Coefficient() + : Function() {} virtual double @@ -178,19 +179,19 @@ namespace Step50 template - LaplaceProblem::LaplaceProblem(const unsigned int degree) : - triangulation( - MPI_COMM_WORLD, - typename Triangulation::MeshSmoothing( - Triangulation::limit_level_difference_at_vertices), - true, - // parallel::shared::Triangulation::Settings::partition_custom_signal), - typename parallel::shared::Triangulation::Settings( - parallel::shared::Triangulation::partition_zorder | - parallel::shared::Triangulation::construct_multigrid_hierarchy)), - fe(degree), - mg_dof_handler(triangulation), - degree(degree) + LaplaceProblem::LaplaceProblem(const unsigned int degree) + : triangulation( + MPI_COMM_WORLD, + typename Triangulation::MeshSmoothing( + Triangulation::limit_level_difference_at_vertices), + true, + // parallel::shared::Triangulation::Settings::partition_custom_signal), + typename parallel::shared::Triangulation::Settings( + parallel::shared::Triangulation::partition_zorder | + parallel::shared::Triangulation::construct_multigrid_hierarchy)) + , fe(degree) + , mg_dof_handler(triangulation) + , degree(degree) {} @@ -216,15 +217,18 @@ namespace Step50 Functions::ConstantFunction homogeneous_dirichlet_bc(1.0); dirichlet_boundary_ids.insert(0); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - VectorTools::interpolate_boundary_values( - mg_dof_handler, dirichlet_boundary, constraints); + VectorTools::interpolate_boundary_values(mg_dof_handler, + dirichlet_boundary, + constraints); constraints.close(); DynamicSparsityPattern dsp(mg_dof_handler.n_dofs(), mg_dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(mg_dof_handler, dsp, constraints); - system_matrix.reinit( - mg_dof_handler.locally_owned_dofs(), dsp, MPI_COMM_WORLD, true); + system_matrix.reinit(mg_dof_handler.locally_owned_dofs(), + dsp, + MPI_COMM_WORLD, + true); mg_constrained_dofs.clear(); @@ -356,8 +360,9 @@ namespace Step50 ++level) { IndexSet dofset; - DoFTools::extract_locally_relevant_level_dofs( - mg_dof_handler, level, dofset); + DoFTools::extract_locally_relevant_level_dofs(mg_dof_handler, + level, + dofset); boundary_constraints[level].reinit(dofset); boundary_constraints[level].add_lines( mg_constrained_dofs.get_refinement_edge_indices(level)); diff --git a/tests/multigrid/transfer_matrix_free_08.cc b/tests/multigrid/transfer_matrix_free_08.cc index e97624ee16..f1d98ae909 100644 --- a/tests/multigrid/transfer_matrix_free_08.cc +++ b/tests/multigrid/transfer_matrix_free_08.cc @@ -59,8 +59,9 @@ check(const FiniteElement &fe) exponents_monomial[d] = 1; LinearAlgebra::distributed::Vector vrefcoarse; vrefcoarse.reinit(dofcoarse.n_dofs()); - VectorTools::interpolate( - dofcoarse, Functions::Monomial(exponents_monomial), vrefcoarse); + VectorTools::interpolate(dofcoarse, + Functions::Monomial(exponents_monomial), + vrefcoarse); deallog << "no. cells: " << tr.n_global_active_cells() << std::endl; @@ -76,8 +77,9 @@ check(const FiniteElement &fe) LinearAlgebra::distributed::Vector vref; AssertDimension(mgdof.n_dofs(tr.n_global_levels() - 1), mgdof.n_dofs()); vrefdouble.reinit(mgdof.n_dofs()); - VectorTools::interpolate( - mgdof, Functions::Monomial(exponents_monomial), vrefdouble); + VectorTools::interpolate(mgdof, + Functions::Monomial(exponents_monomial), + vrefdouble); vref.reinit(mgdof.n_dofs()); vref = vrefdouble; diff --git a/tests/multigrid/transfer_matrix_free_09.cc b/tests/multigrid/transfer_matrix_free_09.cc index d8b3832e64..ca997301a5 100644 --- a/tests/multigrid/transfer_matrix_free_09.cc +++ b/tests/multigrid/transfer_matrix_free_09.cc @@ -68,8 +68,9 @@ check(const FiniteElement &fe) exponents_monomial[d] = 1; LinearAlgebra::distributed::Vector vref; vref.reinit(mgdof.n_dofs()); - VectorTools::interpolate( - mgdof, Functions::Monomial(exponents_monomial), vref); + VectorTools::interpolate(mgdof, + Functions::Monomial(exponents_monomial), + vref); deallog << "no. cells: " << tr.n_global_active_cells() << std::endl; @@ -91,8 +92,9 @@ check(const FiniteElement &fe) for (unsigned int level = vectors.max_level(); level > 0; --level) { LinearAlgebra::distributed::Vector vec2(vectors[level - 1]); - transfer_ref.restrict_and_add( - level, vectors[level - 1], vectors[level]); + transfer_ref.restrict_and_add(level, + vectors[level - 1], + vectors[level]); transfer.restrict_and_add(level, vec2, vectors[level]); vec2 -= vectors[level - 1]; deallog << "Error in restriction: " << (double)vec2.linfty_norm() @@ -102,8 +104,9 @@ check(const FiniteElement &fe) for (unsigned int level = 1; level < vectors.max_level(); ++level) { LinearAlgebra::distributed::Vector vec2(vectors[level + 1]); - transfer_ref.prolongate( - level + 1, vectors[level + 1], vectors[level]); + transfer_ref.prolongate(level + 1, + vectors[level + 1], + vectors[level]); transfer.prolongate(level + 1, vec2, vectors[level]); vec2 -= vectors[level + 1]; deallog << "Error in prolongation: " << (double)vec2.linfty_norm() diff --git a/tests/multigrid/transfer_matrix_free_10.cc b/tests/multigrid/transfer_matrix_free_10.cc index 3fd827f1f5..2e6ee74b89 100644 --- a/tests/multigrid/transfer_matrix_free_10.cc +++ b/tests/multigrid/transfer_matrix_free_10.cc @@ -68,8 +68,9 @@ check(const FiniteElement &fe) exponents_monomial[d] = 1; LinearAlgebra::distributed::Vector vref; vref.reinit(mgdof.n_dofs()); - VectorTools::interpolate( - mgdof, Functions::Monomial(exponents_monomial), vref); + VectorTools::interpolate(mgdof, + Functions::Monomial(exponents_monomial), + vref); deallog << "no. cells: " << tr.n_global_active_cells() << std::endl; @@ -89,8 +90,9 @@ check(const FiniteElement &fe) for (unsigned int level = vectors.max_level(); level > 0; --level) { LinearAlgebra::distributed::Vector vec2(vectors[level - 1]); - transfer_ref.restrict_and_add( - level, vectors[level - 1], vectors[level]); + transfer_ref.restrict_and_add(level, + vectors[level - 1], + vectors[level]); transfer.restrict_and_add(level, vec2, vectors[level]); vec2 -= vectors[level - 1]; deallog << "Error in restriction: " << (double)vec2.linfty_norm() @@ -100,8 +102,9 @@ check(const FiniteElement &fe) for (unsigned int level = 1; level < vectors.max_level(); ++level) { LinearAlgebra::distributed::Vector vec2(vectors[level + 1]); - transfer_ref.prolongate( - level + 1, vectors[level + 1], vectors[level]); + transfer_ref.prolongate(level + 1, + vectors[level + 1], + vectors[level]); transfer.prolongate(level + 1, vec2, vectors[level]); vec2 -= vectors[level + 1]; deallog << "Error in prolongation: " << (double)vec2.linfty_norm() diff --git a/tests/multigrid/transfer_matrix_free_12.cc b/tests/multigrid/transfer_matrix_free_12.cc index 0b1059749a..de9dd72164 100644 --- a/tests/multigrid/transfer_matrix_free_12.cc +++ b/tests/multigrid/transfer_matrix_free_12.cc @@ -62,8 +62,9 @@ check(const FiniteElement &fe_scalar) exponents_monomial[d] = 1; LinearAlgebra::distributed::Vector vrefcoarse; vrefcoarse.reinit(dofcoarse.n_dofs()); - VectorTools::interpolate( - dofcoarse, Functions::Monomial(exponents_monomial, dim), vrefcoarse); + VectorTools::interpolate(dofcoarse, + Functions::Monomial(exponents_monomial, dim), + vrefcoarse); deallog << "no. cells: " << tr.n_global_active_cells() << std::endl; @@ -79,8 +80,9 @@ check(const FiniteElement &fe_scalar) LinearAlgebra::distributed::Vector vref; AssertDimension(mgdof.n_dofs(tr.n_global_levels() - 1), mgdof.n_dofs()); vrefdouble.reinit(mgdof.n_dofs()); - VectorTools::interpolate( - mgdof, Functions::Monomial(exponents_monomial, dim), vrefdouble); + VectorTools::interpolate(mgdof, + Functions::Monomial(exponents_monomial, dim), + vrefdouble); vref.reinit(mgdof.n_dofs()); vref = vrefdouble; diff --git a/tests/multigrid/transfer_system_04.cc b/tests/multigrid/transfer_system_04.cc index 696ecc2dbb..858a501063 100644 --- a/tests/multigrid/transfer_system_04.cc +++ b/tests/multigrid/transfer_system_04.cc @@ -115,8 +115,9 @@ check(const FiniteElement &fe) std::vector> dofs_per_block( tr.n_levels(), std::vector(2)); - MGTools::count_dofs_per_block( - mg_dof_handler, dofs_per_block, block_component); + MGTools::count_dofs_per_block(mg_dof_handler, + dofs_per_block, + block_component); FullMatrix prolong_0_1(dofs_per_block[1][0], dofs_per_block[0][0]); FullMatrix prolong_1_2(dofs_per_block[2][0], dofs_per_block[1][0]); diff --git a/tests/multigrid/transfer_system_05.cc b/tests/multigrid/transfer_system_05.cc index f985d38a7b..908397c43e 100644 --- a/tests/multigrid/transfer_system_05.cc +++ b/tests/multigrid/transfer_system_05.cc @@ -75,12 +75,14 @@ check(const FiniteElement &fe, const unsigned int selected_block) block_component); std::vector dofs_per_block(3); - DoFTools::count_dofs_per_block( - mg_dof_handler, dofs_per_block, block_component); + DoFTools::count_dofs_per_block(mg_dof_handler, + dofs_per_block, + block_component); std::vector> mg_dofs_per_block( tr.n_levels(), std::vector(3)); - MGTools::count_dofs_per_block( - mg_dof_handler, mg_dofs_per_block, block_component); + 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) diff --git a/tests/multigrid/transfer_system_adaptive_04.cc b/tests/multigrid/transfer_system_adaptive_04.cc index 5c205e67ce..a143b97461 100644 --- a/tests/multigrid/transfer_system_adaptive_04.cc +++ b/tests/multigrid/transfer_system_adaptive_04.cc @@ -157,8 +157,9 @@ check(const FiniteElement &fe) Functions::ZeroFunction dirichlet_bc(fe.n_components()); dirichlet_boundary[3] = &dirichlet_bc; - MGTools::make_boundary_list( - mg_dof_handler, dirichlet_boundary, boundary_indices); + MGTools::make_boundary_list(mg_dof_handler, + dirichlet_boundary, + boundary_indices); std::vector block_selected(2, 0U); MGTransferSelect transfer; diff --git a/tests/multigrid/transfer_system_adaptive_06.cc b/tests/multigrid/transfer_system_adaptive_06.cc index af98c886ec..0642c4325b 100644 --- a/tests/multigrid/transfer_system_adaptive_06.cc +++ b/tests/multigrid/transfer_system_adaptive_06.cc @@ -157,8 +157,9 @@ check(const FiniteElement &fe) Functions::ZeroFunction dirichlet_bc(fe.n_components()); dirichlet_boundary[3] = &dirichlet_bc; - MGTools::make_boundary_list( - mg_dof_handler, dirichlet_boundary, boundary_indices); + MGTools::make_boundary_list(mg_dof_handler, + dirichlet_boundary, + boundary_indices); std::vector block_selected(2); block_selected[0] = 0; diff --git a/tests/multigrid/transfer_system_adaptive_08.cc b/tests/multigrid/transfer_system_adaptive_08.cc index 08532d51bf..14b0ace005 100644 --- a/tests/multigrid/transfer_system_adaptive_08.cc +++ b/tests/multigrid/transfer_system_adaptive_08.cc @@ -161,8 +161,9 @@ check(const FiniteElement &fe) Functions::ZeroFunction dirichlet_bc(fe.n_components()); dirichlet_boundary[3] = &dirichlet_bc; - MGTools::make_boundary_list( - mg_dof_handler, dirichlet_boundary, boundary_indices); + MGTools::make_boundary_list(mg_dof_handler, + dirichlet_boundary, + boundary_indices); MGTransferSelect transfer; transfer.build_matrices(mg_dof_handler, diff --git a/tests/multigrid/transfer_system_adaptive_09.cc b/tests/multigrid/transfer_system_adaptive_09.cc index 8cb00f4a4e..fe29c3f620 100644 --- a/tests/multigrid/transfer_system_adaptive_09.cc +++ b/tests/multigrid/transfer_system_adaptive_09.cc @@ -121,12 +121,14 @@ check(const FiniteElement &fe, const unsigned int selected_block) block_component); std::vector dofs_per_block(3); - DoFTools::count_dofs_per_block( - mg_dof_handler, dofs_per_block, block_component); + DoFTools::count_dofs_per_block(mg_dof_handler, + dofs_per_block, + block_component); std::vector> mg_dofs_per_block( tr.n_levels(), std::vector(3)); - MGTools::count_dofs_per_block( - mg_dof_handler, mg_dofs_per_block, block_component); + 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) diff --git a/tests/non_matching/coupling_04.cc b/tests/non_matching/coupling_04.cc index 1fbb36a547..8850fa634c 100644 --- a/tests/non_matching/coupling_04.cc +++ b/tests/non_matching/coupling_04.cc @@ -103,8 +103,9 @@ test() Vector squares(dh.n_dofs()); Vector projected_squares(dh.n_dofs()); - VectorTools::interpolate( - space_dh, Functions::SquareFunction(), space_square); + VectorTools::interpolate(space_dh, + Functions::SquareFunction(), + space_square); VectorTools::interpolate(dh, Functions::SquareFunction(), squares); coupling.Tvmult(projected_squares, space_square); diff --git a/tests/non_matching/coupling_05.cc b/tests/non_matching/coupling_05.cc index b3207e31fc..d74584925f 100644 --- a/tests/non_matching/coupling_05.cc +++ b/tests/non_matching/coupling_05.cc @@ -94,8 +94,9 @@ test() QGauss quad(3); // Quadrature for coupling - TrilinosWrappers::SparsityPattern sparsity( - space_locally_owned_dofs, locally_owned_dofs, comm); + TrilinosWrappers::SparsityPattern sparsity(space_locally_owned_dofs, + locally_owned_dofs, + comm); NonMatching::create_coupling_sparsity_pattern(space_dh, dh, quad, sparsity); sparsity.compress(); @@ -127,8 +128,9 @@ test() for (unsigned int q = 0; q < quad.size(); ++q) cell_matrix(i, j) += fev.shape_value(i, q) * fev.shape_value(j, q) * fev.JxW(q); - constraints.distribute_local_to_global( - cell_matrix, dofs, mass_matrix); + constraints.distribute_local_to_global(cell_matrix, + dofs, + mass_matrix); } mass_matrix.compress(VectorOperation::add); } @@ -140,8 +142,9 @@ test() TrilinosWrappers::MPI::Vector Mprojected_squares(locally_owned_dofs, comm); TrilinosWrappers::MPI::Vector projected_squares(locally_owned_dofs, comm); - VectorTools::interpolate( - space_dh, Functions::SquareFunction(), space_square); + VectorTools::interpolate(space_dh, + Functions::SquareFunction(), + space_square); VectorTools::interpolate(dh, Functions::SquareFunction(), squares); coupling.Tvmult(Mprojected_squares, space_square); diff --git a/tests/non_matching/coupling_06.cc b/tests/non_matching/coupling_06.cc index de231a367c..3074f846d4 100644 --- a/tests/non_matching/coupling_06.cc +++ b/tests/non_matching/coupling_06.cc @@ -96,8 +96,9 @@ test() GridTools::Cache cache(space_tria); - TrilinosWrappers::SparsityPattern sparsity( - space_locally_owned_dofs, locally_owned_dofs, comm); + TrilinosWrappers::SparsityPattern sparsity(space_locally_owned_dofs, + locally_owned_dofs, + comm); NonMatching::create_coupling_sparsity_pattern( cache, space_dh, dh, quad, sparsity); sparsity.compress(); @@ -130,8 +131,9 @@ test() for (unsigned int q = 0; q < quad.size(); ++q) cell_matrix(i, j) += fev.shape_value(i, q) * fev.shape_value(j, q) * fev.JxW(q); - constraints.distribute_local_to_global( - cell_matrix, dofs, mass_matrix); + constraints.distribute_local_to_global(cell_matrix, + dofs, + mass_matrix); } mass_matrix.compress(VectorOperation::add); } @@ -143,8 +145,9 @@ test() TrilinosWrappers::MPI::Vector Mprojected_squares(locally_owned_dofs, comm); TrilinosWrappers::MPI::Vector projected_squares(locally_owned_dofs, comm); - VectorTools::interpolate( - space_dh, Functions::SquareFunction(), space_square); + VectorTools::interpolate(space_dh, + Functions::SquareFunction(), + space_square); VectorTools::interpolate(dh, Functions::SquareFunction(), squares); coupling.Tvmult(Mprojected_squares, space_square); diff --git a/tests/non_matching/immersed_surface_quadrature.cc b/tests/non_matching/immersed_surface_quadrature.cc index 66b3acedee..2633f90a18 100644 --- a/tests/non_matching/immersed_surface_quadrature.cc +++ b/tests/non_matching/immersed_surface_quadrature.cc @@ -62,8 +62,9 @@ test_non_default_constructor() std::vector weights(1, 1); std::vector> normals; normals.push_back(Point::unit_vector(dim - 1)); - NonMatching::ImmersedSurfaceQuadrature quadrature( - points, weights, normals); + NonMatching::ImmersedSurfaceQuadrature quadrature(points, + weights, + normals); print_quadrature(quadrature); } diff --git a/tests/numerics/assemble_matrix_parallel_01.cc b/tests/numerics/assemble_matrix_parallel_01.cc index f663c9b5cc..f7c943d7e3 100644 --- a/tests/numerics/assemble_matrix_parallel_01.cc +++ b/tests/numerics/assemble_matrix_parallel_01.cc @@ -67,18 +67,18 @@ namespace Assembly struct Data { Data(const hp::FECollection &fe, - const hp::QCollection & quadrature) : - hp_fe_values(fe, - quadrature, - update_values | update_gradients | - update_quadrature_points | update_JxW_values) + const hp::QCollection & quadrature) + : hp_fe_values(fe, + quadrature, + update_values | update_gradients | + update_quadrature_points | update_JxW_values) {} - Data(const Data &data) : - hp_fe_values(data.hp_fe_values.get_mapping_collection(), - data.hp_fe_values.get_fe_collection(), - data.hp_fe_values.get_quadrature_collection(), - data.hp_fe_values.get_update_flags()) + Data(const Data &data) + : hp_fe_values(data.hp_fe_values.get_mapping_collection(), + data.hp_fe_values.get_fe_collection(), + data.hp_fe_values.get_quadrature_collection(), + data.hp_fe_values.get_update_flags()) {} hp::FEValues hp_fe_values; @@ -162,7 +162,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -186,7 +187,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -207,9 +209,9 @@ RightHandSide::value(const Point &p, template -LaplaceProblem::LaplaceProblem() : - dof_handler(triangulation), - max_degree(5) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) + , max_degree(5) { if (dim == 2) for (unsigned int degree = 2; degree <= max_degree; ++degree) @@ -269,8 +271,10 @@ LaplaceProblem::setup_system() // 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. - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); graph = GraphColoring::make_graph_coloring( @@ -384,17 +388,18 @@ LaplaceProblem::assemble_test() test_matrix = 0; test_rhs = 0; - WorkStream::run( - graph, - std::bind(&LaplaceProblem::local_assemble, - this, - std::placeholders::_1, - std::placeholders::_2, - std::placeholders::_3), - std::bind( - &LaplaceProblem::copy_local_to_global, this, std::placeholders::_1), - Assembly::Scratch::Data(fe_collection, quadrature_collection), - Assembly::Copy::Data()); + WorkStream::run(graph, + std::bind(&LaplaceProblem::local_assemble, + this, + std::placeholders::_1, + std::placeholders::_2, + std::placeholders::_3), + std::bind(&LaplaceProblem::copy_local_to_global, + this, + std::placeholders::_1), + Assembly::Scratch::Data(fe_collection, + quadrature_collection), + Assembly::Copy::Data()); test_matrix.add(-1, reference_matrix); @@ -414,8 +419,10 @@ LaplaceProblem::postprocess() for (unsigned int i = 0; i < estimated_error_per_cell.size(); ++i) estimated_error_per_cell(i) = i; - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); for (typename hp::DoFHandler::active_cell_iterator cell = diff --git a/tests/numerics/assemble_matrix_parallel_02.cc b/tests/numerics/assemble_matrix_parallel_02.cc index f0b7d91557..d364184a05 100644 --- a/tests/numerics/assemble_matrix_parallel_02.cc +++ b/tests/numerics/assemble_matrix_parallel_02.cc @@ -69,18 +69,18 @@ namespace Assembly struct Data { Data(const hp::FECollection &fe, - const hp::QCollection & quadrature) : - hp_fe_values(fe, - quadrature, - update_values | update_gradients | - update_quadrature_points | update_JxW_values) + const hp::QCollection & quadrature) + : hp_fe_values(fe, + quadrature, + update_values | update_gradients | + update_quadrature_points | update_JxW_values) {} - Data(const Data &data) : - hp_fe_values(data.hp_fe_values.get_mapping_collection(), - data.hp_fe_values.get_fe_collection(), - data.hp_fe_values.get_quadrature_collection(), - data.hp_fe_values.get_update_flags()) + Data(const Data &data) + : hp_fe_values(data.hp_fe_values.get_mapping_collection(), + data.hp_fe_values.get_fe_collection(), + data.hp_fe_values.get_quadrature_collection(), + data.hp_fe_values.get_update_flags()) {} hp::FEValues hp_fe_values; @@ -91,10 +91,12 @@ namespace Assembly { struct Data { - Data(bool second_test = false) : second_test(second_test) + Data(bool second_test = false) + : second_test(second_test) {} - Data(const Data &data) : second_test(data.second_test) + Data(const Data &data) + : second_test(data.second_test) {} std::vector local_dof_indices; @@ -177,7 +179,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -201,7 +204,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -222,9 +226,9 @@ RightHandSide::value(const Point &p, template -LaplaceProblem::LaplaceProblem() : - dof_handler(triangulation), - max_degree(5) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) + , max_degree(5) { if (dim == 2) for (unsigned int degree = 2; degree <= max_degree; ++degree) @@ -285,8 +289,10 @@ LaplaceProblem::setup_system() // 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. - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); graph = GraphColoring::make_graph_coloring( @@ -409,19 +415,20 @@ LaplaceProblem::assemble_test_1() test_matrix = 0; test_rhs = 0; - WorkStream::run( - graph, - std::bind(&LaplaceProblem::local_assemble, - this, - std::placeholders::_1, - std::placeholders::_2, - std::placeholders::_3), - std::bind( - &LaplaceProblem::copy_local_to_global, this, std::placeholders::_1), - Assembly::Scratch::Data(fe_collection, quadrature_collection), - Assembly::Copy::Data(), - MultithreadInfo::n_threads(), - 1); + WorkStream::run(graph, + std::bind(&LaplaceProblem::local_assemble, + this, + std::placeholders::_1, + std::placeholders::_2, + std::placeholders::_3), + std::bind(&LaplaceProblem::copy_local_to_global, + this, + std::placeholders::_1), + Assembly::Scratch::Data(fe_collection, + quadrature_collection), + Assembly::Copy::Data(), + MultithreadInfo::n_threads(), + 1); } @@ -432,19 +439,20 @@ LaplaceProblem::assemble_test_2() test_matrix_2 = 0; test_rhs_2 = 0; - WorkStream::run( - graph, - std::bind(&LaplaceProblem::local_assemble, - this, - std::placeholders::_1, - std::placeholders::_2, - std::placeholders::_3), - std::bind( - &LaplaceProblem::copy_local_to_global, this, std::placeholders::_1), - Assembly::Scratch::Data(fe_collection, quadrature_collection), - Assembly::Copy::Data(true), - 2 * MultithreadInfo::n_threads(), - 1); + WorkStream::run(graph, + std::bind(&LaplaceProblem::local_assemble, + this, + std::placeholders::_1, + std::placeholders::_2, + std::placeholders::_3), + std::bind(&LaplaceProblem::copy_local_to_global, + this, + std::placeholders::_1), + Assembly::Scratch::Data(fe_collection, + quadrature_collection), + Assembly::Copy::Data(true), + 2 * MultithreadInfo::n_threads(), + 1); } template @@ -482,8 +490,10 @@ LaplaceProblem::postprocess() for (unsigned int i = 0; i < estimated_error_per_cell.size(); ++i) estimated_error_per_cell(i) = i; - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); for (typename hp::DoFHandler::active_cell_iterator cell = diff --git a/tests/numerics/assemble_matrix_parallel_03.cc b/tests/numerics/assemble_matrix_parallel_03.cc index cb2b291b4a..1832760201 100644 --- a/tests/numerics/assemble_matrix_parallel_03.cc +++ b/tests/numerics/assemble_matrix_parallel_03.cc @@ -67,18 +67,18 @@ namespace Assembly struct Data { Data(const hp::FECollection &fe, - const hp::QCollection & quadrature) : - hp_fe_values(fe, - quadrature, - update_values | update_gradients | - update_quadrature_points | update_JxW_values) + const hp::QCollection & quadrature) + : hp_fe_values(fe, + quadrature, + update_values | update_gradients | + update_quadrature_points | update_JxW_values) {} - Data(const Data &data) : - hp_fe_values(data.hp_fe_values.get_mapping_collection(), - data.hp_fe_values.get_fe_collection(), - data.hp_fe_values.get_quadrature_collection(), - data.hp_fe_values.get_update_flags()) + Data(const Data &data) + : hp_fe_values(data.hp_fe_values.get_mapping_collection(), + data.hp_fe_values.get_fe_collection(), + data.hp_fe_values.get_quadrature_collection(), + data.hp_fe_values.get_update_flags()) {} hp::FEValues hp_fe_values; @@ -162,7 +162,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -186,7 +187,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -207,9 +209,9 @@ RightHandSide::value(const Point &p, template -LaplaceProblem::LaplaceProblem() : - dof_handler(triangulation), - max_degree(5) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) + , max_degree(5) { if (dim == 2) for (unsigned int degree = 2; degree <= max_degree; ++degree) @@ -269,8 +271,10 @@ LaplaceProblem::setup_system() // 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. - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); graph = GraphColoring::make_graph_coloring( @@ -389,17 +393,18 @@ LaplaceProblem::assemble_test() test_matrix = 0; test_rhs = 0; - WorkStream::run( - graph, - std::bind(&LaplaceProblem::local_assemble, - this, - std::placeholders::_1, - std::placeholders::_2, - std::placeholders::_3), - std::bind( - &LaplaceProblem::copy_local_to_global, this, std::placeholders::_1), - Assembly::Scratch::Data(fe_collection, quadrature_collection), - Assembly::Copy::Data()); + WorkStream::run(graph, + std::bind(&LaplaceProblem::local_assemble, + this, + std::placeholders::_1, + std::placeholders::_2, + std::placeholders::_3), + std::bind(&LaplaceProblem::copy_local_to_global, + this, + std::placeholders::_1), + Assembly::Scratch::Data(fe_collection, + quadrature_collection), + Assembly::Copy::Data()); test_matrix.add(-1, reference_matrix); @@ -424,8 +429,10 @@ LaplaceProblem::postprocess() for (unsigned int i = 0; i < estimated_error_per_cell.size(); ++i) estimated_error_per_cell(i) = i; - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); for (typename hp::DoFHandler::active_cell_iterator cell = diff --git a/tests/numerics/assemble_matrix_parallel_04.cc b/tests/numerics/assemble_matrix_parallel_04.cc index ddc43fcc6e..4b19f93752 100644 --- a/tests/numerics/assemble_matrix_parallel_04.cc +++ b/tests/numerics/assemble_matrix_parallel_04.cc @@ -68,18 +68,18 @@ namespace Assembly struct Data { Data(const hp::FECollection &fe, - const hp::QCollection & quadrature) : - hp_fe_values(fe, - quadrature, - update_values | update_gradients | - update_quadrature_points | update_JxW_values) + const hp::QCollection & quadrature) + : hp_fe_values(fe, + quadrature, + update_values | update_gradients | + update_quadrature_points | update_JxW_values) {} - Data(const Data &data) : - hp_fe_values(data.hp_fe_values.get_mapping_collection(), - data.hp_fe_values.get_fe_collection(), - data.hp_fe_values.get_quadrature_collection(), - data.hp_fe_values.get_update_flags()) + Data(const Data &data) + : hp_fe_values(data.hp_fe_values.get_mapping_collection(), + data.hp_fe_values.get_fe_collection(), + data.hp_fe_values.get_quadrature_collection(), + data.hp_fe_values.get_update_flags()) {} hp::FEValues hp_fe_values; @@ -90,10 +90,12 @@ namespace Assembly { struct Data { - Data(const unsigned int test_variant) : test_variant(test_variant) + Data(const unsigned int test_variant) + : test_variant(test_variant) {} - Data(const Data &data) : test_variant(data.test_variant) + Data(const Data &data) + : test_variant(data.test_variant) {} std::vector local_dof_indices; @@ -176,7 +178,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -200,7 +203,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -221,9 +225,9 @@ RightHandSide::value(const Point &p, template -LaplaceProblem::LaplaceProblem() : - dof_handler(triangulation), - max_degree(5) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) + , max_degree(5) { if (dim == 2) for (unsigned int degree = 2; degree <= max_degree; ++degree) @@ -297,8 +301,10 @@ LaplaceProblem::setup_system() // 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. - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); graph = GraphColoring::make_graph_coloring( @@ -437,19 +443,20 @@ LaplaceProblem::assemble_test_1() test_matrix = 0; test_rhs = 0; - WorkStream::run( - graph, - std::bind(&LaplaceProblem::local_assemble, - this, - std::placeholders::_1, - std::placeholders::_2, - std::placeholders::_3), - std::bind( - &LaplaceProblem::copy_local_to_global, this, std::placeholders::_1), - Assembly::Scratch::Data(fe_collection, quadrature_collection), - Assembly::Copy::Data(1), - 2 * MultithreadInfo::n_threads(), - 1); + WorkStream::run(graph, + std::bind(&LaplaceProblem::local_assemble, + this, + std::placeholders::_1, + std::placeholders::_2, + std::placeholders::_3), + std::bind(&LaplaceProblem::copy_local_to_global, + this, + std::placeholders::_1), + Assembly::Scratch::Data(fe_collection, + quadrature_collection), + Assembly::Copy::Data(1), + 2 * MultithreadInfo::n_threads(), + 1); for (unsigned int i = 0; i < dof_handler.n_dofs(); ++i) if (constraints.is_constrained(i)) { @@ -466,19 +473,20 @@ LaplaceProblem::assemble_test_2() test_matrix_2 = 0; test_rhs_2 = 0; - WorkStream::run( - graph, - std::bind(&LaplaceProblem::local_assemble, - this, - std::placeholders::_1, - std::placeholders::_2, - std::placeholders::_3), - std::bind( - &LaplaceProblem::copy_local_to_global, this, std::placeholders::_1), - Assembly::Scratch::Data(fe_collection, quadrature_collection), - Assembly::Copy::Data(2), - 2 * MultithreadInfo::n_threads(), - 1); + WorkStream::run(graph, + std::bind(&LaplaceProblem::local_assemble, + this, + std::placeholders::_1, + std::placeholders::_2, + std::placeholders::_3), + std::bind(&LaplaceProblem::copy_local_to_global, + this, + std::placeholders::_1), + Assembly::Scratch::Data(fe_collection, + quadrature_collection), + Assembly::Copy::Data(2), + 2 * MultithreadInfo::n_threads(), + 1); for (unsigned int i = 0; i < dof_handler.n_dofs(); ++i) if (constraints.is_constrained(i)) { @@ -519,8 +527,10 @@ LaplaceProblem::postprocess() for (unsigned int i = 0; i < estimated_error_per_cell.size(); ++i) estimated_error_per_cell(i) = i; - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); for (typename hp::DoFHandler::active_cell_iterator cell = diff --git a/tests/numerics/create_laplace_matrix_constraints_02b.cc b/tests/numerics/create_laplace_matrix_constraints_02b.cc index 37fef6500e..e4d27c7154 100644 --- a/tests/numerics/create_laplace_matrix_constraints_02b.cc +++ b/tests/numerics/create_laplace_matrix_constraints_02b.cc @@ -78,8 +78,10 @@ check() ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(2), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(2), + constraints); constraints.close(); // create sparsity pattern. note diff --git a/tests/numerics/create_mass_matrix_constraints_02b.cc b/tests/numerics/create_mass_matrix_constraints_02b.cc index 993b1be863..c16e2e90de 100644 --- a/tests/numerics/create_mass_matrix_constraints_02b.cc +++ b/tests/numerics/create_mass_matrix_constraints_02b.cc @@ -78,8 +78,10 @@ check() ConstraintMatrix constraints; DoFTools::make_hanging_node_constraints(dof, constraints); - VectorTools::interpolate_boundary_values( - dof, 0, Functions::ZeroFunction(2), constraints); + VectorTools::interpolate_boundary_values(dof, + 0, + Functions::ZeroFunction(2), + constraints); constraints.close(); // create sparsity pattern. note diff --git a/tests/numerics/derivative_approximation_02.cc b/tests/numerics/derivative_approximation_02.cc index 445b764da1..aba6f2cf9b 100644 --- a/tests/numerics/derivative_approximation_02.cc +++ b/tests/numerics/derivative_approximation_02.cc @@ -49,7 +49,8 @@ template class MyFunction : public Function { public: - MyFunction() : Function() + MyFunction() + : Function() {} virtual double @@ -87,10 +88,14 @@ exact_third(Point &p, Tensor<3, dim> &third) { double x = p[0], y = p[1]; // 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)}; - double dy[4] = { - cos(b * y), -b * sin(b * y), -b * b * cos(b * y), b * b * b * sin(b * y)}; + double dx[4] = {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)}; for (int i = 0; i < dim; ++i) for (int j = 0; j < dim; ++j) diff --git a/tests/numerics/derivative_approximation_03.cc b/tests/numerics/derivative_approximation_03.cc index b63d77db9d..75ce735cae 100644 --- a/tests/numerics/derivative_approximation_03.cc +++ b/tests/numerics/derivative_approximation_03.cc @@ -48,7 +48,8 @@ template class MyFunction : public Function { public: - MyFunction() : Function() + MyFunction() + : Function() {} virtual double @@ -86,10 +87,14 @@ exact_third(Point &p, Tensor<3, dim> &third) { double x = p[0], y = p[1]; // 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)}; - double dy[4] = { - cos(b * y), -b * sin(b * y), -b * b * cos(b * y), b * b * b * sin(b * y)}; + double dx[4] = {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)}; for (int i = 0; i < dim; ++i) for (int j = 0; j < dim; ++j) diff --git a/tests/numerics/derivatives.cc b/tests/numerics/derivatives.cc index a335070e99..9cc8cbe07c 100644 --- a/tests/numerics/derivatives.cc +++ b/tests/numerics/derivatives.cc @@ -83,8 +83,9 @@ check(const unsigned int level, Vector u(dof.n_dofs()); Vector f(dof.n_dofs()); - SparsityPattern A_pattern( - dof.n_dofs(), dof.n_dofs(), dof.max_couplings_between_dofs()); + SparsityPattern A_pattern(dof.n_dofs(), + dof.n_dofs(), + dof.max_couplings_between_dofs()); DoFTools::make_sparsity_pattern(dof, A_pattern); A_pattern.compress(); diff --git a/tests/numerics/error_estimator.cc b/tests/numerics/error_estimator.cc index 1c5252d02f..f9bd5e4147 100644 --- a/tests/numerics/error_estimator.cc +++ b/tests/numerics/error_estimator.cc @@ -45,7 +45,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(2) + MySquareFunction() + : Function(2) {} virtual double diff --git a/tests/numerics/error_estimator_02.cc b/tests/numerics/error_estimator_02.cc index a3d113b998..f7736b27b1 100644 --- a/tests/numerics/error_estimator_02.cc +++ b/tests/numerics/error_estimator_02.cc @@ -120,7 +120,9 @@ private: }; template -MyFunction::MyFunction(const double k) : dealii::Function(1), k(k) +MyFunction::MyFunction(const double k) + : dealii::Function(1) + , k(k) {} template @@ -162,7 +164,9 @@ private: }; template -NeumanBC::NeumanBC(const double c) : dealii::Function(1), c(c) +NeumanBC::NeumanBC(const double c) + : dealii::Function(1) + , c(c) {} template @@ -614,7 +618,8 @@ public: }; template -MySecondFunction::MySecondFunction() : dealii::Function(1) +MySecondFunction::MySecondFunction() + : dealii::Function(1) {} template diff --git a/tests/numerics/error_estimator_02_complex.cc b/tests/numerics/error_estimator_02_complex.cc index c900e806e9..f55cfba6ae 100644 --- a/tests/numerics/error_estimator_02_complex.cc +++ b/tests/numerics/error_estimator_02_complex.cc @@ -65,9 +65,9 @@ private: }; template -MyFunction::MyFunction(const double k) : - dealii::Function>(1), - k(k) +MyFunction::MyFunction(const double k) + : dealii::Function>(1) + , k(k) {} template @@ -109,9 +109,9 @@ private: }; template -NeumanBC::NeumanBC(const double c) : - dealii::Function>(1), - c(c) +NeumanBC::NeumanBC(const double c) + : dealii::Function>(1) + , c(c) {} template @@ -562,8 +562,8 @@ public: }; template -MySecondFunction::MySecondFunction() : - dealii::Function>(1) +MySecondFunction::MySecondFunction() + : dealii::Function>(1) {} template @@ -576,8 +576,9 @@ MySecondFunction::value(const dealii::Point &point, Assert(dim > 1, dealii::ExcNotImplemented()); const double &y = point[1]; - return std::complex( - 0, (1. - x) * (1. - y) * (1. - y) + std::pow(1.0 - y, 4) * std::exp(-x)); + return std::complex(0, + (1. - x) * (1. - y) * (1. - y) + + std::pow(1.0 - y, 4) * std::exp(-x)); } template diff --git a/tests/numerics/generalized_interpolation.h b/tests/numerics/generalized_interpolation.h index 6cc7833ffb..122745f041 100644 --- a/tests/numerics/generalized_interpolation.h +++ b/tests/numerics/generalized_interpolation.h @@ -34,9 +34,9 @@ template class F : public Function { public: - F(const unsigned int n_comp, const unsigned int q) : - Function(n_comp), - q(q) + F(const unsigned int n_comp, const unsigned int q) + : Function(n_comp) + , q(q) {} virtual double diff --git a/tests/numerics/kelly_crash_02.cc b/tests/numerics/kelly_crash_02.cc index 23c7cd5092..ed5ce909ec 100644 --- a/tests/numerics/kelly_crash_02.cc +++ b/tests/numerics/kelly_crash_02.cc @@ -49,18 +49,24 @@ test() static const Point<3> vertices_1[] = { // points on the lower surface Point(0, 0, -4), - Point( - std::cos(0 * numbers::PI / 6), std::sin(0 * numbers::PI / 6), -4), - Point( - std::cos(2 * numbers::PI / 6), std::sin(2 * numbers::PI / 6), -4), - Point( - std::cos(4 * numbers::PI / 6), std::sin(4 * numbers::PI / 6), -4), - Point( - std::cos(6 * numbers::PI / 6), std::sin(6 * numbers::PI / 6), -4), - Point( - std::cos(8 * numbers::PI / 6), std::sin(8 * numbers::PI / 6), -4), - Point( - std::cos(10 * numbers::PI / 6), std::sin(10 * numbers::PI / 6), -4), + Point(std::cos(0 * numbers::PI / 6), + std::sin(0 * numbers::PI / 6), + -4), + Point(std::cos(2 * numbers::PI / 6), + std::sin(2 * numbers::PI / 6), + -4), + Point(std::cos(4 * numbers::PI / 6), + std::sin(4 * numbers::PI / 6), + -4), + Point(std::cos(6 * numbers::PI / 6), + std::sin(6 * numbers::PI / 6), + -4), + Point(std::cos(8 * numbers::PI / 6), + std::sin(8 * numbers::PI / 6), + -4), + Point(std::cos(10 * numbers::PI / 6), + std::sin(10 * numbers::PI / 6), + -4), // same points on the top // of the stem, with @@ -71,8 +77,9 @@ test() Point(std::cos(4 * numbers::PI / 6), std::sin(4 * numbers::PI / 6), 4), Point(std::cos(6 * numbers::PI / 6), std::sin(6 * numbers::PI / 6), 4), Point(std::cos(8 * numbers::PI / 6), std::sin(8 * numbers::PI / 6), 4), - Point( - std::cos(10 * numbers::PI / 6), std::sin(10 * numbers::PI / 6), 4), + Point(std::cos(10 * numbers::PI / 6), + std::sin(10 * numbers::PI / 6), + 4), // point at top of chevron Point(0, 0, 4 + std::sqrt(2.) / 2), @@ -84,20 +91,26 @@ test() std::sin(2 * numbers::PI / 6), 0) * 4.0, - Point( - std::cos(0 * numbers::PI / 6), std::sin(0 * numbers::PI / 6), 7) + - Point( - std::cos(2 * numbers::PI / 6), std::sin(2 * numbers::PI / 6), 0) * + Point(std::cos(0 * numbers::PI / 6), + std::sin(0 * numbers::PI / 6), + 7) + + Point(std::cos(2 * numbers::PI / 6), + std::sin(2 * numbers::PI / 6), + 0) * 4.0, - Point( - std::cos(2 * numbers::PI / 6), std::sin(2 * numbers::PI / 6), 7) + - Point( - std::cos(2 * numbers::PI / 6), std::sin(2 * numbers::PI / 6), 0) * + Point(std::cos(2 * numbers::PI / 6), + std::sin(2 * numbers::PI / 6), + 7) + + Point(std::cos(2 * numbers::PI / 6), + std::sin(2 * numbers::PI / 6), + 0) * 4.0, - Point( - std::cos(4 * numbers::PI / 6), std::sin(4 * numbers::PI / 6), 7) + - Point( - std::cos(2 * numbers::PI / 6), std::sin(2 * numbers::PI / 6), 0) * + Point(std::cos(4 * numbers::PI / 6), + std::sin(4 * numbers::PI / 6), + 7) + + Point(std::cos(2 * numbers::PI / 6), + std::sin(2 * numbers::PI / 6), + 0) * 4.0, // points at the top of the @@ -107,20 +120,26 @@ test() std::sin(6 * numbers::PI / 6), 0) * 4.0, - Point( - std::cos(4 * numbers::PI / 6), std::sin(4 * numbers::PI / 6), 7) + - Point( - std::cos(6 * numbers::PI / 6), std::sin(6 * numbers::PI / 6), 0) * + Point(std::cos(4 * numbers::PI / 6), + std::sin(4 * numbers::PI / 6), + 7) + + Point(std::cos(6 * numbers::PI / 6), + std::sin(6 * numbers::PI / 6), + 0) * 4.0, - Point( - std::cos(6 * numbers::PI / 6), std::sin(6 * numbers::PI / 6), 7) + - Point( - std::cos(6 * numbers::PI / 6), std::sin(6 * numbers::PI / 6), 0) * + Point(std::cos(6 * numbers::PI / 6), + std::sin(6 * numbers::PI / 6), + 7) + + Point(std::cos(6 * numbers::PI / 6), + std::sin(6 * numbers::PI / 6), + 0) * 4.0, - Point( - std::cos(8 * numbers::PI / 6), std::sin(8 * numbers::PI / 6), 7) + - Point( - std::cos(6 * numbers::PI / 6), std::sin(6 * numbers::PI / 6), 0) * + Point(std::cos(8 * numbers::PI / 6), + std::sin(8 * numbers::PI / 6), + 7) + + Point(std::cos(6 * numbers::PI / 6), + std::sin(6 * numbers::PI / 6), + 0) * 4.0, // points at the top of the @@ -130,20 +149,26 @@ test() std::sin(10 * numbers::PI / 6), 0) * 4.0, - Point( - std::cos(8 * numbers::PI / 6), std::sin(8 * numbers::PI / 6), 7) + - Point( - std::cos(10 * numbers::PI / 6), std::sin(10 * numbers::PI / 6), 0) * + Point(std::cos(8 * numbers::PI / 6), + std::sin(8 * numbers::PI / 6), + 7) + + Point(std::cos(10 * numbers::PI / 6), + std::sin(10 * numbers::PI / 6), + 0) * 4.0, - Point( - std::cos(10 * numbers::PI / 6), std::sin(10 * numbers::PI / 6), 7) + - Point( - std::cos(10 * numbers::PI / 6), std::sin(10 * numbers::PI / 6), 0) * + Point(std::cos(10 * numbers::PI / 6), + std::sin(10 * numbers::PI / 6), + 7) + + Point(std::cos(10 * numbers::PI / 6), + std::sin(10 * numbers::PI / 6), + 0) * 4.0, - Point( - std::cos(0 * numbers::PI / 6), std::sin(0 * numbers::PI / 6), 7) + - Point( - std::cos(10 * numbers::PI / 6), std::sin(10 * numbers::PI / 6), 0) * + Point(std::cos(0 * numbers::PI / 6), + std::sin(0 * numbers::PI / 6), + 7) + + Point(std::cos(10 * numbers::PI / 6), + std::sin(10 * numbers::PI / 6), + 0) * 4.0, }; diff --git a/tests/numerics/no_flux_04.cc b/tests/numerics/no_flux_04.cc index d42b9d1299..65253b4540 100644 --- a/tests/numerics/no_flux_04.cc +++ b/tests/numerics/no_flux_04.cc @@ -49,7 +49,8 @@ template class RadialFunction : public Function { public: - RadialFunction() : Function(dim) + RadialFunction() + : Function(dim) {} virtual void @@ -112,8 +113,10 @@ test(const Triangulation &tr, const FiniteElement &fe) data_component_interpretation( dim, DataComponentInterpretation::component_is_part_of_vector); - data_out.add_data_vector( - v, "x", DataOut::type_dof_data, data_component_interpretation); + data_out.add_data_vector(v, + "x", + DataOut::type_dof_data, + data_component_interpretation); data_out.build_patches(fe.degree); data_out.write_vtk(deallog.get_file_stream()); diff --git a/tests/numerics/no_flux_10.cc b/tests/numerics/no_flux_10.cc index 09db4b02be..e2364c0216 100644 --- a/tests/numerics/no_flux_10.cc +++ b/tests/numerics/no_flux_10.cc @@ -184,8 +184,9 @@ void sixty_deg_hyper_shell(Triangulation<3> &tria, cells[i].material_id = 0; } - tria.create_triangulation( - vertices, cells, SubCellData()); // no boundary information + tria.create_triangulation(vertices, + cells, + SubCellData()); // no boundary information colorize_sixty_deg_hyper_shell(tria, center, inner_radius, outer_radius); } @@ -228,8 +229,10 @@ run() std::set 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); + VectorTools::compute_no_normal_flux_constraints(dof_handler, + 0, + no_normal_flux_boundaries, + constraints); constraints.print(deallog.get_file_stream()); diff --git a/tests/numerics/no_flux_11.cc b/tests/numerics/no_flux_11.cc index bd3c3db0a0..22af454ec4 100644 --- a/tests/numerics/no_flux_11.cc +++ b/tests/numerics/no_flux_11.cc @@ -143,8 +143,10 @@ run() ConstraintMatrix constraints; std::set no_normal_flux_boundaries; no_normal_flux_boundaries.insert(6); - VectorTools::compute_no_normal_flux_constraints( - dof_handler, 0, no_normal_flux_boundaries, constraints); + VectorTools::compute_no_normal_flux_constraints(dof_handler, + 0, + no_normal_flux_boundaries, + constraints); constraints.print(deallog.get_file_stream()); diff --git a/tests/numerics/no_flux_12.cc b/tests/numerics/no_flux_12.cc index b438429172..a2ef7a575f 100644 --- a/tests/numerics/no_flux_12.cc +++ b/tests/numerics/no_flux_12.cc @@ -100,8 +100,10 @@ run() no_normal_flux_boundaries.insert(0); // x=0 no_normal_flux_boundaries.insert(5); // z=1 - VectorTools::compute_no_normal_flux_constraints( - dof_handler, 0, no_normal_flux_boundaries, constraints); + VectorTools::compute_no_normal_flux_constraints(dof_handler, + 0, + no_normal_flux_boundaries, + constraints); constraints.print(deallog.get_file_stream()); diff --git a/tests/numerics/no_flux_13.cc b/tests/numerics/no_flux_13.cc index c8edfec001..d1e35b3eb4 100644 --- a/tests/numerics/no_flux_13.cc +++ b/tests/numerics/no_flux_13.cc @@ -53,8 +53,10 @@ test() deal_II_exceptions::disable_abort_on_exception(); try { - VectorTools::compute_no_normal_flux_constraints( - dof_handler, 0, no_normal_flux_boundaries, constraints); + VectorTools::compute_no_normal_flux_constraints(dof_handler, + 0, + no_normal_flux_boundaries, + constraints); } catch (ExceptionBase &e) { diff --git a/tests/numerics/no_flux_hp_04.cc b/tests/numerics/no_flux_hp_04.cc index 9d5db4515f..7c3038824c 100644 --- a/tests/numerics/no_flux_hp_04.cc +++ b/tests/numerics/no_flux_hp_04.cc @@ -42,7 +42,8 @@ template class RadialFunction : public Function { public: - RadialFunction() : Function(dim) + RadialFunction() + : Function(dim) {} virtual void diff --git a/tests/numerics/normal_flux_inhom_01.cc b/tests/numerics/normal_flux_inhom_01.cc index 6640ae2167..65343ee711 100644 --- a/tests/numerics/normal_flux_inhom_01.cc +++ b/tests/numerics/normal_flux_inhom_01.cc @@ -71,8 +71,9 @@ test(const Triangulation &tr, const FiniteElement &fe) const std::vector> & unit_support_points = fe.get_unit_face_support_points(); Quadrature quadrature(unit_support_points); - FEFaceValues fe_face_values( - fe, quadrature, update_quadrature_points); + FEFaceValues fe_face_values(fe, + quadrature, + update_quadrature_points); typename DoFHandler::active_cell_iterator cell = dof.begin_active(), endc = dof.end(); for (; cell != endc; ++cell) diff --git a/tests/numerics/point_value_history_01.cc b/tests/numerics/point_value_history_01.cc index c19cd410be..a73cd94153 100644 --- a/tests/numerics/point_value_history_01.cc +++ b/tests/numerics/point_value_history_01.cc @@ -68,8 +68,9 @@ private: template -TestPointValueHistory::TestPointValueHistory() : - finite_element(FE_Q(1 + 1), dim, FE_Q(1), 1), +TestPointValueHistory::TestPointValueHistory() + : finite_element(FE_Q(1 + 1), dim, FE_Q(1), 1) + , dof_handler(triangulation) {} diff --git a/tests/numerics/point_value_history_02.cc b/tests/numerics/point_value_history_02.cc index 4adc60ec6e..da36b44024 100644 --- a/tests/numerics/point_value_history_02.cc +++ b/tests/numerics/point_value_history_02.cc @@ -147,8 +147,9 @@ private: template -TestPointValueHistory::TestPointValueHistory() : - finite_element(FE_Q(1 + 1), dim, FE_Q(1), 1), +TestPointValueHistory::TestPointValueHistory() + : finite_element(FE_Q(1 + 1), dim, FE_Q(1), 1) + , dof_handler(triangulation) {} @@ -353,8 +354,10 @@ TestPointValueHistory::run() std::vector names; names.emplace_back("Vector_out"); names.emplace_back("Scalar_out"); - node_monitor.evaluate_field( - names, solution, postprocessor, postprocess_quadrature); + node_monitor.evaluate_field(names, + solution, + postprocessor, + postprocess_quadrature); // output_results (step, solution); step++; diff --git a/tests/numerics/point_value_history_03.cc b/tests/numerics/point_value_history_03.cc index f094887208..05c52ff59b 100644 --- a/tests/numerics/point_value_history_03.cc +++ b/tests/numerics/point_value_history_03.cc @@ -139,9 +139,9 @@ private: template -TestPointValueHistory::TestPointValueHistory() : - finite_element(2), - dof_handler(triangulation) +TestPointValueHistory::TestPointValueHistory() + : finite_element(2) + , dof_handler(triangulation) {} @@ -312,8 +312,10 @@ TestPointValueHistory::run() std::vector names; names.push_back("X_gradient"); names.push_back("X_hessian"); - node_monitor.evaluate_field( - names, solution, postprocessor, postprocess_quadrature); + node_monitor.evaluate_field(names, + solution, + postprocessor, + postprocess_quadrature); // output_results (step, solution); step++; diff --git a/tests/numerics/project_boundary_01.cc b/tests/numerics/project_boundary_01.cc index 7943b601bb..89b40d47e3 100644 --- a/tests/numerics/project_boundary_01.cc +++ b/tests/numerics/project_boundary_01.cc @@ -49,9 +49,9 @@ template class MySquareFunction : public Function { public: - MySquareFunction(const unsigned int n_components) : - Function(n_components), - scaling(1) + MySquareFunction(const unsigned int n_components) + : Function(n_components) + , scaling(1) {} void diff --git a/tests/numerics/project_boundary_rt_01.cc b/tests/numerics/project_boundary_rt_01.cc index 8e6e604b02..fdcc835670 100644 --- a/tests/numerics/project_boundary_rt_01.cc +++ b/tests/numerics/project_boundary_rt_01.cc @@ -54,7 +54,9 @@ private: template -TestFunction::TestFunction(unsigned int p) : Function(dim), degree(p) +TestFunction::TestFunction(unsigned int p) + : Function(dim) + , degree(p) {} diff --git a/tests/numerics/project_bv_curl_conf.cc b/tests/numerics/project_bv_curl_conf.cc index c8bf55b344..721f2e474d 100644 --- a/tests/numerics/project_bv_curl_conf.cc +++ b/tests/numerics/project_bv_curl_conf.cc @@ -40,7 +40,8 @@ public: }; template -BoundaryFunction::BoundaryFunction() : Function(dim) +BoundaryFunction::BoundaryFunction() + : Function(dim) {} template diff --git a/tests/numerics/project_bv_curl_conf_02.cc b/tests/numerics/project_bv_curl_conf_02.cc index f59dcec332..504f5eff45 100644 --- a/tests/numerics/project_bv_curl_conf_02.cc +++ b/tests/numerics/project_bv_curl_conf_02.cc @@ -46,7 +46,8 @@ public: }; template -BoundaryFunction::BoundaryFunction() : Function(dim) +BoundaryFunction::BoundaryFunction() + : Function(dim) {} template diff --git a/tests/numerics/project_bv_div_conf.cc b/tests/numerics/project_bv_div_conf.cc index a7c3ae4004..f92654cdc6 100644 --- a/tests/numerics/project_bv_div_conf.cc +++ b/tests/numerics/project_bv_div_conf.cc @@ -40,7 +40,8 @@ public: }; template -BoundaryFunction::BoundaryFunction() : Function(dim) +BoundaryFunction::BoundaryFunction() + : Function(dim) {} template diff --git a/tests/numerics/project_common.h b/tests/numerics/project_common.h index 407e84f896..ee8c20fb81 100644 --- a/tests/numerics/project_common.h +++ b/tests/numerics/project_common.h @@ -63,9 +63,9 @@ template class F : public Function { public: - F(const unsigned int q, const unsigned int n_components) : - Function(n_components), - q(q) + F(const unsigned int q, const unsigned int n_components) + : Function(n_components) + , q(q) {} virtual double diff --git a/tests/numerics/project_parallel_common.h b/tests/numerics/project_parallel_common.h index 8ffed933d2..0e44d8881c 100644 --- a/tests/numerics/project_parallel_common.h +++ b/tests/numerics/project_parallel_common.h @@ -66,9 +66,9 @@ template class F : public Function { public: - F(const unsigned int q, const unsigned int n_components) : - Function(n_components), - q(q) + F(const unsigned int q, const unsigned int n_components) + : Function(n_components) + , q(q) {} virtual double @@ -122,8 +122,9 @@ do_project(const parallel::distributed::Triangulation &triangulation, DoFTools::make_hanging_node_constraints(dof_handler, constraints); constraints.close(); - LinearAlgebra::distributed::Vector projection( - locally_owned_dofs, locally_relevant_dofs, mpi_communicator); + LinearAlgebra::distributed::Vector projection(locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); Vector error(triangulation.n_active_cells()); for (unsigned int q = 0; q <= p + 2 - order_difference; ++q) { @@ -228,8 +229,9 @@ test_with_wrong_face_orientation(const FiniteElement &fe, cell->set_refine_flag(); triangulation.execute_coarsening_and_refinement(); - do_project( - triangulation, fe, order_difference); + do_project(triangulation, + fe, + order_difference); } } @@ -349,8 +351,9 @@ test_with_2d_deformed_refined_mesh(const FiniteElement &fe, } triangulation.execute_coarsening_and_refinement(); - do_project( - triangulation, fe, order_difference); + do_project(triangulation, + fe, + order_difference); } } diff --git a/tests/numerics/project_parallel_qp_common.h b/tests/numerics/project_parallel_qp_common.h index 16e530b478..0fe22b369f 100644 --- a/tests/numerics/project_parallel_qp_common.h +++ b/tests/numerics/project_parallel_qp_common.h @@ -57,9 +57,9 @@ template class F : public Function { public: - F(const unsigned int q, const unsigned int n_components) : - Function(n_components), - q(q) + F(const unsigned int q, const unsigned int n_components) + : Function(n_components) + , q(q) {} virtual double @@ -132,8 +132,9 @@ do_project(const parallel::distributed::Triangulation &triangulation, QData> qp_manager; { - FEValues fe_values( - fe, quadrature_formula, update_quadrature_points); + FEValues fe_values(fe, + quadrature_formula, + update_quadrature_points); const unsigned int n_q_points = quadrature_formula.size(); diff --git a/tests/numerics/project_parallel_qpmf_common.h b/tests/numerics/project_parallel_qpmf_common.h index f7d1b84986..0af4ca44bc 100644 --- a/tests/numerics/project_parallel_qpmf_common.h +++ b/tests/numerics/project_parallel_qpmf_common.h @@ -59,9 +59,9 @@ template class F : public Function { public: - F(const unsigned int q, const unsigned int n_components) : - Function(n_components), - q(q) + F(const unsigned int q, const unsigned int n_components) + : Function(n_components) + , q(q) {} virtual double @@ -145,8 +145,10 @@ do_project(const parallel::distributed::Triangulation &triangulation, additional_data.mapping_update_flags = update_values | update_JxW_values | update_quadrature_points; std::shared_ptr> data(new MatrixFree()); - data->reinit( - dof_handlers_mf, constraints_mf, quadrature_formula_1d, additional_data); + data->reinit(dof_handlers_mf, + constraints_mf, + quadrature_formula_1d, + additional_data); for (unsigned int q = 0; q <= p; ++q) { diff --git a/tests/numerics/project_to_surface_01.cc b/tests/numerics/project_to_surface_01.cc index bcb207c6dd..e8037bc80a 100644 --- a/tests/numerics/project_to_surface_01.cc +++ b/tests/numerics/project_to_surface_01.cc @@ -34,7 +34,8 @@ class Rotate2d { public: - Rotate2d(const double angle) : angle(angle) + Rotate2d(const double angle) + : angle(angle) {} template diff --git a/tests/numerics/project_to_surface_02.cc b/tests/numerics/project_to_surface_02.cc index 2ca82c2c4c..cfdb688d05 100644 --- a/tests/numerics/project_to_surface_02.cc +++ b/tests/numerics/project_to_surface_02.cc @@ -34,7 +34,8 @@ class Rotate2d { public: - Rotate2d(const double angle) : angle(angle) + Rotate2d(const double angle) + : angle(angle) {} template diff --git a/tests/numerics/subtract_mean_value_02.cc b/tests/numerics/subtract_mean_value_02.cc index b4de367c0b..8d889bffa6 100644 --- a/tests/numerics/subtract_mean_value_02.cc +++ b/tests/numerics/subtract_mean_value_02.cc @@ -61,14 +61,16 @@ main(int argc, char *argv[]) IndexSet ghost_indices(10); ghost_indices.add_range(3, 8); { - LinearAlgebra::distributed::Vector v( - local_range, ghost_indices, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_range, + ghost_indices, + MPI_COMM_WORLD); test(v); } { - LinearAlgebra::distributed::Vector v( - local_range, ghost_indices, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector v(local_range, + ghost_indices, + MPI_COMM_WORLD); test(v); } diff --git a/tests/numerics/tangential_flux_inhom_01.cc b/tests/numerics/tangential_flux_inhom_01.cc index 37ae53b9dd..b3f3431f9d 100644 --- a/tests/numerics/tangential_flux_inhom_01.cc +++ b/tests/numerics/tangential_flux_inhom_01.cc @@ -72,8 +72,9 @@ test(const Triangulation &tr, const FiniteElement &fe) const std::vector> & unit_support_points = fe.get_unit_face_support_points(); Quadrature quadrature(unit_support_points); - FEFaceValues fe_face_values( - fe, quadrature, update_quadrature_points); + FEFaceValues fe_face_values(fe, + quadrature, + update_quadrature_points); typename DoFHandler::active_cell_iterator cell = dof.begin_active(), endc = dof.end(); for (; cell != endc; ++cell) diff --git a/tests/numerics/time_dependent_01.cc b/tests/numerics/time_dependent_01.cc index ad6821df29..cda24b876e 100644 --- a/tests/numerics/time_dependent_01.cc +++ b/tests/numerics/time_dependent_01.cc @@ -34,9 +34,9 @@ std::vector end_sweep_flags; class TimeStep : public TimeStepBase { public: - TimeStep(const unsigned int time_step_number) : - TimeStepBase(0), - time_step_number(time_step_number) + TimeStep(const unsigned int time_step_number) + : TimeStepBase(0) + , time_step_number(time_step_number) {} virtual void diff --git a/tests/numerics/vectors_boundary_rhs_01.cc b/tests/numerics/vectors_boundary_rhs_01.cc index 5ba4776d55..d40f76d390 100644 --- a/tests/numerics/vectors_boundary_rhs_01.cc +++ b/tests/numerics/vectors_boundary_rhs_01.cc @@ -51,7 +51,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(2) + MySquareFunction() + : Function(2) {} virtual double @@ -102,8 +103,10 @@ check() QGauss quadrature(3); Vector rhs(dof.n_dofs()); - VectorTools::create_boundary_right_hand_side( - dof, quadrature, MySquareFunction(), rhs); + VectorTools::create_boundary_right_hand_side(dof, + quadrature, + MySquareFunction(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/numerics/vectors_boundary_rhs_02.cc b/tests/numerics/vectors_boundary_rhs_02.cc index a9079a5527..6c59c92b2a 100644 --- a/tests/numerics/vectors_boundary_rhs_02.cc +++ b/tests/numerics/vectors_boundary_rhs_02.cc @@ -52,7 +52,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(dim) + MySquareFunction() + : Function(dim) {} virtual double @@ -104,8 +105,10 @@ check() QGauss quadrature(3); Vector rhs(dof.n_dofs()); - VectorTools::create_boundary_right_hand_side( - dof, quadrature, MySquareFunction(), rhs); + VectorTools::create_boundary_right_hand_side(dof, + quadrature, + MySquareFunction(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/numerics/vectors_boundary_rhs_03.cc b/tests/numerics/vectors_boundary_rhs_03.cc index d30247cc14..cd7ff6a0c7 100644 --- a/tests/numerics/vectors_boundary_rhs_03.cc +++ b/tests/numerics/vectors_boundary_rhs_03.cc @@ -52,7 +52,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(1) + MySquareFunction() + : Function(1) {} virtual double @@ -103,8 +104,10 @@ check() QGauss quadrature(3); Vector rhs(dof.n_dofs()); - VectorTools::create_boundary_right_hand_side( - dof, quadrature, MySquareFunction(), rhs); + VectorTools::create_boundary_right_hand_side(dof, + quadrature, + MySquareFunction(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/numerics/vectors_point_source_01.cc b/tests/numerics/vectors_point_source_01.cc index 11ef24624c..e044023015 100644 --- a/tests/numerics/vectors_point_source_01.cc +++ b/tests/numerics/vectors_point_source_01.cc @@ -52,7 +52,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(1) + MySquareFunction() + : Function(1) {} virtual double diff --git a/tests/numerics/vectors_rhs_01.cc b/tests/numerics/vectors_rhs_01.cc index de8423c4e5..0a695147fd 100644 --- a/tests/numerics/vectors_rhs_01.cc +++ b/tests/numerics/vectors_rhs_01.cc @@ -51,7 +51,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(2) + MySquareFunction() + : Function(2) {} virtual double @@ -103,8 +104,10 @@ check() QGauss quadrature(3); Vector rhs(dof.n_dofs()); - VectorTools::create_right_hand_side( - dof, quadrature, MySquareFunction(), rhs); + VectorTools::create_right_hand_side(dof, + quadrature, + MySquareFunction(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/numerics/vectors_rhs_03.cc b/tests/numerics/vectors_rhs_03.cc index 9f901edd80..d0199bebc1 100644 --- a/tests/numerics/vectors_rhs_03.cc +++ b/tests/numerics/vectors_rhs_03.cc @@ -52,7 +52,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(1) + MySquareFunction() + : Function(1) {} virtual double @@ -103,8 +104,10 @@ check() QGauss quadrature(3); Vector rhs(dof.n_dofs()); - VectorTools::create_right_hand_side( - dof, quadrature, MySquareFunction(), rhs); + VectorTools::create_right_hand_side(dof, + quadrature, + MySquareFunction(), + rhs); for (unsigned int i = 0; i < rhs.size(); ++i) deallog << rhs(i) << std::endl; } diff --git a/tests/opencascade/create_tria_02.cc b/tests/opencascade/create_tria_02.cc index 3ec1f1c5a0..f631510914 100644 --- a/tests/opencascade/create_tria_02.cc +++ b/tests/opencascade/create_tria_02.cc @@ -41,8 +41,9 @@ main() ps.push_back(Point<2>(0, 2)); auto edge = interpolation_curve(ps); - BRepPrimAPI_MakeRevol revol( - edge, gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), -numbers::PI / 2); + BRepPrimAPI_MakeRevol revol(edge, + gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), + -numbers::PI / 2); revol.Build(); auto sh = revol.Shape(); diff --git a/tests/opencascade/normal_to_mesh_projection_03.cc b/tests/opencascade/normal_to_mesh_projection_03.cc index 941b696d5b..275039410e 100644 --- a/tests/opencascade/normal_to_mesh_projection_03.cc +++ b/tests/opencascade/normal_to_mesh_projection_03.cc @@ -100,8 +100,9 @@ main() DoFHandler<2, 3> dh(tria); dh.distribute_dofs(fe); std::vector> spoints(dh.n_dofs()); - DoFTools::map_dofs_to_support_points( - StaticMappingQ1<2, 3>::mapping, dh, spoints); + DoFTools::map_dofs_to_support_points(StaticMappingQ1<2, 3>::mapping, + dh, + spoints); std::sort(spoints.begin(), spoints.end(), diff --git a/tests/parameter_handler/parameter_acceptor_04.cc b/tests/parameter_handler/parameter_acceptor_04.cc index 1ac11d12a5..7d21218a76 100644 --- a/tests/parameter_handler/parameter_acceptor_04.cc +++ b/tests/parameter_handler/parameter_acceptor_04.cc @@ -24,7 +24,8 @@ class FirstClass : public ParameterAcceptor { public: - FirstClass(const std::string &name = "First Class") : ParameterAcceptor(name) + FirstClass(const std::string &name = "First Class") + : ParameterAcceptor(name) { add_parameter("First int", f_i); add_parameter("First double", f_d); @@ -42,8 +43,8 @@ private: class SecondClass : public ParameterAcceptor { public: - SecondClass(const std::string &name = "Second Class") : - ParameterAcceptor(name) + SecondClass(const std::string &name = "Second Class") + : ParameterAcceptor(name) { add_parameter("Second int", s_i); add_parameter("Second double", s_d); diff --git a/tests/parameter_handler/parameter_acceptor_05.cc b/tests/parameter_handler/parameter_acceptor_05.cc index 704e819128..806c4b3c5e 100644 --- a/tests/parameter_handler/parameter_acceptor_05.cc +++ b/tests/parameter_handler/parameter_acceptor_05.cc @@ -24,7 +24,8 @@ class FirstClass : public ParameterAcceptor { public: - FirstClass(const std::string &name = "First Class") : ParameterAcceptor(name) + FirstClass(const std::string &name = "First Class") + : ParameterAcceptor(name) { add_parameter("First int", f_i); add_parameter("First double", f_d); @@ -42,8 +43,8 @@ private: class SecondClass : public ParameterAcceptor { public: - SecondClass(const std::string &name = "Second Class") : - ParameterAcceptor(name) + SecondClass(const std::string &name = "Second Class") + : ParameterAcceptor(name) { add_parameter("Second int", s_i); add_parameter("Second double", s_d); diff --git a/tests/parameter_handler/parameter_acceptor_06.cc b/tests/parameter_handler/parameter_acceptor_06.cc index 9dc8167172..caec45d383 100644 --- a/tests/parameter_handler/parameter_acceptor_06.cc +++ b/tests/parameter_handler/parameter_acceptor_06.cc @@ -24,7 +24,8 @@ class FirstClass : public ParameterAcceptor { public: - FirstClass(const std::string &name = "First Class") : ParameterAcceptor(name) + FirstClass(const std::string &name = "First Class") + : ParameterAcceptor(name) { add_parameter("First int", f_i); add_parameter("First double", f_d); @@ -42,8 +43,8 @@ private: class SecondClass : public ParameterAcceptor { public: - SecondClass(const std::string &name = "Second Class") : - ParameterAcceptor(name) + SecondClass(const std::string &name = "Second Class") + : ParameterAcceptor(name) { add_parameter("Second int", s_i); add_parameter("Second double", s_d); diff --git a/tests/parameter_handler/parameter_acceptor_07.cc b/tests/parameter_handler/parameter_acceptor_07.cc index af8667fb3d..f6ba4c9d2a 100644 --- a/tests/parameter_handler/parameter_acceptor_07.cc +++ b/tests/parameter_handler/parameter_acceptor_07.cc @@ -24,7 +24,8 @@ class FirstClass : public ParameterAcceptor { public: - FirstClass(const std::string &name = "First Class") : ParameterAcceptor(name) + FirstClass(const std::string &name = "First Class") + : ParameterAcceptor(name) { add_parameter("First int", f_i); add_parameter("First double", f_d); @@ -42,8 +43,8 @@ private: class SecondClass : public ParameterAcceptor { public: - SecondClass(const std::string &name = "Second Class") : - ParameterAcceptor(name) + SecondClass(const std::string &name = "Second Class") + : ParameterAcceptor(name) { add_parameter("Second int", s_i); add_parameter("Second double", s_d); diff --git a/tests/parameter_handler/parameter_acceptor_08.cc b/tests/parameter_handler/parameter_acceptor_08.cc index 8a314dfa1e..75621078fb 100644 --- a/tests/parameter_handler/parameter_acceptor_08.cc +++ b/tests/parameter_handler/parameter_acceptor_08.cc @@ -27,10 +27,10 @@ class Test : public ParameterAcceptor public: Test(const std::string &sec_name = "First Class", const std::string &par_name = "Parameter name", - const std::string &par_value = "Parameter value") : - ParameterAcceptor(sec_name), - par_name(par_name), - par_value(par_value) + const std::string &par_value = "Parameter value") + : ParameterAcceptor(sec_name) + , par_name(par_name) + , par_value(par_value) { add_parameter(par_name, this->par_value); diff --git a/tests/parameter_handler/parameter_handler_1.cc b/tests/parameter_handler/parameter_handler_1.cc index eb0c90f73b..b75beaef2d 100644 --- a/tests/parameter_handler/parameter_handler_1.cc +++ b/tests/parameter_handler/parameter_handler_1.cc @@ -25,8 +25,9 @@ void check(const char *p) { ParameterHandler prm; - prm.declare_entry( - "test_1", "-1,0", Patterns::List(Patterns::Integer(-1, 1), 2, 3)); + prm.declare_entry("test_1", + "-1,0", + Patterns::List(Patterns::Integer(-1, 1), 2, 3)); std::ifstream in(p); prm.parse_input(in); diff --git a/tests/parameter_handler/parameter_handler_13.cc b/tests/parameter_handler/parameter_handler_13.cc index 620b450b23..4c3fe0d101 100644 --- a/tests/parameter_handler/parameter_handler_13.cc +++ b/tests/parameter_handler/parameter_handler_13.cc @@ -25,11 +25,12 @@ 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)); + prm.declare_entry("test_13", + "-1:a, 0:b, 1:c", + Patterns::Map(Patterns::Integer(-1, 1), + Patterns::Selection("a|b|c"), + 2, + 3)); std::ifstream in(p); prm.parse_input(in); diff --git a/tests/parameter_handler/parameter_handler_13a.cc b/tests/parameter_handler/parameter_handler_13a.cc index 0bc5c12261..575843dd9a 100644 --- a/tests/parameter_handler/parameter_handler_13a.cc +++ b/tests/parameter_handler/parameter_handler_13a.cc @@ -25,11 +25,13 @@ void check(const char *p) { ParameterHandler prm; - prm.declare_entry( - "test_13", - "-1:a xyz 0:b xyz 1:c", - Patterns::Map( - Patterns::Integer(-1, 1), Patterns::Selection("a|b|c"), 2, 3, "xyz")); + prm.declare_entry("test_13", + "-1:a xyz 0:b xyz 1:c", + Patterns::Map(Patterns::Integer(-1, 1), + Patterns::Selection("a|b|c"), + 2, + 3, + "xyz")); std::ifstream in(p); prm.parse_input(in); diff --git a/tests/parameter_handler/parameter_handler_1_exception.cc b/tests/parameter_handler/parameter_handler_1_exception.cc index 9c5cbbcb88..30eceea727 100644 --- a/tests/parameter_handler/parameter_handler_1_exception.cc +++ b/tests/parameter_handler/parameter_handler_1_exception.cc @@ -29,8 +29,9 @@ check(const char *p) ParameterHandler prm; try { - prm.declare_entry( - "test_1", "abc", Patterns::List(Patterns::Integer(-1, 1), 2, 3)); + prm.declare_entry("test_1", + "abc", + Patterns::List(Patterns::Integer(-1, 1), 2, 3)); } catch (const ParameterHandler::ExcValueDoesNotMatchPattern &) { diff --git a/tests/parameter_handler/parameter_handler_1_include.cc b/tests/parameter_handler/parameter_handler_1_include.cc index 597cac06fc..4d73d0a7b2 100644 --- a/tests/parameter_handler/parameter_handler_1_include.cc +++ b/tests/parameter_handler/parameter_handler_1_include.cc @@ -25,8 +25,9 @@ void check(const char *p) { ParameterHandler prm; - prm.declare_entry( - "test_1", "-1,0", Patterns::List(Patterns::Integer(-1, 1), 2, 3)); + prm.declare_entry("test_1", + "-1,0", + Patterns::List(Patterns::Integer(-1, 1), 2, 3)); std::ifstream in(p); prm.parse_input(in); diff --git a/tests/parameter_handler/parameter_handler_1_include_fail.cc b/tests/parameter_handler/parameter_handler_1_include_fail.cc index 0950bff03b..d316a04ee7 100644 --- a/tests/parameter_handler/parameter_handler_1_include_fail.cc +++ b/tests/parameter_handler/parameter_handler_1_include_fail.cc @@ -26,8 +26,9 @@ void check(const char *p) { ParameterHandler prm; - prm.declare_entry( - "test_1", "-1,0", Patterns::List(Patterns::Integer(-1, 1), 2, 3)); + prm.declare_entry("test_1", + "-1,0", + Patterns::List(Patterns::Integer(-1, 1), 2, 3)); std::ifstream in(p); try diff --git a/tests/parameter_handler/parameter_handler_2.cc b/tests/parameter_handler/parameter_handler_2.cc index a6e500700b..afa0fea34a 100644 --- a/tests/parameter_handler/parameter_handler_2.cc +++ b/tests/parameter_handler/parameter_handler_2.cc @@ -30,8 +30,9 @@ main() ParameterHandler prm; prm.enter_subsection("Testing"); - prm.declare_entry( - "Function", "a", Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h"))); + prm.declare_entry("Function", + "a", + Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h"))); prm.leave_subsection(); prm.parse_input(SOURCE_DIR "/prm/parameter_handler_2.prm"); diff --git a/tests/parameter_handler/parameter_handler_21.cc b/tests/parameter_handler/parameter_handler_21.cc index 5a8d0d1d5f..be46ce2da1 100644 --- a/tests/parameter_handler/parameter_handler_21.cc +++ b/tests/parameter_handler/parameter_handler_21.cc @@ -49,17 +49,20 @@ test() check("", "bla|bla 2|1", "set v=bla,bla,bla"); check("default,alsodefault", "default|nodefault|alsodefault", ""); - check( - "default,alsodefault", "default|nodefault|alsodefault", "set v=nodefault"); + check("default,alsodefault", + "default|nodefault|alsodefault", + "set v=nodefault"); check(" input 2 , have spaces ", "have spaces|input 2", ""); // check correct handling of space in input, default, and values: - check( - "input 2", "have spaces|input 2", "set v= input 2 , have spaces "); + check("input 2", + "have spaces|input 2", + "set v= input 2 , have spaces "); - check( - "", "double spaces|input 2", "set v = double spaces , double spaces"); + check("", + "double spaces|input 2", + "set v = double spaces , double spaces"); } diff --git a/tests/parameter_handler/parameter_handler_2_read_from_string.cc b/tests/parameter_handler/parameter_handler_2_read_from_string.cc index f36c80c9db..166fb5eae4 100644 --- a/tests/parameter_handler/parameter_handler_2_read_from_string.cc +++ b/tests/parameter_handler/parameter_handler_2_read_from_string.cc @@ -29,8 +29,9 @@ main() ParameterHandler prm; prm.enter_subsection("Testing"); - prm.declare_entry( - "Function", "a", Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h"))); + prm.declare_entry("Function", + "a", + Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h"))); prm.leave_subsection(); std::string input; diff --git a/tests/parameter_handler/parameter_handler_4a.cc b/tests/parameter_handler/parameter_handler_4a.cc index 99fe0f2491..980c4a4d74 100644 --- a/tests/parameter_handler/parameter_handler_4a.cc +++ b/tests/parameter_handler/parameter_handler_4a.cc @@ -37,22 +37,24 @@ main() { 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("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.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("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"); } diff --git a/tests/parameter_handler/parameter_handler_4a_with_alias.cc b/tests/parameter_handler/parameter_handler_4a_with_alias.cc index ef13bff0f5..7187bb3bd1 100644 --- a/tests/parameter_handler/parameter_handler_4a_with_alias.cc +++ b/tests/parameter_handler/parameter_handler_4a_with_alias.cc @@ -37,22 +37,24 @@ main() { 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("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.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("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_alias("int", "int_alias"); prm.declare_entry("double", "3.1415926", Patterns::Double(), "docs 3"); diff --git a/tests/parameter_handler/parameter_handler_4a_with_alias_deprecated.cc b/tests/parameter_handler/parameter_handler_4a_with_alias_deprecated.cc index 2c9d1ab831..caa4909e16 100644 --- a/tests/parameter_handler/parameter_handler_4a_with_alias_deprecated.cc +++ b/tests/parameter_handler/parameter_handler_4a_with_alias_deprecated.cc @@ -37,22 +37,24 @@ main() { 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("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.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("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_alias("int", "int_alias"); prm.declare_entry("double", "3.1415926", Patterns::Double(), "docs 3"); diff --git a/tests/parameter_handler/parameter_handler_8.cc b/tests/parameter_handler/parameter_handler_8.cc index 28e84b4525..7c71edb1b8 100644 --- a/tests/parameter_handler/parameter_handler_8.cc +++ b/tests/parameter_handler/parameter_handler_8.cc @@ -35,25 +35,29 @@ 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("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("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("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.declare_entry("double+double", + "6.1415926", + Patterns::Double(), + "docs 3"); } prm.leave_subsection(); } diff --git a/tests/parameter_handler/parameter_handler_9.cc b/tests/parameter_handler/parameter_handler_9.cc index b4da787201..e69ac4936b 100644 --- a/tests/parameter_handler/parameter_handler_9.cc +++ b/tests/parameter_handler/parameter_handler_9.cc @@ -32,25 +32,29 @@ 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("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("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("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.declare_entry("double+double", + "6.1415926", + Patterns::Double(), + "docs 3"); } prm.leave_subsection(); } diff --git a/tests/parameter_handler/parameter_handler_action_01.cc b/tests/parameter_handler/parameter_handler_action_01.cc index 1e2b745835..8abd45c024 100644 --- a/tests/parameter_handler/parameter_handler_action_01.cc +++ b/tests/parameter_handler/parameter_handler_action_01.cc @@ -29,8 +29,9 @@ check(const char *p) std::string parameter_set_by_action; ParameterHandler prm; - prm.declare_entry( - "test_1", "-1,0", Patterns::List(Patterns::Integer(-1, 1), 2, 3)); + prm.declare_entry("test_1", + "-1,0", + Patterns::List(Patterns::Integer(-1, 1), 2, 3)); prm.add_action("test_1", [&](const std::string &s) { deallog << "In action:" << s << std::endl; parameter_set_by_action = s; diff --git a/tests/parameter_handler/parameter_handler_action_02.cc b/tests/parameter_handler/parameter_handler_action_02.cc index 58b67e5dca..2dfc6c8ea7 100644 --- a/tests/parameter_handler/parameter_handler_action_02.cc +++ b/tests/parameter_handler/parameter_handler_action_02.cc @@ -30,8 +30,9 @@ check(const char *p) std::string parameter_set_by_action; ParameterHandler prm; - prm.declare_entry( - "test_1", "-1,0", Patterns::List(Patterns::Integer(-1, 1), 2, 3)); + prm.declare_entry("test_1", + "-1,0", + Patterns::List(Patterns::Integer(-1, 1), 2, 3)); prm.add_action("test_1", [&](const std::string &s) { deallog << "In action 1:" << s << std::endl; parameter_set_by_action = s; diff --git a/tests/parameter_handler/parameter_handler_backslash_05.cc b/tests/parameter_handler/parameter_handler_backslash_05.cc index 2c60e3f855..9a3403e7ac 100644 --- a/tests/parameter_handler/parameter_handler_backslash_05.cc +++ b/tests/parameter_handler/parameter_handler_backslash_05.cc @@ -39,10 +39,12 @@ main() { ParameterHandler prm; prm.enter_subsection("Testing"); - prm.declare_entry( - "Function_1", "a", Patterns::List(Patterns::Selection("a|b|c"))); - prm.declare_entry( - "Function_2", "d", Patterns::List(Patterns::Selection("d|e|f"))); + prm.declare_entry("Function_1", + "a", + Patterns::List(Patterns::Selection("a|b|c"))); + prm.declare_entry("Function_2", + "d", + Patterns::List(Patterns::Selection("d|e|f"))); prm.leave_subsection(); diff --git a/tests/parameter_handler/parameter_handler_read_json.cc b/tests/parameter_handler/parameter_handler_read_json.cc index e9f2f95565..edacf84085 100644 --- a/tests/parameter_handler/parameter_handler_read_json.cc +++ b/tests/parameter_handler/parameter_handler_read_json.cc @@ -46,11 +46,15 @@ main() // things with strange characters prm.enter_subsection("Testing%testing"); { - prm.declare_entry( - "string&list", "< & > ; /", Patterns::Anything(), "docs 1"); + prm.declare_entry("string&list", + "< & > ; /", + Patterns::Anything(), + "docs 1"); prm.declare_entry("int*int", "2", Patterns::Integer()); - prm.declare_entry( - "double+double", "6.1415926", Patterns::Double(), "docs 3"); + prm.declare_entry("double+double", + "6.1415926", + Patterns::Double(), + "docs 3"); } prm.leave_subsection(); diff --git a/tests/parameter_handler/parameter_handler_read_xml.cc b/tests/parameter_handler/parameter_handler_read_xml.cc index 3bda5ab2f0..1af84a29f4 100644 --- a/tests/parameter_handler/parameter_handler_read_xml.cc +++ b/tests/parameter_handler/parameter_handler_read_xml.cc @@ -46,11 +46,15 @@ main() // things with strange characters prm.enter_subsection("Testing%testing"); { - prm.declare_entry( - "string&list", "< & > ; /", Patterns::Anything(), "docs 1"); + prm.declare_entry("string&list", + "< & > ; /", + Patterns::Anything(), + "docs 1"); prm.declare_entry("int*int", "2", Patterns::Integer()); - prm.declare_entry( - "double+double", "6.1415926", Patterns::Double(), "docs 3"); + prm.declare_entry("double+double", + "6.1415926", + Patterns::Double(), + "docs 3"); } prm.leave_subsection(); diff --git a/tests/parameter_handler/parameter_handler_read_xml_error_01.cc b/tests/parameter_handler/parameter_handler_read_xml_error_01.cc index c991384557..89c1f46b9d 100644 --- a/tests/parameter_handler/parameter_handler_read_xml_error_01.cc +++ b/tests/parameter_handler/parameter_handler_read_xml_error_01.cc @@ -46,11 +46,15 @@ main() // things with strange characters prm.enter_subsection("Testing%testing"); { - prm.declare_entry( - "string&list", "< & > ; /", Patterns::Anything(), "docs 1"); + prm.declare_entry("string&list", + "< & > ; /", + Patterns::Anything(), + "docs 1"); prm.declare_entry("int*int", "2", Patterns::Integer()); - prm.declare_entry( - "double+double", "6.1415926", Patterns::Double(), "docs 3"); + prm.declare_entry("double+double", + "6.1415926", + Patterns::Double(), + "docs 3"); } prm.leave_subsection(); diff --git a/tests/parameter_handler/parameter_handler_read_xml_error_02.cc b/tests/parameter_handler/parameter_handler_read_xml_error_02.cc index 1d85fc86f3..8716a597e1 100644 --- a/tests/parameter_handler/parameter_handler_read_xml_error_02.cc +++ b/tests/parameter_handler/parameter_handler_read_xml_error_02.cc @@ -46,11 +46,15 @@ main() // things with strange characters prm.enter_subsection("Testing%testing"); { - prm.declare_entry( - "string&list", "< & > ; /", Patterns::Anything(), "docs 1"); + prm.declare_entry("string&list", + "< & > ; /", + Patterns::Anything(), + "docs 1"); prm.declare_entry("int*int", "2", Patterns::Integer()); - prm.declare_entry( - "double+double", "6.1415926", Patterns::Double(), "docs 3"); + prm.declare_entry("double+double", + "6.1415926", + Patterns::Double(), + "docs 3"); } prm.leave_subsection(); diff --git a/tests/parameter_handler/parameter_handler_read_xml_error_03.cc b/tests/parameter_handler/parameter_handler_read_xml_error_03.cc index ce5300ba17..1924ba9d8d 100644 --- a/tests/parameter_handler/parameter_handler_read_xml_error_03.cc +++ b/tests/parameter_handler/parameter_handler_read_xml_error_03.cc @@ -46,11 +46,15 @@ main() // things with strange characters prm.enter_subsection("Testing%testing"); { - prm.declare_entry( - "string&list", "< & > ; /", Patterns::Anything(), "docs 1"); + prm.declare_entry("string&list", + "< & > ; /", + Patterns::Anything(), + "docs 1"); prm.declare_entry("int*int", "2", Patterns::Integer()); - prm.declare_entry( - "double+double", "6.1415926", Patterns::Double(), "docs 3"); + prm.declare_entry("double+double", + "6.1415926", + Patterns::Double(), + "docs 3"); } prm.leave_subsection(); diff --git a/tests/parameter_handler/parameter_handler_read_xml_error_04.cc b/tests/parameter_handler/parameter_handler_read_xml_error_04.cc index 5dda727d68..b4cc9820dd 100644 --- a/tests/parameter_handler/parameter_handler_read_xml_error_04.cc +++ b/tests/parameter_handler/parameter_handler_read_xml_error_04.cc @@ -46,11 +46,15 @@ main() // things with strange characters prm.enter_subsection("Testing%testing"); { - prm.declare_entry( - "string&list", "< & > ; /", Patterns::Anything(), "docs 1"); + prm.declare_entry("string&list", + "< & > ; /", + Patterns::Anything(), + "docs 1"); prm.declare_entry("int*int", "2", Patterns::Integer()); - prm.declare_entry( - "double+double", "6.1415926", Patterns::Double(), "docs 3"); + prm.declare_entry("double+double", + "6.1415926", + Patterns::Double(), + "docs 3"); } prm.leave_subsection(); diff --git a/tests/parameter_handler/parameter_handler_write_json.cc b/tests/parameter_handler/parameter_handler_write_json.cc index 0fac7c4688..92a157a2aa 100644 --- a/tests/parameter_handler/parameter_handler_write_json.cc +++ b/tests/parameter_handler/parameter_handler_write_json.cc @@ -47,11 +47,15 @@ main() // things with strange characters prm.enter_subsection("Testing%testing"); { - prm.declare_entry( - "string&list", "< & > ; /", Patterns::Anything(), "docs 1"); + prm.declare_entry("string&list", + "< & > ; /", + Patterns::Anything(), + "docs 1"); prm.declare_entry("int*int", "2", Patterns::Integer()); - prm.declare_entry( - "double+double", "6.1415926", Patterns::Double(), "docs 3"); + prm.declare_entry("double+double", + "6.1415926", + Patterns::Double(), + "docs 3"); } prm.leave_subsection(); diff --git a/tests/parameter_handler/parameter_handler_write_section_1.cc b/tests/parameter_handler/parameter_handler_write_section_1.cc index f626ac6539..8abb887c34 100644 --- a/tests/parameter_handler/parameter_handler_write_section_1.cc +++ b/tests/parameter_handler/parameter_handler_write_section_1.cc @@ -39,11 +39,15 @@ main() prm.enter_subsection("Testing%testing"); { prm.declare_entry("double 2", "4.321", Patterns::Double(), "doc 4"); - prm.declare_entry( - "string&list", "< & > ; /", Patterns::Anything(), "docs 1"); + prm.declare_entry("string&list", + "< & > ; /", + Patterns::Anything(), + "docs 1"); prm.declare_entry("int*int", "2", Patterns::Integer()); - prm.declare_entry( - "double+double", "6.1415926", Patterns::Double(), "docs 3"); + prm.declare_entry("double+double", + "6.1415926", + Patterns::Double(), + "docs 3"); } prm.leave_subsection(); } diff --git a/tests/parameter_handler/parameter_handler_write_section_2.cc b/tests/parameter_handler/parameter_handler_write_section_2.cc index 21eec3f6fd..6da4593695 100644 --- a/tests/parameter_handler/parameter_handler_write_section_2.cc +++ b/tests/parameter_handler/parameter_handler_write_section_2.cc @@ -39,11 +39,15 @@ main() prm.enter_subsection("Testing%testing"); { prm.declare_entry("double 2", "4.321", Patterns::Double(), "doc 4"); - prm.declare_entry( - "string&list", "< & > ; /", Patterns::Anything(), "docs 1"); + prm.declare_entry("string&list", + "< & > ; /", + Patterns::Anything(), + "docs 1"); prm.declare_entry("int*int", "2", Patterns::Integer()); - prm.declare_entry( - "double+double", "6.1415926", Patterns::Double(), "docs 3"); + prm.declare_entry("double+double", + "6.1415926", + Patterns::Double(), + "docs 3"); } prm.leave_subsection(); } diff --git a/tests/parameter_handler/parameter_handler_write_section_xml.cc b/tests/parameter_handler/parameter_handler_write_section_xml.cc index 0c052125c4..c1858c780d 100644 --- a/tests/parameter_handler/parameter_handler_write_section_xml.cc +++ b/tests/parameter_handler/parameter_handler_write_section_xml.cc @@ -39,11 +39,15 @@ main() prm.enter_subsection("Testing%testing"); { prm.declare_entry("double 2", "4.321", Patterns::Double(), "doc 4"); - prm.declare_entry( - "string&list", "< & > ; /", Patterns::Anything(), "docs 1"); + prm.declare_entry("string&list", + "< & > ; /", + Patterns::Anything(), + "docs 1"); prm.declare_entry("int*int", "2", Patterns::Integer()); - prm.declare_entry( - "double+double", "6.1415926", Patterns::Double(), "docs 3"); + prm.declare_entry("double+double", + "6.1415926", + Patterns::Double(), + "docs 3"); } prm.leave_subsection(); } diff --git a/tests/parameter_handler/parameter_handler_write_xml.cc b/tests/parameter_handler/parameter_handler_write_xml.cc index 8d61d3e6f9..3f9a08b74f 100644 --- a/tests/parameter_handler/parameter_handler_write_xml.cc +++ b/tests/parameter_handler/parameter_handler_write_xml.cc @@ -47,11 +47,15 @@ main() // things with strange characters prm.enter_subsection("Testing%testing"); { - prm.declare_entry( - "string&list", "< & > ; /", Patterns::Anything(), "docs 1"); + prm.declare_entry("string&list", + "< & > ; /", + Patterns::Anything(), + "docs 1"); prm.declare_entry("int*int", "2", Patterns::Integer()); - prm.declare_entry( - "double+double", "6.1415926", Patterns::Double(), "docs 3"); + prm.declare_entry("double+double", + "6.1415926", + Patterns::Double(), + "docs 3"); } prm.leave_subsection(); diff --git a/tests/parameter_handler/patterns_03.cc b/tests/parameter_handler/patterns_03.cc index ab5cd923d9..81389a00d1 100644 --- a/tests/parameter_handler/patterns_03.cc +++ b/tests/parameter_handler/patterns_03.cc @@ -28,8 +28,10 @@ main() { // create one pattern and a copy of it - Patterns::Map map( - Patterns::Integer(-1, 42), Patterns::Double(-1e9, 1e9), 2, 3); + Patterns::Map map(Patterns::Integer(-1, 42), + Patterns::Double(-1e9, 1e9), + 2, + 3); Patterns::Map map2(map); // both now go out of scope -- ensure that their destruction does diff --git a/tests/parameter_handler/patterns_10.cc b/tests/parameter_handler/patterns_10.cc index 1d327da66f..f9a501dac0 100644 --- a/tests/parameter_handler/patterns_10.cc +++ b/tests/parameter_handler/patterns_10.cc @@ -27,9 +27,11 @@ main() initlog(); // create a pattern and match a string - const auto &pattern = Patterns::Tuple( - ";", Patterns::Integer(), Patterns::Double(), Patterns::Anything()); - const std::string desc = pattern.description(); + const auto & pattern = Patterns::Tuple(";", + Patterns::Integer(), + Patterns::Double(), + Patterns::Anything()); + const std::string desc = pattern.description(); deallog << desc << std::endl; diff --git a/tests/parameter_handler/patterns_12.cc b/tests/parameter_handler/patterns_12.cc index dd824b99de..3c907f1105 100644 --- a/tests/parameter_handler/patterns_12.cc +++ b/tests/parameter_handler/patterns_12.cc @@ -57,8 +57,9 @@ main() // three patterns { - const auto &pattern = Patterns::Tuple( - Patterns::Double(), Patterns::Anything(), Patterns::Bool()); + const auto &pattern = Patterns::Tuple(Patterns::Double(), + Patterns::Anything(), + Patterns::Bool()); deallog << pattern.description(Patterns::PatternBase::OutputStyle::Machine) << '\n' diff --git a/tests/parameter_handler/save_flags.cc b/tests/parameter_handler/save_flags.cc index 144c7b2d2d..d0394f2f50 100644 --- a/tests/parameter_handler/save_flags.cc +++ b/tests/parameter_handler/save_flags.cc @@ -47,11 +47,15 @@ main() // things with strange characters prm.enter_subsection("Testing%testing"); { - prm.declare_entry( - "string&list", "< & > ; /", Patterns::Anything(), "docs 1"); + prm.declare_entry("string&list", + "< & > ; /", + Patterns::Anything(), + "docs 1"); prm.declare_entry("int*int", "2", Patterns::Integer()); - prm.declare_entry( - "double+double", "6.1415926", Patterns::Double(), "docs 3"); + prm.declare_entry("double+double", + "6.1415926", + Patterns::Double(), + "docs 3"); } prm.leave_subsection(); diff --git a/tests/parameter_handler/write_latex_01.cc b/tests/parameter_handler/write_latex_01.cc index 1997f2f0f0..57298cd525 100644 --- a/tests/parameter_handler/write_latex_01.cc +++ b/tests/parameter_handler/write_latex_01.cc @@ -43,11 +43,11 @@ main() { prm.enter_subsection("section_2&3"); { - prm.declare_entry( - "list", - "default_1", - Patterns::List(Patterns::Selection("default_1|b|c|d|e|f|g|h")), - "docs 1"); + prm.declare_entry("list", + "default_1", + Patterns::List( + Patterns::Selection("default_1|b|c|d|e|f|g|h")), + "docs 1"); prm.declare_entry("int_hello", "1", Patterns::Integer()); prm.declare_entry("text", "default text with _ ~ \\ # & { }", diff --git a/tests/particles/particle_04.cc b/tests/particles/particle_04.cc index 151338493e..7270b19a36 100644 --- a/tests/particles/particle_04.cc +++ b/tests/particles/particle_04.cc @@ -46,8 +46,9 @@ test() const types::particle_index index(7); - Particles::Particle particle( - position, reference_position, index); + Particles::Particle particle(position, + reference_position, + index); deallog << "Particle location: " << particle.get_location() << std::endl << "Particle reference location: " diff --git a/tests/particles/particle_05.cc b/tests/particles/particle_05.cc index 0ac2adfa34..8ee0077127 100644 --- a/tests/particles/particle_05.cc +++ b/tests/particles/particle_05.cc @@ -49,8 +49,9 @@ test() const types::particle_index index(7); - Particles::Particle particle( - position, reference_position, index); + Particles::Particle particle(position, + reference_position, + index); deallog << "Particle location: " << particle.get_location() << std::endl << "Particle reference location: " diff --git a/tests/particles/particle_06.cc b/tests/particles/particle_06.cc index 3af62b010c..772c52dac3 100644 --- a/tests/particles/particle_06.cc +++ b/tests/particles/particle_06.cc @@ -51,8 +51,9 @@ test() std::vector properties = {0.15, 0.45, 0.75}; - Particles::Particle particle( - position, reference_position, index); + Particles::Particle particle(position, + reference_position, + index); particle.set_property_pool(pool); particle.set_properties( ArrayView(&properties[0], properties.size())); diff --git a/tests/particles/particle_handler_01.cc b/tests/particles/particle_handler_01.cc index 3c744d06d3..b02abc00d7 100644 --- a/tests/particles/particle_handler_01.cc +++ b/tests/particles/particle_handler_01.cc @@ -56,16 +56,19 @@ test() if (dim > 2) reference_position(2) = 0.6; - Particles::Particle particle( - position, reference_position, 7); + Particles::Particle particle(position, + reference_position, + 7); deallog << "Particle location: " << particle.get_location() << std::endl; std::pair:: active_cell_iterator, Point> - cell_position = GridTools::find_active_cell_around_point( - mapping, tr, particle.get_location()); + cell_position = + GridTools::find_active_cell_around_point(mapping, + tr, + particle.get_location()); particle_handler.insert_particle(particle, cell_position.first); particle_handler.update_cached_numbers(); diff --git a/tests/particles/particle_handler_02.cc b/tests/particles/particle_handler_02.cc index 2b35ec72f6..eda42b1a05 100644 --- a/tests/particles/particle_handler_02.cc +++ b/tests/particles/particle_handler_02.cc @@ -57,26 +57,32 @@ test() if (dim > 2) reference_position(2) = 0.6; - Particles::Particle particle( - position, reference_position, 7); + Particles::Particle particle(position, + reference_position, + 7); deallog << "Particle location: " << particle.get_location() << std::endl; std::pair:: active_cell_iterator, Point> - cell_position = GridTools::find_active_cell_around_point( - mapping, tr, particle.get_location()); + cell_position = + GridTools::find_active_cell_around_point(mapping, + tr, + particle.get_location()); particle_handler.insert_particle(particle, cell_position.first); particle_handler.insert_particle(particle, cell_position.first); position(0) = 0.7; - Particles::Particle particle2( - position, reference_position, 9); - - cell_position = GridTools::find_active_cell_around_point( - mapping, tr, particle2.get_location()); + Particles::Particle particle2(position, + reference_position, + 9); + + cell_position = + GridTools::find_active_cell_around_point(mapping, + tr, + particle2.get_location()); particle_handler.insert_particle(particle2, cell_position.first); particle_handler.update_cached_numbers(); diff --git a/tests/particles/particle_handler_03.cc b/tests/particles/particle_handler_03.cc index 50f066c33c..55f6807995 100644 --- a/tests/particles/particle_handler_03.cc +++ b/tests/particles/particle_handler_03.cc @@ -50,15 +50,19 @@ test() position[1](i) = 0.75; } - Particles::Particle particle1( - position[0], reference_position[0], 0); - Particles::Particle particle2( - position[1], reference_position[1], 1); - - typename Triangulation::active_cell_iterator cell1( - &tr, 1, 0); - typename Triangulation::active_cell_iterator cell2( - &tr, 1, 0); + Particles::Particle particle1(position[0], + reference_position[0], + 0); + Particles::Particle particle2(position[1], + reference_position[1], + 1); + + typename Triangulation::active_cell_iterator cell1(&tr, + 1, + 0); + typename Triangulation::active_cell_iterator cell2(&tr, + 1, + 0); particle_handler.insert_particle(particle1, cell1); particle_handler.insert_particle(particle2, cell2); diff --git a/tests/particles/particle_handler_04.cc b/tests/particles/particle_handler_04.cc index 057f398ade..ea8a4d18b8 100644 --- a/tests/particles/particle_handler_04.cc +++ b/tests/particles/particle_handler_04.cc @@ -55,15 +55,19 @@ test() position[1](i) = 0.525; } - Particles::Particle particle1( - position[0], reference_position[0], 0); - Particles::Particle particle2( - position[1], reference_position[1], 1); - - typename Triangulation::active_cell_iterator cell1( - &tr, 2, 0); - typename Triangulation::active_cell_iterator cell2( - &tr, 2, 0); + Particles::Particle particle1(position[0], + reference_position[0], + 0); + Particles::Particle particle2(position[1], + reference_position[1], + 1); + + typename Triangulation::active_cell_iterator cell1(&tr, + 2, + 0); + typename Triangulation::active_cell_iterator cell2(&tr, + 2, + 0); particle_handler.insert_particle(particle1, cell1); particle_handler.insert_particle(particle2, cell2); diff --git a/tests/particles/particle_handler_05.cc b/tests/particles/particle_handler_05.cc index 5d0de48fa1..ef45baf57a 100644 --- a/tests/particles/particle_handler_05.cc +++ b/tests/particles/particle_handler_05.cc @@ -59,8 +59,9 @@ create_regular_particle_distribution( static_cast(particles_per_direction - 1); id = i * particles_per_direction * particles_per_direction + j * particles_per_direction + k; - Particles::Particle particle( - position, reference_position, id); + Particles::Particle particle(position, + reference_position, + id); typename parallel::distributed::Triangulation:: active_cell_iterator cell = @@ -71,8 +72,9 @@ create_regular_particle_distribution( } else { - Particles::Particle particle( - position, reference_position, id); + Particles::Particle particle(position, + reference_position, + id); typename parallel::distributed::Triangulation:: active_cell_iterator cell = diff --git a/tests/petsc/block_vector_iterator_03.cc b/tests/petsc/block_vector_iterator_03.cc index df140c7534..46d0d80b60 100644 --- a/tests/petsc/block_vector_iterator_03.cc +++ b/tests/petsc/block_vector_iterator_03.cc @@ -161,11 +161,12 @@ test() deallog << "Check 5: " << (v1 == v2 ? "true" : "false") << std::endl; // check std::transform - std::transform( - v1.begin(), - v1.end(), - v2.begin(), - std::bind(std::multiplies(), std::placeholders::_1, 2.0)); + std::transform(v1.begin(), + v1.end(), + v2.begin(), + std::bind(std::multiplies(), + std::placeholders::_1, + 2.0)); v2.compress(VectorOperation::insert); v2 *= 1. / 2.; deallog << "Check 6: " << (v1 == v2 ? "true" : "false") << std::endl; diff --git a/tests/petsc/copy_to_dealvec.cc b/tests/petsc/copy_to_dealvec.cc index bbb3454508..c44000a61d 100644 --- a/tests/petsc/copy_to_dealvec.cc +++ b/tests/petsc/copy_to_dealvec.cc @@ -49,8 +49,9 @@ test() PETScWrappers::MPI::Vector vb(local_active, MPI_COMM_WORLD); PETScWrappers::MPI::Vector v(local_active, local_relevant, MPI_COMM_WORLD); - LinearAlgebra::distributed::Vector copied( - local_active, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector copied(local_active, + local_relevant, + MPI_COMM_WORLD); // set local values vb(myid * 2) = myid * 2.0; diff --git a/tests/petsc/copy_to_dealvec_block.cc b/tests/petsc/copy_to_dealvec_block.cc index ffb831c58b..cb154d4af8 100644 --- a/tests/petsc/copy_to_dealvec_block.cc +++ b/tests/petsc/copy_to_dealvec_block.cc @@ -49,11 +49,13 @@ test() local_relevant.add_range(1, 2); PETScWrappers::MPI::Vector vb_one(local_active, MPI_COMM_WORLD); - PETScWrappers::MPI::Vector v_one( - local_active, local_relevant, MPI_COMM_WORLD); + PETScWrappers::MPI::Vector v_one(local_active, + local_relevant, + MPI_COMM_WORLD); - LinearAlgebra::distributed::Vector copied_one( - local_active, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector copied_one(local_active, + local_relevant, + MPI_COMM_WORLD); // set local values vb_one(myid * 2) = myid * 2.0; diff --git a/tests/petsc/deal_solver_01.cc b/tests/petsc/deal_solver_01.cc index 97af89e321..d11ff12d76 100644 --- a/tests/petsc/deal_solver_01.cc +++ b/tests/petsc/deal_solver_01.cc @@ -67,8 +67,10 @@ main(int argc, char **argv) PreconditionIdentity preconditioner; deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 42, 44); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 42, + 44); } GrowingVectorMemory::release_unused_memory(); } diff --git a/tests/petsc/deal_solver_02.cc b/tests/petsc/deal_solver_02.cc index 8ef3dce74b..a1e9eebf80 100644 --- a/tests/petsc/deal_solver_02.cc +++ b/tests/petsc/deal_solver_02.cc @@ -68,8 +68,10 @@ main(int argc, char **argv) SolverBicgstab solver(control, mem); PreconditionIdentity preconditioner; deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 48, 51); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 48, + 51); } GrowingVectorMemory::release_unused_memory(); } diff --git a/tests/petsc/deal_solver_03.cc b/tests/petsc/deal_solver_03.cc index 20571d60ff..421eb90376 100644 --- a/tests/petsc/deal_solver_03.cc +++ b/tests/petsc/deal_solver_03.cc @@ -68,8 +68,10 @@ main(int argc, char **argv) SolverGMRES solver(control, mem); PreconditionIdentity preconditioner; deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 74, 76); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 74, + 76); } GrowingVectorMemory::release_unused_memory(); } diff --git a/tests/petsc/deal_solver_04.cc b/tests/petsc/deal_solver_04.cc index a50e245ccd..f8bc4bfccb 100644 --- a/tests/petsc/deal_solver_04.cc +++ b/tests/petsc/deal_solver_04.cc @@ -68,8 +68,10 @@ main(int argc, char **argv) SolverMinRes solver(control, mem); PreconditionIdentity preconditioner; deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 42, 44); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 42, + 44); } GrowingVectorMemory::release_unused_memory(); } diff --git a/tests/petsc/deal_solver_05.cc b/tests/petsc/deal_solver_05.cc index a4125e7dba..2c8e74fdc0 100644 --- a/tests/petsc/deal_solver_05.cc +++ b/tests/petsc/deal_solver_05.cc @@ -67,8 +67,10 @@ main(int argc, char **argv) SolverQMRS solver(control, mem); PreconditionIdentity preconditioner; deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 45, 47); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 45, + 47); } GrowingVectorMemory::release_unused_memory(); } diff --git a/tests/petsc/matrix_out_03.cc b/tests/petsc/matrix_out_03.cc index 9b369fb477..e44c8f0531 100644 --- a/tests/petsc/matrix_out_03.cc +++ b/tests/petsc/matrix_out_03.cc @@ -52,8 +52,9 @@ main(int argc, char **argv) sparse_matrix.compress(VectorOperation::insert); MatrixOut matrix_out; - matrix_out.build_patches( - sparse_matrix, "sparse_matrix", MatrixOut::Options(true, 1, true)); + matrix_out.build_patches(sparse_matrix, + "sparse_matrix", + MatrixOut::Options(true, 1, true)); matrix_out.write_gnuplot(logfile); } } diff --git a/tests/petsc/petsc_mf_testmatrix.h b/tests/petsc/petsc_mf_testmatrix.h index 6b5aa5a5ca..922f699928 100644 --- a/tests/petsc/petsc_mf_testmatrix.h +++ b/tests/petsc/petsc_mf_testmatrix.h @@ -97,10 +97,10 @@ private: // --------------- inline and template functions ----------------- -inline PetscFDMatrix::PetscFDMatrix(unsigned int size, unsigned int dim) : - PETScWrappers::MatrixFree(dim, dim, dim, dim), - nx(size), - ny(size) +inline PetscFDMatrix::PetscFDMatrix(unsigned int size, unsigned int dim) + : PETScWrappers::MatrixFree(dim, dim, dim, dim) + , nx(size) + , ny(size) {} diff --git a/tests/petsc/solver_01.cc b/tests/petsc/solver_01.cc index a0e1807505..640e410b07 100644 --- a/tests/petsc/solver_01.cc +++ b/tests/petsc/solver_01.cc @@ -60,7 +60,9 @@ main(int argc, char **argv) PETScWrappers::SolverRichardson solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 2295, 2300); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 2295, + 2300); } } diff --git a/tests/petsc/solver_02.cc b/tests/petsc/solver_02.cc index 7a959843b0..4fab023c4f 100644 --- a/tests/petsc/solver_02.cc +++ b/tests/petsc/solver_02.cc @@ -60,7 +60,9 @@ main(int argc, char **argv) PETScWrappers::SolverChebychev solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 1050, 1150); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 1050, + 1150); } } diff --git a/tests/petsc/solver_03.cc b/tests/petsc/solver_03.cc index 4a033ae88b..73b4b981e5 100644 --- a/tests/petsc/solver_03.cc +++ b/tests/petsc/solver_03.cc @@ -60,7 +60,9 @@ main(int argc, char **argv) PETScWrappers::SolverCG solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 40, 42); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 40, + 42); } } diff --git a/tests/petsc/solver_03_mf.cc b/tests/petsc/solver_03_mf.cc index 0f771de8f8..4951426d53 100644 --- a/tests/petsc/solver_03_mf.cc +++ b/tests/petsc/solver_03_mf.cc @@ -57,7 +57,9 @@ main(int argc, char **argv) PETScWrappers::SolverCG solver(control); PETScWrappers::PreconditionNone preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 42, 44); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 42, + 44); } } diff --git a/tests/petsc/solver_03_precondition_boomeramg.cc b/tests/petsc/solver_03_precondition_boomeramg.cc index 1a3a8b7300..85052b8236 100644 --- a/tests/petsc/solver_03_precondition_boomeramg.cc +++ b/tests/petsc/solver_03_precondition_boomeramg.cc @@ -62,7 +62,9 @@ main(int argc, char **argv) deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 3, 5); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 3, + 5); } } diff --git a/tests/petsc/solver_03_precondition_boomeramg_symmetric.cc b/tests/petsc/solver_03_precondition_boomeramg_symmetric.cc index 438aa82625..729d689df2 100644 --- a/tests/petsc/solver_03_precondition_boomeramg_symmetric.cc +++ b/tests/petsc/solver_03_precondition_boomeramg_symmetric.cc @@ -63,7 +63,9 @@ main(int argc, char **argv) deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 3, 5); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 3, + 5); } } diff --git a/tests/petsc/solver_03_precondition_eisenstat.cc b/tests/petsc/solver_03_precondition_eisenstat.cc index 4e9f7cbcbb..ef474c23a7 100644 --- a/tests/petsc/solver_03_precondition_eisenstat.cc +++ b/tests/petsc/solver_03_precondition_eisenstat.cc @@ -61,7 +61,9 @@ main(int argc, char **argv) PETScWrappers::PreconditionEisenstat preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 19, 21); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 19, + 21); } } diff --git a/tests/petsc/solver_03_precondition_icc.cc b/tests/petsc/solver_03_precondition_icc.cc index 8a805b742c..bdfa8d9f2d 100644 --- a/tests/petsc/solver_03_precondition_icc.cc +++ b/tests/petsc/solver_03_precondition_icc.cc @@ -61,7 +61,9 @@ main(int argc, char **argv) PETScWrappers::PreconditionICC preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 16, 18); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 16, + 18); } } diff --git a/tests/petsc/solver_03_precondition_ilu.cc b/tests/petsc/solver_03_precondition_ilu.cc index 7d075d3929..29b19068e1 100644 --- a/tests/petsc/solver_03_precondition_ilu.cc +++ b/tests/petsc/solver_03_precondition_ilu.cc @@ -61,7 +61,9 @@ main(int argc, char **argv) PETScWrappers::SolverCG solver(control); PETScWrappers::PreconditionILU preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 16, 18); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 16, + 18); } } diff --git a/tests/petsc/solver_03_precondition_lu.cc b/tests/petsc/solver_03_precondition_lu.cc index c238e26b6a..689295dce8 100644 --- a/tests/petsc/solver_03_precondition_lu.cc +++ b/tests/petsc/solver_03_precondition_lu.cc @@ -61,7 +61,9 @@ main(int argc, char **argv) PETScWrappers::SolverCG solver(control); PETScWrappers::PreconditionLU preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 1, 1); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 1, + 1); } } diff --git a/tests/petsc/solver_03_precondition_parasails.cc b/tests/petsc/solver_03_precondition_parasails.cc index ed5d5f1bf0..770957c885 100644 --- a/tests/petsc/solver_03_precondition_parasails.cc +++ b/tests/petsc/solver_03_precondition_parasails.cc @@ -60,7 +60,9 @@ main(int argc, char **argv) PETScWrappers::SolverCG solver(control); PETScWrappers::PreconditionParaSails preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 18, 20); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 18, + 20); } } diff --git a/tests/petsc/solver_03_precondition_sor.cc b/tests/petsc/solver_03_precondition_sor.cc index bc918c0f99..3f0b76ba97 100644 --- a/tests/petsc/solver_03_precondition_sor.cc +++ b/tests/petsc/solver_03_precondition_sor.cc @@ -60,7 +60,9 @@ main(int argc, char **argv) PETScWrappers::SolverCG solver(control); PETScWrappers::PreconditionSOR preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 18, 20); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 18, + 20); } } diff --git a/tests/petsc/solver_03_precondition_ssor.cc b/tests/petsc/solver_03_precondition_ssor.cc index 40ef8bb65f..4b944c1dc6 100644 --- a/tests/petsc/solver_03_precondition_ssor.cc +++ b/tests/petsc/solver_03_precondition_ssor.cc @@ -60,7 +60,9 @@ main(int argc, char **argv) PETScWrappers::SolverCG solver(control); PETScWrappers::PreconditionSSOR preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 18, 20); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 18, + 20); } } diff --git a/tests/petsc/solver_04.cc b/tests/petsc/solver_04.cc index 682fea70d8..cd31ad5f57 100644 --- a/tests/petsc/solver_04.cc +++ b/tests/petsc/solver_04.cc @@ -60,7 +60,9 @@ main(int argc, char **argv) PETScWrappers::SolverBiCG solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 40, 42); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 40, + 42); } } diff --git a/tests/petsc/solver_05.cc b/tests/petsc/solver_05.cc index 27ca17e60b..9dbabcba58 100644 --- a/tests/petsc/solver_05.cc +++ b/tests/petsc/solver_05.cc @@ -60,7 +60,9 @@ main(int argc, char **argv) PETScWrappers::SolverGMRES solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 47, 49); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 47, + 49); } } diff --git a/tests/petsc/solver_06.cc b/tests/petsc/solver_06.cc index b89f59b92d..429277918d 100644 --- a/tests/petsc/solver_06.cc +++ b/tests/petsc/solver_06.cc @@ -60,7 +60,9 @@ main(int argc, char **argv) PETScWrappers::SolverBicgstab solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 32, 34); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 32, + 34); } } diff --git a/tests/petsc/solver_07.cc b/tests/petsc/solver_07.cc index 8a7d4e3f56..0fa058f58d 100644 --- a/tests/petsc/solver_07.cc +++ b/tests/petsc/solver_07.cc @@ -60,7 +60,9 @@ main(int argc, char **argv) PETScWrappers::SolverCGS solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 39, 41); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 39, + 41); } } diff --git a/tests/petsc/solver_08.cc b/tests/petsc/solver_08.cc index ac150effb9..96ef8d722c 100644 --- a/tests/petsc/solver_08.cc +++ b/tests/petsc/solver_08.cc @@ -60,7 +60,9 @@ main(int argc, char **argv) PETScWrappers::SolverTFQMR solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 39, 41); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 39, + 41); } } diff --git a/tests/petsc/solver_09.cc b/tests/petsc/solver_09.cc index 0f7db764fd..59dc9bbaae 100644 --- a/tests/petsc/solver_09.cc +++ b/tests/petsc/solver_09.cc @@ -64,7 +64,9 @@ main(int argc, char **argv) PETScWrappers::SolverTCQMR solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 43, 45); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 43, + 45); } } diff --git a/tests/petsc/solver_10.cc b/tests/petsc/solver_10.cc index 62a7e00243..4857fefed5 100644 --- a/tests/petsc/solver_10.cc +++ b/tests/petsc/solver_10.cc @@ -60,7 +60,9 @@ main(int argc, char **argv) PETScWrappers::SolverCR solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 40, 42); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 40, + 42); } } diff --git a/tests/petsc/solver_11.cc b/tests/petsc/solver_11.cc index f3ad3eca98..b0dda2e417 100644 --- a/tests/petsc/solver_11.cc +++ b/tests/petsc/solver_11.cc @@ -56,7 +56,9 @@ main(int argc, char **argv) PETScWrappers::SolverLSQR solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 171, 175); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 171, + 175); } } diff --git a/tests/petsc/solver_12.cc b/tests/petsc/solver_12.cc index e56acef1d2..61057b3fd0 100644 --- a/tests/petsc/solver_12.cc +++ b/tests/petsc/solver_12.cc @@ -61,13 +61,17 @@ main(int argc, char **argv) PETScWrappers::PreconditionJacobi preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 1, 11); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 1, + 11); // run twice because this errored out at some point u = 0.; deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 1, 1); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 1, + 1); } } diff --git a/tests/petsc/solver_13.cc b/tests/petsc/solver_13.cc index ab8ba51b5f..96cda6f04e 100644 --- a/tests/petsc/solver_13.cc +++ b/tests/petsc/solver_13.cc @@ -64,13 +64,17 @@ main(int argc, char **argv) PETScWrappers::PreconditionJacobi preconditioner(A); deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 1, 1); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 1, + 1); deallog << u.l2_norm() << std::endl; deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, t, u, preconditioner), control.last_step(), 1, 1); + check_solver_within_range(solver.solve(A, t, u, preconditioner), + control.last_step(), + 1, + 1); deallog << t.l2_norm() << std::endl; u = 0; diff --git a/tests/petsc_complex/09.cc b/tests/petsc_complex/09.cc index c5279bcbfe..4397304070 100644 --- a/tests/petsc_complex/09.cc +++ b/tests/petsc_complex/09.cc @@ -46,10 +46,10 @@ test(PETScWrappers::SparseMatrix &m) AssertThrow(m(i, j) == std::complex((i * j * .5 + .5) * 1.25, i * j * .5 * 1.25), ExcInternalError()); - AssertThrow( - m.el(i, j) == - std::complex((i * j * .5 + .5) * 1.25, i * j * .5 * 1.25), - ExcInternalError()); + AssertThrow(m.el(i, j) == + std::complex((i * j * .5 + .5) * 1.25, + i * j * .5 * 1.25), + ExcInternalError()); } else { diff --git a/tests/petsc_complex/element_access_00.cc b/tests/petsc_complex/element_access_00.cc index 8315bc7c94..aa7097bdd3 100644 --- a/tests/petsc_complex/element_access_00.cc +++ b/tests/petsc_complex/element_access_00.cc @@ -42,10 +42,10 @@ test_vector(PETScWrappers::MPI::Vector &v) // check that is what we get by casting PetscScalar to std::real() // and std::imag() for (unsigned int k = 0; k < v.size(); ++k) - AssertThrow( - (static_cast>(v(k)).real() == k) && - (static_cast>(v(k)).imag() == v.size() - k), - ExcInternalError()); + AssertThrow((static_cast>(v(k)).real() == k) && + (static_cast>(v(k)).imag() == + v.size() - k), + ExcInternalError()); // check that is what we get by // dealii::internal::VectorReference::real() and diff --git a/tests/petsc_complex/fe_get_function_values.cc b/tests/petsc_complex/fe_get_function_values.cc index 268ac30b30..b9f4024021 100644 --- a/tests/petsc_complex/fe_get_function_values.cc +++ b/tests/petsc_complex/fe_get_function_values.cc @@ -89,16 +89,19 @@ test() LinearAlgebra::distributed::Vector vector_Re, vector_Re_locally_relevant, vector_Im, vector_Im_locally_relevant; vector.reinit(locally_owned_dofs, mpi_communicator); - vector_locally_relevant.reinit( - locally_owned_dofs, locally_relevant_dofs, mpi_communicator); + vector_locally_relevant.reinit(locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); vector_Re.reinit(locally_owned_dofs, mpi_communicator); - vector_Re_locally_relevant.reinit( - locally_owned_dofs, locally_relevant_dofs, mpi_communicator); + vector_Re_locally_relevant.reinit(locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); vector_Im.reinit(locally_owned_dofs, mpi_communicator); - vector_Im_locally_relevant.reinit( - locally_owned_dofs, locally_relevant_dofs, mpi_communicator); + vector_Im_locally_relevant.reinit(locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); const types::global_dof_index n_local_dofs = locally_owned_dofs.n_elements(); @@ -129,8 +132,9 @@ test() // a separate quadrature formula // enough for mass and kinetic matrices assembly QGauss quadrature_formula(poly_degree + 1); - FEValues fe_values( - fe, quadrature_formula, update_values | update_JxW_values); + FEValues fe_values(fe, + quadrature_formula, + update_values | update_JxW_values); const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); diff --git a/tests/petsc_complex/parallel_sparse_matrix_01.cc b/tests/petsc_complex/parallel_sparse_matrix_01.cc index 0fa0fe40f6..6914b0936e 100644 --- a/tests/petsc_complex/parallel_sparse_matrix_01.cc +++ b/tests/petsc_complex/parallel_sparse_matrix_01.cc @@ -98,8 +98,10 @@ test(const unsigned int poly_degree = 1) mpi_communicator, locally_relevant_dofs); - mass_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, dsp, mpi_communicator); + mass_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + dsp, + mpi_communicator); // assemble mass matrix: mass_matrix = PetscScalar(); @@ -137,8 +139,9 @@ test(const unsigned int poly_degree = 1) } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_mass_matrix, local_dof_indices, mass_matrix); + constraints.distribute_local_to_global(cell_mass_matrix, + local_dof_indices, + mass_matrix); } mass_matrix.compress(VectorOperation::add); diff --git a/tests/petsc_complex/solver_real_01.cc b/tests/petsc_complex/solver_real_01.cc index e8ab7574a2..87bd6f0794 100644 --- a/tests/petsc_complex/solver_real_01.cc +++ b/tests/petsc_complex/solver_real_01.cc @@ -61,7 +61,9 @@ main(int argc, char **argv) PETScWrappers::SolverRichardson solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 2295, 2300); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 2295, + 2300); } } diff --git a/tests/petsc_complex/solver_real_02.cc b/tests/petsc_complex/solver_real_02.cc index 4935789814..a68d9ace47 100644 --- a/tests/petsc_complex/solver_real_02.cc +++ b/tests/petsc_complex/solver_real_02.cc @@ -61,7 +61,9 @@ main(int argc, char **argv) PETScWrappers::SolverChebychev solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 1050, 1141); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 1050, + 1141); } } diff --git a/tests/physics/elasticity-kinematics_01.cc b/tests/physics/elasticity-kinematics_01.cc index 4e88e4866a..741c86ddd9 100644 --- a/tests/physics/elasticity-kinematics_01.cc +++ b/tests/physics/elasticity-kinematics_01.cc @@ -121,11 +121,11 @@ test_kinematic_tensors() Assert((F_t1 - unit_symmetric_tensor()).norm() < tol, ExcMessage("Incorrect computation of F_t1")); const Tensor<2, dim> F = Kinematics::F(Grad_u); - Assert( - (F - (static_cast>(unit_symmetric_tensor()) + - Grad_u)) - .norm() < tol, - ExcMessage("Incorrect computation of F")); + Assert((F - + (static_cast>(unit_symmetric_tensor()) + + Grad_u)) + .norm() < tol, + ExcMessage("Incorrect computation of F")); // Volumetric / isochoric split of deformation gradient Assert(determinant(F) != 1.0, @@ -137,16 +137,16 @@ test_kinematic_tensors() ExcMessage("F_vol has no dilatating action")); // Right Cauchy-Green tensor - Assert( - (static_cast>(Kinematics::C(F)) - transpose(F) * F) - .norm() < tol, - ExcMessage("Incorrect computation of C")); + Assert((static_cast>(Kinematics::C(F)) - + transpose(F) * F) + .norm() < tol, + ExcMessage("Incorrect computation of C")); // Left Cauchy-Green tensor - Assert( - (static_cast>(Kinematics::b(F)) - F * transpose(F)) - .norm() < tol, - ExcMessage("Incorrect computation of b")); + Assert((static_cast>(Kinematics::b(F)) - + F * transpose(F)) + .norm() < tol, + ExcMessage("Incorrect computation of b")); // Small strain tensor Assert((static_cast>(Kinematics::epsilon(Grad_u)) - @@ -155,11 +155,11 @@ test_kinematic_tensors() ExcMessage("Incorrect computation of epsilon")); // Green-Lagrange strain tensor - Assert( - (static_cast>(Kinematics::E(F)) - - 0.5 * (Grad_u + transpose(Grad_u) + transpose(Grad_u) * Grad_u)) - .norm() < tol, - ExcMessage("Incorrect computation of E")); + Assert((static_cast>(Kinematics::E(F)) - + 0.5 * + (Grad_u + transpose(Grad_u) + transpose(Grad_u) * Grad_u)) + .norm() < tol, + ExcMessage("Incorrect computation of E")); // Almansi strain tensor // Holzapfel 2.82 @@ -182,10 +182,10 @@ test_kinematic_tensors() const Tensor<2, dim> &dot_grad_u = qp_dot_grad_u_t[q_point]; // Spatial velocity gradient - Assert( - (static_cast>(Kinematics::l(F, F_dot)) - dot_grad_u) - .norm() < tol, - ExcMessage("Incorrect computation of l")); + Assert((static_cast>(Kinematics::l(F, F_dot)) - + dot_grad_u) + .norm() < tol, + ExcMessage("Incorrect computation of l")); // Rate of deformation tensor Assert((static_cast>(Kinematics::d(F, F_dot)) - diff --git a/tests/physics/notation-kelvin_02.cc b/tests/physics/notation-kelvin_02.cc index 2db4894913..016a161172 100644 --- a/tests/physics/notation-kelvin_02.cc +++ b/tests/physics/notation-kelvin_02.cc @@ -420,8 +420,9 @@ test_rank_3_tensors() Tensor<3, dim, double> C; initialize(A); initialize(C); - const Tensor<1, dim, double> B = double_contract<0, 0, 1, 1>( - C, A); // This implies that a Tvmult is necessary + const Tensor<1, dim, double> B = + double_contract<0, 0, 1, 1>(C, + A); // This implies that a Tvmult is necessary const Vector vA = Notation::Kelvin::to_vector(A); const FullMatrix mC = Notation::Kelvin::to_matrix(C); diff --git a/tests/physics/step-18-rotation_matrix.cc b/tests/physics/step-18-rotation_matrix.cc index 72deaf6dd4..a0dce64327 100644 --- a/tests/physics/step-18-rotation_matrix.cc +++ b/tests/physics/step-18-rotation_matrix.cc @@ -209,7 +209,8 @@ namespace Step18 std::vector> & value_list) const; }; template - BodyForce::BodyForce() : Function(dim) + BodyForce::BodyForce() + : Function(dim) {} template inline void @@ -254,11 +255,11 @@ namespace Step18 template IncrementalBoundaryValues::IncrementalBoundaryValues( const double present_time, - const double present_timestep) : - Function(dim), - velocity(.1), - present_time(present_time), - present_timestep(present_timestep) + const double present_timestep) + : Function(dim) + , velocity(.1) + , present_time(present_time) + , present_timestep(present_timestep) {} template void @@ -286,19 +287,19 @@ namespace Step18 get_stress_strain_tensor(/*lambda = */ 9.695e10, /*mu = */ 7.617e10); template - TopLevel::TopLevel() : - triangulation(MPI_COMM_WORLD, - ::Triangulation::none, - false, - parallel::shared::Triangulation::partition_zorder), - fe(FE_Q(1), dim), - dof_handler(triangulation), - quadrature_formula(2), - mpi_communicator(MPI_COMM_WORLD), - n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)), - this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)), - pcout(std::cout, this_mpi_process == 0), - monitored_vertex_first_dof(0) + TopLevel::TopLevel() + : triangulation(MPI_COMM_WORLD, + ::Triangulation::none, + false, + parallel::shared::Triangulation::partition_zorder) + , fe(FE_Q(1), dim) + , dof_handler(triangulation) + , quadrature_formula(2) + , mpi_communicator(MPI_COMM_WORLD) + , n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)) + , this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)) + , pcout(std::cout, this_mpi_process == 0) + , monitored_vertex_first_dof(0) {} template TopLevel::~TopLevel() @@ -409,10 +410,9 @@ namespace Step18 for (unsigned int j = 0; j < dofs_per_cell; ++j) for (unsigned int q_point = 0; q_point < n_q_points; ++q_point) { - const SymmetricTensor<2, dim> eps_phi_i = get_strain( - fe_values, i, q_point), - eps_phi_j = get_strain( - fe_values, j, q_point); + const SymmetricTensor<2, dim> + eps_phi_i = get_strain(fe_values, i, q_point), + eps_phi_j = get_strain(fe_values, j, q_point); cell_matrix(i, j) += (eps_phi_i * stress_strain_tensor * eps_phi_j * fe_values.JxW(q_point)); } @@ -446,8 +446,10 @@ namespace Step18 system_rhs.compress(VectorOperation::add); FEValuesExtractors::Scalar z_component(dim - 1); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(dim), boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(dim), + boundary_values); VectorTools::interpolate_boundary_values( dof_handler, 1, @@ -480,8 +482,10 @@ namespace Step18 PETScWrappers::MPI::Vector distributed_incremental_displacement( locally_owned_dofs, mpi_communicator); distributed_incremental_displacement = incremental_displacement; - SolverControl solver_control( - dof_handler.n_dofs(), 1e-16 * system_rhs.l2_norm(), false, false); + SolverControl solver_control(dof_handler.n_dofs(), + 1e-16 * system_rhs.l2_norm(), + false, + false); PETScWrappers::SolverCG cg(solver_control, mpi_communicator); PETScWrappers::PreconditionBlockJacobi preconditioner(system_matrix); cg.solve(system_matrix, @@ -671,8 +675,10 @@ namespace Step18 distributed_error_per_cell(i) = error_per_cell(i); distributed_error_per_cell.compress(VectorOperation::insert); error_per_cell = distributed_error_per_cell; - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, error_per_cell, 0.25, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + error_per_cell, + 0.25, + 0.03); triangulation.execute_coarsening_and_refinement(); setup_quadrature_point_history(); } @@ -731,8 +737,9 @@ namespace Step18 void TopLevel::update_quadrature_point_history() { - FEValues fe_values( - fe, quadrature_formula, update_values | update_gradients); + FEValues fe_values(fe, + quadrature_formula, + update_values | update_gradients); std::vector>> displacement_increment_grads( quadrature_formula.size(), std::vector>(dim)); for (typename DoFHandler::active_cell_iterator cell = diff --git a/tests/physics/step-18.cc b/tests/physics/step-18.cc index 528da2a039..8dcd054790 100644 --- a/tests/physics/step-18.cc +++ b/tests/physics/step-18.cc @@ -225,7 +225,8 @@ namespace Step18 std::vector> & value_list) const; }; template - BodyForce::BodyForce() : Function(dim) + BodyForce::BodyForce() + : Function(dim) {} template inline void @@ -270,11 +271,11 @@ namespace Step18 template IncrementalBoundaryValues::IncrementalBoundaryValues( const double present_time, - const double present_timestep) : - Function(dim), - velocity(.1), - present_time(present_time), - present_timestep(present_timestep) + const double present_timestep) + : Function(dim) + , velocity(.1) + , present_time(present_time) + , present_timestep(present_timestep) {} template void @@ -302,19 +303,19 @@ namespace Step18 get_stress_strain_tensor(/*lambda = */ 9.695e10, /*mu = */ 7.617e10); template - TopLevel::TopLevel() : - triangulation(MPI_COMM_WORLD, - ::Triangulation::none, - false, - parallel::shared::Triangulation::partition_zorder), - fe(FE_Q(1), dim), - dof_handler(triangulation), - quadrature_formula(2), - mpi_communicator(MPI_COMM_WORLD), - n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)), - this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)), - pcout(std::cout, this_mpi_process == 0), - monitored_vertex_first_dof(0) + TopLevel::TopLevel() + : triangulation(MPI_COMM_WORLD, + ::Triangulation::none, + false, + parallel::shared::Triangulation::partition_zorder) + , fe(FE_Q(1), dim) + , dof_handler(triangulation) + , quadrature_formula(2) + , mpi_communicator(MPI_COMM_WORLD) + , n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)) + , this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)) + , pcout(std::cout, this_mpi_process == 0) + , monitored_vertex_first_dof(0) {} template TopLevel::~TopLevel() @@ -425,10 +426,9 @@ namespace Step18 for (unsigned int j = 0; j < dofs_per_cell; ++j) for (unsigned int q_point = 0; q_point < n_q_points; ++q_point) { - const SymmetricTensor<2, dim> eps_phi_i = get_strain( - fe_values, i, q_point), - eps_phi_j = get_strain( - fe_values, j, q_point); + const SymmetricTensor<2, dim> + eps_phi_i = get_strain(fe_values, i, q_point), + eps_phi_j = get_strain(fe_values, j, q_point); cell_matrix(i, j) += (eps_phi_i * stress_strain_tensor * eps_phi_j * fe_values.JxW(q_point)); } @@ -462,8 +462,10 @@ namespace Step18 system_rhs.compress(VectorOperation::add); FEValuesExtractors::Scalar z_component(dim - 1); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction(dim), boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction(dim), + boundary_values); VectorTools::interpolate_boundary_values( dof_handler, 1, @@ -496,8 +498,10 @@ namespace Step18 PETScWrappers::MPI::Vector distributed_incremental_displacement( locally_owned_dofs, mpi_communicator); distributed_incremental_displacement = incremental_displacement; - SolverControl solver_control( - dof_handler.n_dofs(), 1e-16 * system_rhs.l2_norm(), false, false); + SolverControl solver_control(dof_handler.n_dofs(), + 1e-16 * system_rhs.l2_norm(), + false, + false); PETScWrappers::SolverCG cg(solver_control, mpi_communicator); PETScWrappers::PreconditionBlockJacobi preconditioner(system_matrix); cg.solve(system_matrix, @@ -687,8 +691,10 @@ namespace Step18 distributed_error_per_cell(i) = error_per_cell(i); distributed_error_per_cell.compress(VectorOperation::insert); error_per_cell = distributed_error_per_cell; - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, error_per_cell, 0.25, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + error_per_cell, + 0.25, + 0.03); triangulation.execute_coarsening_and_refinement(); setup_quadrature_point_history(); } @@ -747,8 +753,9 @@ namespace Step18 void TopLevel::update_quadrature_point_history() { - FEValues fe_values( - fe, quadrature_formula, update_values | update_gradients); + FEValues fe_values(fe, + quadrature_formula, + update_values | update_gradients); std::vector>> displacement_increment_grads( quadrature_formula.size(), std::vector>(dim)); for (typename DoFHandler::active_cell_iterator cell = diff --git a/tests/physics/step-44-standard_tensors-material_push_forward.cc b/tests/physics/step-44-standard_tensors-material_push_forward.cc index 7bcebc1380..b41bdcd6f3 100644 --- a/tests/physics/step-44-standard_tensors-material_push_forward.cc +++ b/tests/physics/step-44-standard_tensors-material_push_forward.cc @@ -166,8 +166,10 @@ namespace Step44 "0.4999", Patterns::Double(-1.0, 0.5), "Poisson's ratio"); - prm.declare_entry( - "Shear modulus", "80.194e6", Patterns::Double(), "Shear modulus"); + prm.declare_entry("Shear modulus", + "80.194e6", + Patterns::Double(), + "Shear modulus"); } prm.leave_subsection(); } @@ -297,8 +299,10 @@ namespace Step44 prm.enter_subsection("Time"); { prm.declare_entry("End time", "1", Patterns::Double(), "End time"); - prm.declare_entry( - "Time step size", "0.1", Patterns::Double(), "Time step size"); + prm.declare_entry("Time step size", + "0.1", + Patterns::Double(), + "Time step size"); } prm.leave_subsection(); } @@ -356,11 +360,11 @@ namespace Step44 class Time { public: - Time(const double time_end, const double delta_t) : - timestep(0), - time_current(0.0), - time_end(time_end), - delta_t(delta_t) + Time(const double time_end, const double delta_t) + : timestep(0) + , time_current(0.0) + , time_end(time_end) + , delta_t(delta_t) {} virtual ~Time() {} @@ -401,15 +405,14 @@ namespace Step44 class Material_Compressible_Neo_Hook_Three_Field { public: - Material_Compressible_Neo_Hook_Three_Field(const double mu, - const double nu) : - kappa((2.0 * mu * (1.0 + nu)) / (3.0 * (1.0 - 2.0 * nu))), - c_1(mu / 2.0), - p_tilde(0.0), - J_tilde(1.0), - det_F(1.0), - F(Physics::Elasticity::StandardTensors::I), - C_inv(Physics::Elasticity::StandardTensors::I) + Material_Compressible_Neo_Hook_Three_Field(const double mu, const double nu) + : kappa((2.0 * mu * (1.0 + nu)) / (3.0 * (1.0 - 2.0 * nu))) + , c_1(mu / 2.0) + , p_tilde(0.0) + , J_tilde(1.0) + , det_F(1.0) + , F(Physics::Elasticity::StandardTensors::I) + , C_inv(Physics::Elasticity::StandardTensors::I) { Assert(kappa > 0, ExcInternalError()); } @@ -715,20 +718,21 @@ namespace Step44 class PointHistory { public: - PointHistory() : - F_inv(Physics::Elasticity::StandardTensors::I), - tau(SymmetricTensor<2, dim>()), - d2Psi_vol_dJ2(0.0), - dPsi_vol_dJ(0.0), - Jc(SymmetricTensor<4, dim>()) + PointHistory() + : F_inv(Physics::Elasticity::StandardTensors::I) + , tau(SymmetricTensor<2, dim>()) + , d2Psi_vol_dJ2(0.0) + , dPsi_vol_dJ(0.0) + , Jc(SymmetricTensor<4, dim>()) {} virtual ~PointHistory() {} void setup_lqp(const Parameters::AllParameters ¶meters) { - material.reset(new Material_Compressible_Neo_Hook_Three_Field( - parameters.mu, parameters.nu)); + material.reset( + new Material_Compressible_Neo_Hook_Three_Field(parameters.mu, + parameters.nu)); update_values(Tensor<2, dim>(), 0.0, 1.0); } void @@ -908,7 +912,11 @@ namespace Step44 ConditionalOStream pcout; struct Errors { - Errors() : norm(1.0), u(1.0), p(1.0), J(1.0) + Errors() + : norm(1.0) + , u(1.0) + , p(1.0) + , J(1.0) {} void reset() @@ -949,29 +957,30 @@ namespace Step44 print_conv_footer(); }; template - Solid::Solid(const std::string &input_file) : - parameters(input_file), - triangulation(Triangulation::maximum_smoothing), - time(parameters.end_time, parameters.delta_t), - timer(std::cout, TimerOutput::never, TimerOutput::wall_times), - degree(parameters.poly_degree), - fe(FE_Q(parameters.poly_degree), - dim, // displacement - FE_DGPMonomial(parameters.poly_degree - 1), - 1, // pressure - FE_DGPMonomial(parameters.poly_degree - 1), - 1), // dilatation - dof_handler_ref(triangulation), - dofs_per_cell(fe.dofs_per_cell), - u_fe(first_u_component), - p_fe(p_component), - J_fe(J_component), - dofs_per_block(n_blocks), - qf_cell(parameters.quad_order), - qf_face(parameters.quad_order), - n_q_points(qf_cell.size()), - n_q_points_f(qf_face.size()), - pcout(std::cout) + Solid::Solid(const std::string &input_file) + : parameters(input_file) + , triangulation(Triangulation::maximum_smoothing) + , time(parameters.end_time, parameters.delta_t) + , timer(std::cout, TimerOutput::never, TimerOutput::wall_times) + , degree(parameters.poly_degree) + , fe(FE_Q(parameters.poly_degree), + dim, // displacement + FE_DGPMonomial(parameters.poly_degree - 1), + 1, // pressure + FE_DGPMonomial(parameters.poly_degree - 1), + 1) + , // dilatation + dof_handler_ref(triangulation) + , dofs_per_cell(fe.dofs_per_cell) + , u_fe(first_u_component) + , p_fe(p_component) + , J_fe(J_component) + , dofs_per_block(n_blocks) + , qf_cell(parameters.quad_order) + , qf_face(parameters.quad_order) + , n_q_points(qf_cell.size()) + , n_q_points_f(qf_face.size()) + , pcout(std::cout) { Assert(dim == 2 || dim == 3, ExcMessage("This problem only works in 2 or 3 space dimensions.")); @@ -1035,9 +1044,9 @@ namespace Step44 { FullMatrix cell_matrix; std::vector local_dof_indices; - PerTaskData_K(const unsigned int dofs_per_cell) : - cell_matrix(dofs_per_cell, dofs_per_cell), - local_dof_indices(dofs_per_cell) + PerTaskData_K(const unsigned int dofs_per_cell) + : cell_matrix(dofs_per_cell, dofs_per_cell) + , local_dof_indices(dofs_per_cell) {} void reset() @@ -1054,21 +1063,22 @@ namespace Step44 std::vector>> symm_grad_Nx; ScratchData_K(const FiniteElement &fe_cell, const QGauss & qf_cell, - const UpdateFlags uf_cell) : - fe_values_ref(fe_cell, qf_cell, uf_cell), - Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)), - grad_Nx(qf_cell.size(), - std::vector>(fe_cell.dofs_per_cell)), - symm_grad_Nx(qf_cell.size(), - std::vector>(fe_cell.dofs_per_cell)) + const UpdateFlags uf_cell) + : fe_values_ref(fe_cell, qf_cell, uf_cell) + , Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)) + , grad_Nx(qf_cell.size(), + std::vector>(fe_cell.dofs_per_cell)) + , symm_grad_Nx(qf_cell.size(), + std::vector>( + fe_cell.dofs_per_cell)) {} - ScratchData_K(const ScratchData_K &rhs) : - fe_values_ref(rhs.fe_values_ref.get_fe(), - rhs.fe_values_ref.get_quadrature(), - rhs.fe_values_ref.get_update_flags()), - Nx(rhs.Nx), - grad_Nx(rhs.grad_Nx), - symm_grad_Nx(rhs.symm_grad_Nx) + ScratchData_K(const ScratchData_K &rhs) + : fe_values_ref(rhs.fe_values_ref.get_fe(), + rhs.fe_values_ref.get_quadrature(), + rhs.fe_values_ref.get_update_flags()) + , Nx(rhs.Nx) + , grad_Nx(rhs.grad_Nx) + , symm_grad_Nx(rhs.symm_grad_Nx) {} void reset() @@ -1096,9 +1106,9 @@ namespace Step44 { Vector cell_rhs; std::vector local_dof_indices; - PerTaskData_RHS(const unsigned int dofs_per_cell) : - cell_rhs(dofs_per_cell), - local_dof_indices(dofs_per_cell) + PerTaskData_RHS(const unsigned int dofs_per_cell) + : cell_rhs(dofs_per_cell) + , local_dof_indices(dofs_per_cell) {} void reset() @@ -1117,22 +1127,23 @@ namespace Step44 const QGauss & qf_cell, const UpdateFlags uf_cell, const QGauss & qf_face, - const UpdateFlags uf_face) : - fe_values_ref(fe_cell, qf_cell, uf_cell), - fe_face_values_ref(fe_cell, qf_face, uf_face), - Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)), - symm_grad_Nx(qf_cell.size(), - std::vector>(fe_cell.dofs_per_cell)) + const UpdateFlags uf_face) + : fe_values_ref(fe_cell, qf_cell, uf_cell) + , fe_face_values_ref(fe_cell, qf_face, uf_face) + , Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)) + , symm_grad_Nx(qf_cell.size(), + std::vector>( + fe_cell.dofs_per_cell)) {} - ScratchData_RHS(const ScratchData_RHS &rhs) : - fe_values_ref(rhs.fe_values_ref.get_fe(), - rhs.fe_values_ref.get_quadrature(), - rhs.fe_values_ref.get_update_flags()), - fe_face_values_ref(rhs.fe_face_values_ref.get_fe(), - rhs.fe_face_values_ref.get_quadrature(), - rhs.fe_face_values_ref.get_update_flags()), - Nx(rhs.Nx), - symm_grad_Nx(rhs.symm_grad_Nx) + ScratchData_RHS(const ScratchData_RHS &rhs) + : fe_values_ref(rhs.fe_values_ref.get_fe(), + rhs.fe_values_ref.get_quadrature(), + rhs.fe_values_ref.get_update_flags()) + , fe_face_values_ref(rhs.fe_face_values_ref.get_fe(), + rhs.fe_face_values_ref.get_quadrature(), + rhs.fe_face_values_ref.get_update_flags()) + , Nx(rhs.Nx) + , symm_grad_Nx(rhs.symm_grad_Nx) {} void reset() @@ -1169,18 +1180,18 @@ namespace Step44 PerTaskData_SC(const unsigned int dofs_per_cell, const unsigned int n_u, const unsigned int n_p, - const unsigned int n_J) : - cell_matrix(dofs_per_cell, dofs_per_cell), - local_dof_indices(dofs_per_cell), - k_orig(dofs_per_cell, dofs_per_cell), - k_pu(n_p, n_u), - k_pJ(n_p, n_J), - k_JJ(n_J, n_J), - k_pJ_inv(n_p, n_J), - k_bbar(n_u, n_u), - A(n_J, n_u), - B(n_J, n_u), - C(n_p, n_u) + const unsigned int n_J) + : cell_matrix(dofs_per_cell, dofs_per_cell) + , local_dof_indices(dofs_per_cell) + , k_orig(dofs_per_cell, dofs_per_cell) + , k_pu(n_p, n_u) + , k_pJ(n_p, n_J) + , k_JJ(n_J, n_J) + , k_pJ_inv(n_p, n_J) + , k_bbar(n_u, n_u) + , A(n_J, n_u) + , B(n_J, n_u) + , C(n_p, n_u) {} void reset() @@ -1211,21 +1222,21 @@ namespace Step44 ScratchData_UQPH(const FiniteElement & fe_cell, const QGauss & qf_cell, const UpdateFlags uf_cell, - const BlockVector &solution_total) : - solution_total(solution_total), - solution_grads_u_total(qf_cell.size()), - solution_values_p_total(qf_cell.size()), - solution_values_J_total(qf_cell.size()), - fe_values_ref(fe_cell, qf_cell, uf_cell) + const BlockVector &solution_total) + : solution_total(solution_total) + , solution_grads_u_total(qf_cell.size()) + , solution_values_p_total(qf_cell.size()) + , solution_values_J_total(qf_cell.size()) + , fe_values_ref(fe_cell, qf_cell, uf_cell) {} - ScratchData_UQPH(const ScratchData_UQPH &rhs) : - solution_total(rhs.solution_total), - solution_grads_u_total(rhs.solution_grads_u_total), - solution_values_p_total(rhs.solution_values_p_total), - solution_values_J_total(rhs.solution_values_J_total), - fe_values_ref(rhs.fe_values_ref.get_fe(), - rhs.fe_values_ref.get_quadrature(), - rhs.fe_values_ref.get_update_flags()) + ScratchData_UQPH(const ScratchData_UQPH &rhs) + : solution_total(rhs.solution_total) + , solution_grads_u_total(rhs.solution_grads_u_total) + , solution_values_p_total(rhs.solution_values_p_total) + , solution_values_J_total(rhs.solution_values_J_total) + , fe_values_ref(rhs.fe_values_ref.get_fe(), + rhs.fe_values_ref.get_quadrature(), + rhs.fe_values_ref.get_update_flags()) {} void reset() @@ -1289,8 +1300,9 @@ namespace Step44 dof_handler_ref.distribute_dofs(fe); DoFRenumbering::Cuthill_McKee(dof_handler_ref); DoFRenumbering::component_wise(dof_handler_ref, block_component); - DoFTools::count_dofs_per_block( - dof_handler_ref, dofs_per_block, block_component); + DoFTools::count_dofs_per_block(dof_handler_ref, + dofs_per_block, + block_component); pcout << "Triangulation:" << "\n\t Number of active cells: " << triangulation.n_active_cells() << "\n\t Number of degrees of freedom: " << dof_handler_ref.n_dofs() @@ -1359,8 +1371,9 @@ namespace Step44 Solid::setup_qph() { pcout << " Setting up quadrature point data..." << std::endl; - quadrature_point_history.initialize( - triangulation.begin_active(), triangulation.end(), n_q_points); + quadrature_point_history.initialize(triangulation.begin_active(), + triangulation.end(), + n_q_points); for (typename Triangulation::active_cell_iterator cell = triangulation.begin_active(); cell != triangulation.end(); @@ -2034,24 +2047,30 @@ namespace Step44 data.reset(); scratch.reset(); cell->get_dof_indices(data.local_dof_indices); - data.k_orig.extract_submatrix_from( - tangent_matrix, data.local_dof_indices, data.local_dof_indices); - data.k_pu.extract_submatrix_from( - data.k_orig, element_indices_p, element_indices_u); - data.k_pJ.extract_submatrix_from( - data.k_orig, element_indices_p, element_indices_J); - data.k_JJ.extract_submatrix_from( - data.k_orig, element_indices_J, element_indices_J); + data.k_orig.extract_submatrix_from(tangent_matrix, + data.local_dof_indices, + data.local_dof_indices); + data.k_pu.extract_submatrix_from(data.k_orig, + element_indices_p, + element_indices_u); + data.k_pJ.extract_submatrix_from(data.k_orig, + element_indices_p, + element_indices_J); + data.k_JJ.extract_submatrix_from(data.k_orig, + element_indices_J, + element_indices_J); data.k_pJ_inv.invert(data.k_pJ); data.k_pJ_inv.mmult(data.A, data.k_pu); data.k_JJ.mmult(data.B, data.A); data.k_pJ_inv.Tmmult(data.C, data.B); data.k_pu.Tmmult(data.k_bbar, data.C); - data.k_bbar.scatter_matrix_to( - element_indices_u, element_indices_u, data.cell_matrix); + data.k_bbar.scatter_matrix_to(element_indices_u, + element_indices_u, + data.cell_matrix); data.k_pJ_inv.add(-1.0, data.k_pJ); - data.k_pJ_inv.scatter_matrix_to( - element_indices_p, element_indices_J, data.cell_matrix); + data.k_pJ_inv.scatter_matrix_to(element_indices_p, + element_indices_J, + data.cell_matrix); } template std::pair @@ -2188,8 +2207,10 @@ namespace Step44 SolverSelector> solver_K_con_inv; solver_K_con_inv.select("cg"); solver_K_con_inv.set_control(solver_control_K_con_inv); - const auto K_uu_con_inv = inverse_operator( - K_uu_con, solver_K_con_inv, preconditioner_K_con_inv); + const auto K_uu_con_inv = + inverse_operator(K_uu_con, + solver_K_con_inv, + preconditioner_K_con_inv); d_u = K_uu_con_inv * (f_u - K_up * (K_Jp_inv * f_J - K_pp_bar * f_p)); timer.leave_subsection(); diff --git a/tests/physics/step-44-standard_tensors-spatial.cc b/tests/physics/step-44-standard_tensors-spatial.cc index 6b66635826..267a9306f0 100644 --- a/tests/physics/step-44-standard_tensors-spatial.cc +++ b/tests/physics/step-44-standard_tensors-spatial.cc @@ -164,8 +164,10 @@ namespace Step44 "0.4999", Patterns::Double(-1.0, 0.5), "Poisson's ratio"); - prm.declare_entry( - "Shear modulus", "80.194e6", Patterns::Double(), "Shear modulus"); + prm.declare_entry("Shear modulus", + "80.194e6", + Patterns::Double(), + "Shear modulus"); } prm.leave_subsection(); } @@ -295,8 +297,10 @@ namespace Step44 prm.enter_subsection("Time"); { prm.declare_entry("End time", "1", Patterns::Double(), "End time"); - prm.declare_entry( - "Time step size", "0.1", Patterns::Double(), "Time step size"); + prm.declare_entry("Time step size", + "0.1", + Patterns::Double(), + "Time step size"); } prm.leave_subsection(); } @@ -354,11 +358,11 @@ namespace Step44 class Time { public: - Time(const double time_end, const double delta_t) : - timestep(0), - time_current(0.0), - time_end(time_end), - delta_t(delta_t) + Time(const double time_end, const double delta_t) + : timestep(0) + , time_current(0.0) + , time_end(time_end) + , delta_t(delta_t) {} virtual ~Time() {} @@ -399,14 +403,13 @@ namespace Step44 class Material_Compressible_Neo_Hook_Three_Field { public: - Material_Compressible_Neo_Hook_Three_Field(const double mu, - const double nu) : - kappa((2.0 * mu * (1.0 + nu)) / (3.0 * (1.0 - 2.0 * nu))), - c_1(mu / 2.0), - det_F(1.0), - p_tilde(0.0), - J_tilde(1.0), - b_bar(Physics::Elasticity::StandardTensors::I) + Material_Compressible_Neo_Hook_Three_Field(const double mu, const double nu) + : kappa((2.0 * mu * (1.0 + nu)) / (3.0 * (1.0 - 2.0 * nu))) + , c_1(mu / 2.0) + , det_F(1.0) + , p_tilde(0.0) + , J_tilde(1.0) + , b_bar(Physics::Elasticity::StandardTensors::I) { Assert(kappa > 0, ExcInternalError()); } @@ -515,20 +518,21 @@ namespace Step44 class PointHistory { public: - PointHistory() : - F_inv(Physics::Elasticity::StandardTensors::I), - tau(SymmetricTensor<2, dim>()), - d2Psi_vol_dJ2(0.0), - dPsi_vol_dJ(0.0), - Jc(SymmetricTensor<4, dim>()) + PointHistory() + : F_inv(Physics::Elasticity::StandardTensors::I) + , tau(SymmetricTensor<2, dim>()) + , d2Psi_vol_dJ2(0.0) + , dPsi_vol_dJ(0.0) + , Jc(SymmetricTensor<4, dim>()) {} virtual ~PointHistory() {} void setup_lqp(const Parameters::AllParameters ¶meters) { - material.reset(new Material_Compressible_Neo_Hook_Three_Field( - parameters.mu, parameters.nu)); + material.reset( + new Material_Compressible_Neo_Hook_Three_Field(parameters.mu, + parameters.nu)); update_values(Tensor<2, dim>(), 0.0, 1.0); } void @@ -708,7 +712,11 @@ namespace Step44 ConditionalOStream pcout; struct Errors { - Errors() : norm(1.0), u(1.0), p(1.0), J(1.0) + Errors() + : norm(1.0) + , u(1.0) + , p(1.0) + , J(1.0) {} void reset() @@ -749,29 +757,30 @@ namespace Step44 print_conv_footer(); }; template - Solid::Solid(const std::string &input_file) : - parameters(input_file), - triangulation(Triangulation::maximum_smoothing), - time(parameters.end_time, parameters.delta_t), - timer(std::cout, TimerOutput::never, TimerOutput::wall_times), - degree(parameters.poly_degree), - fe(FE_Q(parameters.poly_degree), - dim, // displacement - FE_DGPMonomial(parameters.poly_degree - 1), - 1, // pressure - FE_DGPMonomial(parameters.poly_degree - 1), - 1), // dilatation - dof_handler_ref(triangulation), - dofs_per_cell(fe.dofs_per_cell), - u_fe(first_u_component), - p_fe(p_component), - J_fe(J_component), - dofs_per_block(n_blocks), - qf_cell(parameters.quad_order), - qf_face(parameters.quad_order), - n_q_points(qf_cell.size()), - n_q_points_f(qf_face.size()), - pcout(std::cout) + Solid::Solid(const std::string &input_file) + : parameters(input_file) + , triangulation(Triangulation::maximum_smoothing) + , time(parameters.end_time, parameters.delta_t) + , timer(std::cout, TimerOutput::never, TimerOutput::wall_times) + , degree(parameters.poly_degree) + , fe(FE_Q(parameters.poly_degree), + dim, // displacement + FE_DGPMonomial(parameters.poly_degree - 1), + 1, // pressure + FE_DGPMonomial(parameters.poly_degree - 1), + 1) + , // dilatation + dof_handler_ref(triangulation) + , dofs_per_cell(fe.dofs_per_cell) + , u_fe(first_u_component) + , p_fe(p_component) + , J_fe(J_component) + , dofs_per_block(n_blocks) + , qf_cell(parameters.quad_order) + , qf_face(parameters.quad_order) + , n_q_points(qf_cell.size()) + , n_q_points_f(qf_face.size()) + , pcout(std::cout) { Assert(dim == 2 || dim == 3, ExcMessage("This problem only works in 2 or 3 space dimensions.")); @@ -835,9 +844,9 @@ namespace Step44 { FullMatrix cell_matrix; std::vector local_dof_indices; - PerTaskData_K(const unsigned int dofs_per_cell) : - cell_matrix(dofs_per_cell, dofs_per_cell), - local_dof_indices(dofs_per_cell) + PerTaskData_K(const unsigned int dofs_per_cell) + : cell_matrix(dofs_per_cell, dofs_per_cell) + , local_dof_indices(dofs_per_cell) {} void reset() @@ -854,21 +863,22 @@ namespace Step44 std::vector>> symm_grad_Nx; ScratchData_K(const FiniteElement &fe_cell, const QGauss & qf_cell, - const UpdateFlags uf_cell) : - fe_values_ref(fe_cell, qf_cell, uf_cell), - Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)), - grad_Nx(qf_cell.size(), - std::vector>(fe_cell.dofs_per_cell)), - symm_grad_Nx(qf_cell.size(), - std::vector>(fe_cell.dofs_per_cell)) + const UpdateFlags uf_cell) + : fe_values_ref(fe_cell, qf_cell, uf_cell) + , Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)) + , grad_Nx(qf_cell.size(), + std::vector>(fe_cell.dofs_per_cell)) + , symm_grad_Nx(qf_cell.size(), + std::vector>( + fe_cell.dofs_per_cell)) {} - ScratchData_K(const ScratchData_K &rhs) : - fe_values_ref(rhs.fe_values_ref.get_fe(), - rhs.fe_values_ref.get_quadrature(), - rhs.fe_values_ref.get_update_flags()), - Nx(rhs.Nx), - grad_Nx(rhs.grad_Nx), - symm_grad_Nx(rhs.symm_grad_Nx) + ScratchData_K(const ScratchData_K &rhs) + : fe_values_ref(rhs.fe_values_ref.get_fe(), + rhs.fe_values_ref.get_quadrature(), + rhs.fe_values_ref.get_update_flags()) + , Nx(rhs.Nx) + , grad_Nx(rhs.grad_Nx) + , symm_grad_Nx(rhs.symm_grad_Nx) {} void reset() @@ -896,9 +906,9 @@ namespace Step44 { Vector cell_rhs; std::vector local_dof_indices; - PerTaskData_RHS(const unsigned int dofs_per_cell) : - cell_rhs(dofs_per_cell), - local_dof_indices(dofs_per_cell) + PerTaskData_RHS(const unsigned int dofs_per_cell) + : cell_rhs(dofs_per_cell) + , local_dof_indices(dofs_per_cell) {} void reset() @@ -917,22 +927,23 @@ namespace Step44 const QGauss & qf_cell, const UpdateFlags uf_cell, const QGauss & qf_face, - const UpdateFlags uf_face) : - fe_values_ref(fe_cell, qf_cell, uf_cell), - fe_face_values_ref(fe_cell, qf_face, uf_face), - Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)), - symm_grad_Nx(qf_cell.size(), - std::vector>(fe_cell.dofs_per_cell)) + const UpdateFlags uf_face) + : fe_values_ref(fe_cell, qf_cell, uf_cell) + , fe_face_values_ref(fe_cell, qf_face, uf_face) + , Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)) + , symm_grad_Nx(qf_cell.size(), + std::vector>( + fe_cell.dofs_per_cell)) {} - ScratchData_RHS(const ScratchData_RHS &rhs) : - fe_values_ref(rhs.fe_values_ref.get_fe(), - rhs.fe_values_ref.get_quadrature(), - rhs.fe_values_ref.get_update_flags()), - fe_face_values_ref(rhs.fe_face_values_ref.get_fe(), - rhs.fe_face_values_ref.get_quadrature(), - rhs.fe_face_values_ref.get_update_flags()), - Nx(rhs.Nx), - symm_grad_Nx(rhs.symm_grad_Nx) + ScratchData_RHS(const ScratchData_RHS &rhs) + : fe_values_ref(rhs.fe_values_ref.get_fe(), + rhs.fe_values_ref.get_quadrature(), + rhs.fe_values_ref.get_update_flags()) + , fe_face_values_ref(rhs.fe_face_values_ref.get_fe(), + rhs.fe_face_values_ref.get_quadrature(), + rhs.fe_face_values_ref.get_update_flags()) + , Nx(rhs.Nx) + , symm_grad_Nx(rhs.symm_grad_Nx) {} void reset() @@ -969,18 +980,18 @@ namespace Step44 PerTaskData_SC(const unsigned int dofs_per_cell, const unsigned int n_u, const unsigned int n_p, - const unsigned int n_J) : - cell_matrix(dofs_per_cell, dofs_per_cell), - local_dof_indices(dofs_per_cell), - k_orig(dofs_per_cell, dofs_per_cell), - k_pu(n_p, n_u), - k_pJ(n_p, n_J), - k_JJ(n_J, n_J), - k_pJ_inv(n_p, n_J), - k_bbar(n_u, n_u), - A(n_J, n_u), - B(n_J, n_u), - C(n_p, n_u) + const unsigned int n_J) + : cell_matrix(dofs_per_cell, dofs_per_cell) + , local_dof_indices(dofs_per_cell) + , k_orig(dofs_per_cell, dofs_per_cell) + , k_pu(n_p, n_u) + , k_pJ(n_p, n_J) + , k_JJ(n_J, n_J) + , k_pJ_inv(n_p, n_J) + , k_bbar(n_u, n_u) + , A(n_J, n_u) + , B(n_J, n_u) + , C(n_p, n_u) {} void reset() @@ -1011,21 +1022,21 @@ namespace Step44 ScratchData_UQPH(const FiniteElement & fe_cell, const QGauss & qf_cell, const UpdateFlags uf_cell, - const BlockVector &solution_total) : - solution_total(solution_total), - solution_grads_u_total(qf_cell.size()), - solution_values_p_total(qf_cell.size()), - solution_values_J_total(qf_cell.size()), - fe_values_ref(fe_cell, qf_cell, uf_cell) + const BlockVector &solution_total) + : solution_total(solution_total) + , solution_grads_u_total(qf_cell.size()) + , solution_values_p_total(qf_cell.size()) + , solution_values_J_total(qf_cell.size()) + , fe_values_ref(fe_cell, qf_cell, uf_cell) {} - ScratchData_UQPH(const ScratchData_UQPH &rhs) : - solution_total(rhs.solution_total), - solution_grads_u_total(rhs.solution_grads_u_total), - solution_values_p_total(rhs.solution_values_p_total), - solution_values_J_total(rhs.solution_values_J_total), - fe_values_ref(rhs.fe_values_ref.get_fe(), - rhs.fe_values_ref.get_quadrature(), - rhs.fe_values_ref.get_update_flags()) + ScratchData_UQPH(const ScratchData_UQPH &rhs) + : solution_total(rhs.solution_total) + , solution_grads_u_total(rhs.solution_grads_u_total) + , solution_values_p_total(rhs.solution_values_p_total) + , solution_values_J_total(rhs.solution_values_J_total) + , fe_values_ref(rhs.fe_values_ref.get_fe(), + rhs.fe_values_ref.get_quadrature(), + rhs.fe_values_ref.get_update_flags()) {} void reset() @@ -1089,8 +1100,9 @@ namespace Step44 dof_handler_ref.distribute_dofs(fe); DoFRenumbering::Cuthill_McKee(dof_handler_ref); DoFRenumbering::component_wise(dof_handler_ref, block_component); - DoFTools::count_dofs_per_block( - dof_handler_ref, dofs_per_block, block_component); + DoFTools::count_dofs_per_block(dof_handler_ref, + dofs_per_block, + block_component); pcout << "Triangulation:" << "\n\t Number of active cells: " << triangulation.n_active_cells() << "\n\t Number of degrees of freedom: " << dof_handler_ref.n_dofs() @@ -1159,8 +1171,9 @@ namespace Step44 Solid::setup_qph() { pcout << " Setting up quadrature point data..." << std::endl; - quadrature_point_history.initialize( - triangulation.begin_active(), triangulation.end(), n_q_points); + quadrature_point_history.initialize(triangulation.begin_active(), + triangulation.end(), + n_q_points); for (typename Triangulation::active_cell_iterator cell = triangulation.begin_active(); cell != triangulation.end(); @@ -1834,24 +1847,30 @@ namespace Step44 data.reset(); scratch.reset(); cell->get_dof_indices(data.local_dof_indices); - data.k_orig.extract_submatrix_from( - tangent_matrix, data.local_dof_indices, data.local_dof_indices); - data.k_pu.extract_submatrix_from( - data.k_orig, element_indices_p, element_indices_u); - data.k_pJ.extract_submatrix_from( - data.k_orig, element_indices_p, element_indices_J); - data.k_JJ.extract_submatrix_from( - data.k_orig, element_indices_J, element_indices_J); + data.k_orig.extract_submatrix_from(tangent_matrix, + data.local_dof_indices, + data.local_dof_indices); + data.k_pu.extract_submatrix_from(data.k_orig, + element_indices_p, + element_indices_u); + data.k_pJ.extract_submatrix_from(data.k_orig, + element_indices_p, + element_indices_J); + data.k_JJ.extract_submatrix_from(data.k_orig, + element_indices_J, + element_indices_J); data.k_pJ_inv.invert(data.k_pJ); data.k_pJ_inv.mmult(data.A, data.k_pu); data.k_JJ.mmult(data.B, data.A); data.k_pJ_inv.Tmmult(data.C, data.B); data.k_pu.Tmmult(data.k_bbar, data.C); - data.k_bbar.scatter_matrix_to( - element_indices_u, element_indices_u, data.cell_matrix); + data.k_bbar.scatter_matrix_to(element_indices_u, + element_indices_u, + data.cell_matrix); data.k_pJ_inv.add(-1.0, data.k_pJ); - data.k_pJ_inv.scatter_matrix_to( - element_indices_p, element_indices_J, data.cell_matrix); + data.k_pJ_inv.scatter_matrix_to(element_indices_p, + element_indices_J, + data.cell_matrix); } template std::pair @@ -1988,8 +2007,10 @@ namespace Step44 SolverSelector> solver_K_con_inv; solver_K_con_inv.select("cg"); solver_K_con_inv.set_control(solver_control_K_con_inv); - const auto K_uu_con_inv = inverse_operator( - K_uu_con, solver_K_con_inv, preconditioner_K_con_inv); + const auto K_uu_con_inv = + inverse_operator(K_uu_con, + solver_K_con_inv, + preconditioner_K_con_inv); d_u = K_uu_con_inv * (f_u - K_up * (K_Jp_inv * f_J - K_pp_bar * f_p)); timer.leave_subsection(); diff --git a/tests/physics/step-44.cc b/tests/physics/step-44.cc index e76d986e63..6cb1378c73 100644 --- a/tests/physics/step-44.cc +++ b/tests/physics/step-44.cc @@ -160,8 +160,10 @@ namespace Step44 "0.4999", Patterns::Double(-1.0, 0.5), "Poisson's ratio"); - prm.declare_entry( - "Shear modulus", "80.194e6", Patterns::Double(), "Shear modulus"); + prm.declare_entry("Shear modulus", + "80.194e6", + Patterns::Double(), + "Shear modulus"); } prm.leave_subsection(); } @@ -291,8 +293,10 @@ namespace Step44 prm.enter_subsection("Time"); { prm.declare_entry("End time", "1", Patterns::Double(), "End time"); - prm.declare_entry( - "Time step size", "0.1", Patterns::Double(), "Time step size"); + prm.declare_entry("Time step size", + "0.1", + Patterns::Double(), + "Time step size"); } prm.leave_subsection(); } @@ -370,11 +374,11 @@ namespace Step44 class Time { public: - Time(const double time_end, const double delta_t) : - timestep(0), - time_current(0.0), - time_end(time_end), - delta_t(delta_t) + Time(const double time_end, const double delta_t) + : timestep(0) + , time_current(0.0) + , time_end(time_end) + , delta_t(delta_t) {} virtual ~Time() {} @@ -415,14 +419,13 @@ namespace Step44 class Material_Compressible_Neo_Hook_Three_Field { public: - Material_Compressible_Neo_Hook_Three_Field(const double mu, - const double nu) : - kappa((2.0 * mu * (1.0 + nu)) / (3.0 * (1.0 - 2.0 * nu))), - c_1(mu / 2.0), - det_F(1.0), - p_tilde(0.0), - J_tilde(1.0), - b_bar(StandardTensors::I) + Material_Compressible_Neo_Hook_Three_Field(const double mu, const double nu) + : kappa((2.0 * mu * (1.0 + nu)) / (3.0 * (1.0 - 2.0 * nu))) + , c_1(mu / 2.0) + , det_F(1.0) + , p_tilde(0.0) + , J_tilde(1.0) + , b_bar(StandardTensors::I) { Assert(kappa > 0, ExcInternalError()); } @@ -527,20 +530,21 @@ namespace Step44 class PointHistory { public: - PointHistory() : - F_inv(StandardTensors::I), - tau(SymmetricTensor<2, dim>()), - d2Psi_vol_dJ2(0.0), - dPsi_vol_dJ(0.0), - Jc(SymmetricTensor<4, dim>()) + PointHistory() + : F_inv(StandardTensors::I) + , tau(SymmetricTensor<2, dim>()) + , d2Psi_vol_dJ2(0.0) + , dPsi_vol_dJ(0.0) + , Jc(SymmetricTensor<4, dim>()) {} virtual ~PointHistory() {} void setup_lqp(const Parameters::AllParameters ¶meters) { - material.reset(new Material_Compressible_Neo_Hook_Three_Field( - parameters.mu, parameters.nu)); + material.reset( + new Material_Compressible_Neo_Hook_Three_Field(parameters.mu, + parameters.nu)); update_values(Tensor<2, dim>(), 0.0, 1.0); } void @@ -721,7 +725,11 @@ namespace Step44 ConditionalOStream pcout; struct Errors { - Errors() : norm(1.0), u(1.0), p(1.0), J(1.0) + Errors() + : norm(1.0) + , u(1.0) + , p(1.0) + , J(1.0) {} void reset() @@ -762,29 +770,30 @@ namespace Step44 print_conv_footer(); }; template - Solid::Solid(const std::string &input_file) : - parameters(input_file), - triangulation(Triangulation::maximum_smoothing), - time(parameters.end_time, parameters.delta_t), - timer(std::cout, TimerOutput::never, TimerOutput::wall_times), - degree(parameters.poly_degree), - fe(FE_Q(parameters.poly_degree), - dim, // displacement - FE_DGPMonomial(parameters.poly_degree - 1), - 1, // pressure - FE_DGPMonomial(parameters.poly_degree - 1), - 1), // dilatation - dof_handler_ref(triangulation), - dofs_per_cell(fe.dofs_per_cell), - u_fe(first_u_component), - p_fe(p_component), - J_fe(J_component), - dofs_per_block(n_blocks), - qf_cell(parameters.quad_order), - qf_face(parameters.quad_order), - n_q_points(qf_cell.size()), - n_q_points_f(qf_face.size()), - pcout(std::cout) + Solid::Solid(const std::string &input_file) + : parameters(input_file) + , triangulation(Triangulation::maximum_smoothing) + , time(parameters.end_time, parameters.delta_t) + , timer(std::cout, TimerOutput::never, TimerOutput::wall_times) + , degree(parameters.poly_degree) + , fe(FE_Q(parameters.poly_degree), + dim, // displacement + FE_DGPMonomial(parameters.poly_degree - 1), + 1, // pressure + FE_DGPMonomial(parameters.poly_degree - 1), + 1) + , // dilatation + dof_handler_ref(triangulation) + , dofs_per_cell(fe.dofs_per_cell) + , u_fe(first_u_component) + , p_fe(p_component) + , J_fe(J_component) + , dofs_per_block(n_blocks) + , qf_cell(parameters.quad_order) + , qf_face(parameters.quad_order) + , n_q_points(qf_cell.size()) + , n_q_points_f(qf_face.size()) + , pcout(std::cout) { Assert(dim == 2 || dim == 3, ExcMessage("This problem only works in 2 or 3 space dimensions.")); @@ -848,9 +857,9 @@ namespace Step44 { FullMatrix cell_matrix; std::vector local_dof_indices; - PerTaskData_K(const unsigned int dofs_per_cell) : - cell_matrix(dofs_per_cell, dofs_per_cell), - local_dof_indices(dofs_per_cell) + PerTaskData_K(const unsigned int dofs_per_cell) + : cell_matrix(dofs_per_cell, dofs_per_cell) + , local_dof_indices(dofs_per_cell) {} void reset() @@ -867,21 +876,22 @@ namespace Step44 std::vector>> symm_grad_Nx; ScratchData_K(const FiniteElement &fe_cell, const QGauss & qf_cell, - const UpdateFlags uf_cell) : - fe_values_ref(fe_cell, qf_cell, uf_cell), - Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)), - grad_Nx(qf_cell.size(), - std::vector>(fe_cell.dofs_per_cell)), - symm_grad_Nx(qf_cell.size(), - std::vector>(fe_cell.dofs_per_cell)) + const UpdateFlags uf_cell) + : fe_values_ref(fe_cell, qf_cell, uf_cell) + , Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)) + , grad_Nx(qf_cell.size(), + std::vector>(fe_cell.dofs_per_cell)) + , symm_grad_Nx(qf_cell.size(), + std::vector>( + fe_cell.dofs_per_cell)) {} - ScratchData_K(const ScratchData_K &rhs) : - fe_values_ref(rhs.fe_values_ref.get_fe(), - rhs.fe_values_ref.get_quadrature(), - rhs.fe_values_ref.get_update_flags()), - Nx(rhs.Nx), - grad_Nx(rhs.grad_Nx), - symm_grad_Nx(rhs.symm_grad_Nx) + ScratchData_K(const ScratchData_K &rhs) + : fe_values_ref(rhs.fe_values_ref.get_fe(), + rhs.fe_values_ref.get_quadrature(), + rhs.fe_values_ref.get_update_flags()) + , Nx(rhs.Nx) + , grad_Nx(rhs.grad_Nx) + , symm_grad_Nx(rhs.symm_grad_Nx) {} void reset() @@ -909,9 +919,9 @@ namespace Step44 { Vector cell_rhs; std::vector local_dof_indices; - PerTaskData_RHS(const unsigned int dofs_per_cell) : - cell_rhs(dofs_per_cell), - local_dof_indices(dofs_per_cell) + PerTaskData_RHS(const unsigned int dofs_per_cell) + : cell_rhs(dofs_per_cell) + , local_dof_indices(dofs_per_cell) {} void reset() @@ -930,22 +940,23 @@ namespace Step44 const QGauss & qf_cell, const UpdateFlags uf_cell, const QGauss & qf_face, - const UpdateFlags uf_face) : - fe_values_ref(fe_cell, qf_cell, uf_cell), - fe_face_values_ref(fe_cell, qf_face, uf_face), - Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)), - symm_grad_Nx(qf_cell.size(), - std::vector>(fe_cell.dofs_per_cell)) + const UpdateFlags uf_face) + : fe_values_ref(fe_cell, qf_cell, uf_cell) + , fe_face_values_ref(fe_cell, qf_face, uf_face) + , Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)) + , symm_grad_Nx(qf_cell.size(), + std::vector>( + fe_cell.dofs_per_cell)) {} - ScratchData_RHS(const ScratchData_RHS &rhs) : - fe_values_ref(rhs.fe_values_ref.get_fe(), - rhs.fe_values_ref.get_quadrature(), - rhs.fe_values_ref.get_update_flags()), - fe_face_values_ref(rhs.fe_face_values_ref.get_fe(), - rhs.fe_face_values_ref.get_quadrature(), - rhs.fe_face_values_ref.get_update_flags()), - Nx(rhs.Nx), - symm_grad_Nx(rhs.symm_grad_Nx) + ScratchData_RHS(const ScratchData_RHS &rhs) + : fe_values_ref(rhs.fe_values_ref.get_fe(), + rhs.fe_values_ref.get_quadrature(), + rhs.fe_values_ref.get_update_flags()) + , fe_face_values_ref(rhs.fe_face_values_ref.get_fe(), + rhs.fe_face_values_ref.get_quadrature(), + rhs.fe_face_values_ref.get_update_flags()) + , Nx(rhs.Nx) + , symm_grad_Nx(rhs.symm_grad_Nx) {} void reset() @@ -982,18 +993,18 @@ namespace Step44 PerTaskData_SC(const unsigned int dofs_per_cell, const unsigned int n_u, const unsigned int n_p, - const unsigned int n_J) : - cell_matrix(dofs_per_cell, dofs_per_cell), - local_dof_indices(dofs_per_cell), - k_orig(dofs_per_cell, dofs_per_cell), - k_pu(n_p, n_u), - k_pJ(n_p, n_J), - k_JJ(n_J, n_J), - k_pJ_inv(n_p, n_J), - k_bbar(n_u, n_u), - A(n_J, n_u), - B(n_J, n_u), - C(n_p, n_u) + const unsigned int n_J) + : cell_matrix(dofs_per_cell, dofs_per_cell) + , local_dof_indices(dofs_per_cell) + , k_orig(dofs_per_cell, dofs_per_cell) + , k_pu(n_p, n_u) + , k_pJ(n_p, n_J) + , k_JJ(n_J, n_J) + , k_pJ_inv(n_p, n_J) + , k_bbar(n_u, n_u) + , A(n_J, n_u) + , B(n_J, n_u) + , C(n_p, n_u) {} void reset() @@ -1024,21 +1035,21 @@ namespace Step44 ScratchData_UQPH(const FiniteElement & fe_cell, const QGauss & qf_cell, const UpdateFlags uf_cell, - const BlockVector &solution_total) : - solution_total(solution_total), - solution_grads_u_total(qf_cell.size()), - solution_values_p_total(qf_cell.size()), - solution_values_J_total(qf_cell.size()), - fe_values_ref(fe_cell, qf_cell, uf_cell) + const BlockVector &solution_total) + : solution_total(solution_total) + , solution_grads_u_total(qf_cell.size()) + , solution_values_p_total(qf_cell.size()) + , solution_values_J_total(qf_cell.size()) + , fe_values_ref(fe_cell, qf_cell, uf_cell) {} - ScratchData_UQPH(const ScratchData_UQPH &rhs) : - solution_total(rhs.solution_total), - solution_grads_u_total(rhs.solution_grads_u_total), - solution_values_p_total(rhs.solution_values_p_total), - solution_values_J_total(rhs.solution_values_J_total), - fe_values_ref(rhs.fe_values_ref.get_fe(), - rhs.fe_values_ref.get_quadrature(), - rhs.fe_values_ref.get_update_flags()) + ScratchData_UQPH(const ScratchData_UQPH &rhs) + : solution_total(rhs.solution_total) + , solution_grads_u_total(rhs.solution_grads_u_total) + , solution_values_p_total(rhs.solution_values_p_total) + , solution_values_J_total(rhs.solution_values_J_total) + , fe_values_ref(rhs.fe_values_ref.get_fe(), + rhs.fe_values_ref.get_quadrature(), + rhs.fe_values_ref.get_update_flags()) {} void reset() @@ -1102,8 +1113,9 @@ namespace Step44 dof_handler_ref.distribute_dofs(fe); DoFRenumbering::Cuthill_McKee(dof_handler_ref); DoFRenumbering::component_wise(dof_handler_ref, block_component); - DoFTools::count_dofs_per_block( - dof_handler_ref, dofs_per_block, block_component); + DoFTools::count_dofs_per_block(dof_handler_ref, + dofs_per_block, + block_component); pcout << "Triangulation:" << "\n\t Number of active cells: " << triangulation.n_active_cells() << "\n\t Number of degrees of freedom: " << dof_handler_ref.n_dofs() @@ -1172,8 +1184,9 @@ namespace Step44 Solid::setup_qph() { pcout << " Setting up quadrature point data..." << std::endl; - quadrature_point_history.initialize( - triangulation.begin_active(), triangulation.end(), n_q_points); + quadrature_point_history.initialize(triangulation.begin_active(), + triangulation.end(), + n_q_points); for (typename Triangulation::active_cell_iterator cell = triangulation.begin_active(); cell != triangulation.end(); @@ -1845,24 +1858,30 @@ namespace Step44 data.reset(); scratch.reset(); cell->get_dof_indices(data.local_dof_indices); - data.k_orig.extract_submatrix_from( - tangent_matrix, data.local_dof_indices, data.local_dof_indices); - data.k_pu.extract_submatrix_from( - data.k_orig, element_indices_p, element_indices_u); - data.k_pJ.extract_submatrix_from( - data.k_orig, element_indices_p, element_indices_J); - data.k_JJ.extract_submatrix_from( - data.k_orig, element_indices_J, element_indices_J); + data.k_orig.extract_submatrix_from(tangent_matrix, + data.local_dof_indices, + data.local_dof_indices); + data.k_pu.extract_submatrix_from(data.k_orig, + element_indices_p, + element_indices_u); + data.k_pJ.extract_submatrix_from(data.k_orig, + element_indices_p, + element_indices_J); + data.k_JJ.extract_submatrix_from(data.k_orig, + element_indices_J, + element_indices_J); data.k_pJ_inv.invert(data.k_pJ); data.k_pJ_inv.mmult(data.A, data.k_pu); data.k_JJ.mmult(data.B, data.A); data.k_pJ_inv.Tmmult(data.C, data.B); data.k_pu.Tmmult(data.k_bbar, data.C); - data.k_bbar.scatter_matrix_to( - element_indices_u, element_indices_u, data.cell_matrix); + data.k_bbar.scatter_matrix_to(element_indices_u, + element_indices_u, + data.cell_matrix); data.k_pJ_inv.add(-1.0, data.k_pJ); - data.k_pJ_inv.scatter_matrix_to( - element_indices_p, element_indices_J, data.cell_matrix); + data.k_pJ_inv.scatter_matrix_to(element_indices_p, + element_indices_J, + data.cell_matrix); } template std::pair @@ -1999,8 +2018,10 @@ namespace Step44 SolverSelector> solver_K_con_inv; solver_K_con_inv.select("cg"); solver_K_con_inv.set_control(solver_control_K_con_inv); - const auto K_uu_con_inv = inverse_operator( - K_uu_con, solver_K_con_inv, preconditioner_K_con_inv); + const auto K_uu_con_inv = + inverse_operator(K_uu_con, + solver_K_con_inv, + preconditioner_K_con_inv); d_u = K_uu_con_inv * (f_u - K_up * (K_Jp_inv * f_J - K_pp_bar * f_p)); timer.leave_subsection(); diff --git a/tests/physics/transformations-rotations_01.cc b/tests/physics/transformations-rotations_01.cc index f3e51e73c9..a1dc8f8003 100644 --- a/tests/physics/transformations-rotations_01.cc +++ b/tests/physics/transformations-rotations_01.cc @@ -61,8 +61,9 @@ test_rotation_matrix_3d(const Point<3> &axis, const double angle) // NOTE: Angle in radians const Tensor<1, 3> u = axis / axis.norm(); // Ensure unit vector const Tensor<2, 3> u_dyad_u = outer_product(u, u); - const double u_skew_array[3][3] = { - {0.0, -u[2], u[1]}, {u[2], 0.0, -u[0]}, {-u[1], u[0], 0.0}}; + const double u_skew_array[3][3] = {{0.0, -u[2], u[1]}, + {u[2], 0.0, -u[0]}, + {-u[1], u[0], 0.0}}; const Tensor<2, 3> R_rodrigues = u_dyad_u + diff --git a/tests/quick_tests/arpack.cc b/tests/quick_tests/arpack.cc index 1b5165ae04..d8dc6e577a 100644 --- a/tests/quick_tests/arpack.cc +++ b/tests/quick_tests/arpack.cc @@ -84,9 +84,10 @@ test() SparseDirectUMFPACK inverse; inverse.initialize(A); const unsigned int num_arnoldi_vectors = 2 * eigenvalues.size() + 2; - ArpackSolver::AdditionalData additional_data( - num_arnoldi_vectors, ArpackSolver::largest_magnitude, true); - ArpackSolver eigensolver(solver_control, additional_data); + ArpackSolver::AdditionalData additional_data(num_arnoldi_vectors, + ArpackSolver::largest_magnitude, + true); + ArpackSolver eigensolver(solver_control, additional_data); eigensolver.solve( A, B, inverse, eigenvalues, eigenvectors, eigenvalues.size()); diff --git a/tests/quick_tests/cuda.cu b/tests/quick_tests/cuda.cu index caf45107ba..7a780a20d5 100644 --- a/tests/quick_tests/cuda.cu +++ b/tests/quick_tests/cuda.cu @@ -44,8 +44,10 @@ main() AssertCuda(cuda_error); cuda_error = cudaMalloc(&device_y, n * sizeof(double)); AssertCuda(cuda_error); - cuda_error = cudaMemcpy( - device_x, host_x.data(), n * sizeof(double), cudaMemcpyHostToDevice); + cuda_error = cudaMemcpy(device_x, + host_x.data(), + n * sizeof(double), + cudaMemcpyHostToDevice); AssertCuda(cuda_error); // Launch the kernel. @@ -54,8 +56,10 @@ main() // Copy output data to host. cuda_error = cudaDeviceSynchronize(); AssertCuda(cuda_error); - cuda_error = cudaMemcpy( - host_y.data(), device_y, n * sizeof(double), cudaMemcpyDeviceToHost); + cuda_error = cudaMemcpy(host_y.data(), + device_y, + n * sizeof(double), + cudaMemcpyDeviceToHost); AssertCuda(cuda_error); // Print the results and test diff --git a/tests/quick_tests/step-petsc.cc b/tests/quick_tests/step-petsc.cc index a845664fdb..3394e2d969 100644 --- a/tests/quick_tests/step-petsc.cc +++ b/tests/quick_tests/step-petsc.cc @@ -73,7 +73,9 @@ private: TableHandler output_table; }; -LaplaceProblem::LaplaceProblem() : fe(1), dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : fe(1) + , dof_handler(triangulation) {} void diff --git a/tests/quick_tests/step-slepc.cc b/tests/quick_tests/step-slepc.cc index 8c5fce9772..88ebf33a4a 100644 --- a/tests/quick_tests/step-slepc.cc +++ b/tests/quick_tests/step-slepc.cc @@ -73,9 +73,9 @@ private: TableHandler output_table; }; -LaplaceEigenspectrumProblem::LaplaceEigenspectrumProblem() : - fe(1), - dof_handler(triangulation) +LaplaceEigenspectrumProblem::LaplaceEigenspectrumProblem() + : fe(1) + , dof_handler(triangulation) {} void diff --git a/tests/quick_tests/step-trilinos.cc b/tests/quick_tests/step-trilinos.cc index 51c40405fa..812485f6c0 100644 --- a/tests/quick_tests/step-trilinos.cc +++ b/tests/quick_tests/step-trilinos.cc @@ -74,7 +74,9 @@ private: TableHandler output_table; }; -LaplaceProblem::LaplaceProblem() : fe(1), dof_handler(triangulation) +LaplaceProblem::LaplaceProblem() + : fe(1) + , dof_handler(triangulation) {} void diff --git a/tests/quick_tests/step.cc b/tests/quick_tests/step.cc index 084484f8ab..066105022e 100644 --- a/tests/quick_tests/step.cc +++ b/tests/quick_tests/step.cc @@ -87,11 +87,11 @@ private: template -LaplaceProblem::LaplaceProblem(const unsigned int mapping_degree) : - fe(1), - dof_handler(triangulation), - mapping(mapping_degree), - last_error(std::numeric_limits::max()) +LaplaceProblem::LaplaceProblem(const unsigned int mapping_degree) + : fe(1) + , dof_handler(triangulation) + , mapping(mapping_degree) + , last_error(std::numeric_limits::max()) { deallog << "Using mapping with degree " << mapping_degree << ":" << std::endl << "============================" << std::endl; @@ -108,8 +108,9 @@ LaplaceProblem::setup_system() system_rhs.reinit(dof_handler.n_dofs()); std::vector boundary_dofs(dof_handler.n_dofs(), false); - DoFTools::extract_boundary_dofs( - dof_handler, std::vector(1, true), boundary_dofs); + DoFTools::extract_boundary_dofs(dof_handler, + std::vector(1, true), + boundary_dofs); const unsigned int first_boundary_dof = std::distance(boundary_dofs.begin(), @@ -136,23 +137,26 @@ template void LaplaceProblem::assemble_and_solve() { - const unsigned int gauss_degree = std::max( - static_cast(std::ceil(1. * (mapping.get_degree() + 1) / 2)), - 2U); - MatrixTools::create_laplace_matrix( - mapping, dof_handler, QGauss(gauss_degree), system_matrix); + const unsigned int gauss_degree = + std::max(static_cast( + std::ceil(1. * (mapping.get_degree() + 1) / 2)), + 2U); + MatrixTools::create_laplace_matrix(mapping, + dof_handler, + QGauss(gauss_degree), + system_matrix); VectorTools::create_right_hand_side(mapping, dof_handler, QGauss(gauss_degree), Functions::ConstantFunction(-2), system_rhs); Vector tmp(system_rhs.size()); - VectorTools::create_boundary_right_hand_side( - mapping, - dof_handler, - QGauss(gauss_degree), - Functions::ConstantFunction(1), - tmp); + VectorTools::create_boundary_right_hand_side(mapping, + dof_handler, + QGauss(gauss_degree), + Functions::ConstantFunction( + 1), + tmp); system_rhs += tmp; mean_value_constraints.condense(system_matrix); diff --git a/tests/quick_tests/sundials-ida.cc b/tests/quick_tests/sundials-ida.cc index 800b46eb71..b8c8a15217 100644 --- a/tests/quick_tests/sundials-ida.cc +++ b/tests/quick_tests/sundials-ida.cc @@ -57,14 +57,14 @@ using namespace dealii; class HarmonicOscillator { public: - HarmonicOscillator(double _kappa = 1.0) : - y(2), - y_dot(2), - diff(2), - J(2, 2), - A(2, 2), - Jinv(2, 2), - kappa(_kappa) + HarmonicOscillator(double _kappa = 1.0) + : y(2) + , y_dot(2) + , diff(2) + , J(2, 2) + , A(2, 2) + , Jinv(2, 2) + , kappa(_kappa) { diff[0] = 1.0; diff[1] = 1.0; diff --git a/tests/scalapack/scalapack_04.cc b/tests/scalapack/scalapack_04.cc index 9b940905fc..2220da0489 100644 --- a/tests/scalapack/scalapack_04.cc +++ b/tests/scalapack/scalapack_04.cc @@ -50,8 +50,10 @@ test(const unsigned int size, std::shared_ptr grid = std::make_shared( mpi_communicator, size, size, block_size, block_size); - ScaLAPACKMatrix scalapack_A( - size, grid, block_size, LAPACKSupport::Property::symmetric); + ScaLAPACKMatrix scalapack_A(size, + grid, + block_size, + LAPACKSupport::Property::symmetric); pcout << size << " " << block_size << " " << grid->get_process_grid_rows() << " " << grid->get_process_grid_columns() << std::endl; diff --git a/tests/scalapack/scalapack_05.cc b/tests/scalapack/scalapack_05.cc index 9097e46975..401f887001 100644 --- a/tests/scalapack/scalapack_05.cc +++ b/tests/scalapack/scalapack_05.cc @@ -49,8 +49,10 @@ test(const unsigned int size, const unsigned int block_size) std::shared_ptr grid = std::make_shared( mpi_communicator, size, size, block_size, block_size); - ScaLAPACKMatrix scalapack_A( - size, grid, block_size, LAPACKSupport::Property::symmetric); + ScaLAPACKMatrix scalapack_A(size, + grid, + block_size, + LAPACKSupport::Property::symmetric); pcout << size << " " << block_size << " " << grid->get_process_grid_rows() << " " << grid->get_process_grid_columns() << std::endl; diff --git a/tests/scalapack/scalapack_07.cc b/tests/scalapack/scalapack_07.cc index f25d985f8f..27db89cacc 100644 --- a/tests/scalapack/scalapack_07.cc +++ b/tests/scalapack/scalapack_07.cc @@ -57,8 +57,9 @@ test(const unsigned int block_size_i, const unsigned int block_size_j) mpi_communicator, size, size, block_size_i, block_size_i); // create 1d process grid std::shared_ptr grid_1d = - std::make_shared( - mpi_communicator, n_mpi_processes, 1); + std::make_shared(mpi_communicator, + n_mpi_processes, + 1); // create process grid containing one process std::shared_ptr grid_single = std::make_shared(mpi_communicator, 1, 1); diff --git a/tests/scalapack/scalapack_08.cc b/tests/scalapack/scalapack_08.cc index 570af559b0..dba43107fb 100644 --- a/tests/scalapack/scalapack_08.cc +++ b/tests/scalapack/scalapack_08.cc @@ -106,12 +106,12 @@ test(const unsigned int size, NumberType product_1 = eigenvector * l_singular_vector; NumberType product_2 = eigenvector * r_singular_vector; // the tolerance is reduced for the singular vectors - AssertThrow( - (std::abs(product_1) - 1) < tol * 10, - ExcMessage("left singular vectors and eigenvectors do not coincide")); - AssertThrow( - (std::abs(product_2) - 1) < tol * 10, - ExcMessage("right singular vectors and eigenvectors do not coincide")); + AssertThrow((std::abs(product_1) - 1) < tol * 10, + ExcMessage( + "left singular vectors and eigenvectors do not coincide")); + AssertThrow((std::abs(product_2) - 1) < tol * 10, + ExcMessage( + "right singular vectors and eigenvectors do not coincide")); } pcout << " with respect to the given tolerance the right and left singular vectors coincide with the eigenvectors" diff --git a/tests/scalapack/scalapack_11.cc b/tests/scalapack/scalapack_11.cc index 149d03525c..c3da132b01 100644 --- a/tests/scalapack/scalapack_11.cc +++ b/tests/scalapack/scalapack_11.cc @@ -76,8 +76,10 @@ test(const unsigned int block_size_i, const unsigned int block_size_j) grid, block_size_j, block_size_i); - scalapack_matrix.copy_to( - scalapack_matrix_dest, offset_A, offset_B, submatrix_size); + scalapack_matrix.copy_to(scalapack_matrix_dest, + offset_A, + offset_B, + submatrix_size); FullMatrix dest(sub_size + offset_B.first, sub_size + offset_B.second); scalapack_matrix_dest.copy_to(dest); diff --git a/tests/scalapack/scalapack_12_a.cc b/tests/scalapack/scalapack_12_a.cc index 59cfb0e41f..8955491b6e 100644 --- a/tests/scalapack/scalapack_12_a.cc +++ b/tests/scalapack/scalapack_12_a.cc @@ -48,8 +48,9 @@ test() const unsigned int proc_columns = std::floor(n_mpi_processes / proc_rows); // create 2d process grid std::shared_ptr grid = - std::make_shared( - mpi_communicator, proc_rows, proc_columns); + std::make_shared(mpi_communicator, + proc_rows, + proc_columns); pcout << "2D process grid: " << grid->get_process_grid_rows() << "x" << grid->get_process_grid_columns() << std::endl << std::endl; diff --git a/tests/scalapack/scalapack_12_b.cc b/tests/scalapack/scalapack_12_b.cc index 9a79ca8980..0f4cdb466c 100644 --- a/tests/scalapack/scalapack_12_b.cc +++ b/tests/scalapack/scalapack_12_b.cc @@ -49,8 +49,9 @@ test() const unsigned int proc_columns = std::floor(n_mpi_processes / proc_rows); // create 2d process grid std::shared_ptr grid = - std::make_shared( - mpi_communicator, proc_rows, proc_columns); + std::make_shared(mpi_communicator, + proc_rows, + proc_columns); pcout << "2D process grid: " << grid->get_process_grid_rows() << "x" << grid->get_process_grid_columns() << std::endl << std::endl; diff --git a/tests/scalapack/scalapack_12_c.cc b/tests/scalapack/scalapack_12_c.cc index 6a51a1d98a..498a7ffc38 100644 --- a/tests/scalapack/scalapack_12_c.cc +++ b/tests/scalapack/scalapack_12_c.cc @@ -49,8 +49,9 @@ test() const unsigned int proc_columns = std::floor(n_mpi_processes / proc_rows); // create 2d process grid std::shared_ptr grid = - std::make_shared( - mpi_communicator, proc_rows, proc_columns); + std::make_shared(mpi_communicator, + proc_rows, + proc_columns); pcout << "2D process grid: " << grid->get_process_grid_rows() << "x" << grid->get_process_grid_columns() << std::endl << std::endl; diff --git a/tests/scalapack/scalapack_12_d.cc b/tests/scalapack/scalapack_12_d.cc index 9884f2ee1b..2f4f8e6d08 100644 --- a/tests/scalapack/scalapack_12_d.cc +++ b/tests/scalapack/scalapack_12_d.cc @@ -49,8 +49,9 @@ test() const unsigned int proc_columns = std::floor(n_mpi_processes / proc_rows); // create 2d process grid std::shared_ptr grid = - std::make_shared( - mpi_communicator, proc_rows, proc_columns); + std::make_shared(mpi_communicator, + proc_rows, + proc_columns); pcout << "2D process grid: " << grid->get_process_grid_rows() << "x" << grid->get_process_grid_columns() << std::endl << std::endl; diff --git a/tests/scalapack/scalapack_13_a.cc b/tests/scalapack/scalapack_13_a.cc index eb1dcd91c0..e3d55299ba 100644 --- a/tests/scalapack/scalapack_13_a.cc +++ b/tests/scalapack/scalapack_13_a.cc @@ -48,8 +48,9 @@ test(const unsigned int block_size_i, const unsigned int block_size_j) const unsigned int proc_columns = std::floor(n_mpi_processes / proc_rows); // create 2d process grid std::shared_ptr grid = - std::make_shared( - mpi_communicator, proc_rows, proc_columns); + std::make_shared(mpi_communicator, + proc_rows, + proc_columns); pcout << "2D process grid: " << grid->get_process_grid_rows() << "x" << grid->get_process_grid_columns() << std::endl << std::endl; diff --git a/tests/scalapack/scalapack_13_b.cc b/tests/scalapack/scalapack_13_b.cc index f5e463198d..20fd3bd4bc 100644 --- a/tests/scalapack/scalapack_13_b.cc +++ b/tests/scalapack/scalapack_13_b.cc @@ -48,8 +48,9 @@ test(const unsigned int block_size_i, const unsigned int block_size_j) const unsigned int proc_columns = std::floor(n_mpi_processes / proc_rows); // create 2d process grid std::shared_ptr grid = - std::make_shared( - mpi_communicator, proc_rows, proc_columns); + std::make_shared(mpi_communicator, + proc_rows, + proc_columns); pcout << "2D process grid: " << grid->get_process_grid_rows() << "x" << grid->get_process_grid_columns() << std::endl << std::endl; diff --git a/tests/scalapack/scalapack_15.cc b/tests/scalapack/scalapack_15.cc index 69e9c98d43..69848882e5 100644 --- a/tests/scalapack/scalapack_15.cc +++ b/tests/scalapack/scalapack_15.cc @@ -168,8 +168,9 @@ test(const unsigned int size, << " eigenvalues and eigenvectors computed using LAPACK and ScaLAPACK p_syevr:" << std::endl; const std::vector eigenvalues_psyer = - scalapack_syevr.eigenpairs_symmetric_by_index_MRRR( - std::make_pair(0, size - 1), true); + scalapack_syevr.eigenpairs_symmetric_by_index_MRRR(std::make_pair(0, + size - 1), + true); scalapack_syevr.copy_to(p_eigenvectors); for (unsigned int i = 0; i < max_n_eigenvalues; ++i) AssertThrow(std::abs(eigenvalues_psyer[n_eigenvalues - i - 1] - diff --git a/tests/scalapack/scalapack_15_a.cc b/tests/scalapack/scalapack_15_a.cc index f228d58d89..59bc9368c8 100644 --- a/tests/scalapack/scalapack_15_a.cc +++ b/tests/scalapack/scalapack_15_a.cc @@ -162,8 +162,9 @@ test(const unsigned int size, << " eigenvalues computed using LAPACK and ScaLAPACK p_syevr:" << std::endl; const std::vector eigenvalues_psyer = - scalapack_syevr.eigenpairs_symmetric_by_index_MRRR( - std::make_pair(0, size - 1), false); + scalapack_syevr.eigenpairs_symmetric_by_index_MRRR(std::make_pair(0, + size - 1), + false); scalapack_syevr.copy_to(p_eigenvectors); for (unsigned int i = 0; i < max_n_eigenvalues; ++i) AssertThrow(std::abs(eigenvalues_psyer[n_eigenvalues - i - 1] - diff --git a/tests/serialization/dof_handler_01.cc b/tests/serialization/dof_handler_01.cc index e11e36f286..a844df3b27 100644 --- a/tests/serialization/dof_handler_01.cc +++ b/tests/serialization/dof_handler_01.cc @@ -166,8 +166,10 @@ test() do_boundary(tria); - FESystem fe( - FE_Q(2), dim, FE_Q(1), 1); + FESystem fe(FE_Q(2), + dim, + FE_Q(1), + 1); DoFHandler dof_1(tria); DoFHandler dof_2(tria); diff --git a/tests/serialization/parameter_handler.cc b/tests/serialization/parameter_handler.cc index 764895e466..9656c43a4a 100644 --- a/tests/serialization/parameter_handler.cc +++ b/tests/serialization/parameter_handler.cc @@ -45,11 +45,15 @@ test() // things with strange characters prm1.enter_subsection("Testing%testing"); { - prm1.declare_entry( - "string&list", "< & > ; /", Patterns::Anything(), "docs 1"); + prm1.declare_entry("string&list", + "< & > ; /", + Patterns::Anything(), + "docs 1"); prm1.declare_entry("int*int", "2", Patterns::Integer()); - prm1.declare_entry( - "double+double", "6.1415926", Patterns::Double(), "docs 3"); + prm1.declare_entry("double+double", + "6.1415926", + Patterns::Double(), + "docs 3"); } prm1.leave_subsection(); @@ -70,8 +74,10 @@ test() prm2.enter_subsection("Testing%testing"); { prm2.declare_entry("int*int", "2", Patterns::Integer()); - prm2.declare_entry( - "string&list", "< & > ; /", Patterns::Anything(), "docs 1"); + prm2.declare_entry("string&list", + "< & > ; /", + Patterns::Anything(), + "docs 1"); } prm2.leave_subsection(); diff --git a/tests/serialization/particle_handler_01.cc b/tests/serialization/particle_handler_01.cc index 3b13c2acef..fe94b3cd21 100644 --- a/tests/serialization/particle_handler_01.cc +++ b/tests/serialization/particle_handler_01.cc @@ -53,8 +53,9 @@ create_regular_particle_distribution( static_cast(particles_per_direction - 1); id = i * particles_per_direction * particles_per_direction + j * particles_per_direction + k; - Particles::Particle particle( - position, reference_position, id); + Particles::Particle particle(position, + reference_position, + id); typename parallel::distributed::Triangulation:: active_cell_iterator cell = @@ -65,8 +66,9 @@ create_regular_particle_distribution( } else { - Particles::Particle particle( - position, reference_position, id); + Particles::Particle particle(position, + reference_position, + id); typename parallel::distributed::Triangulation:: active_cell_iterator cell = diff --git a/tests/sharedtria/tria_multigrid_01.cc b/tests/sharedtria/tria_multigrid_01.cc index e6328a44d1..42604469e0 100644 --- a/tests/sharedtria/tria_multigrid_01.cc +++ b/tests/sharedtria/tria_multigrid_01.cc @@ -61,9 +61,9 @@ compare_meshes(parallel::shared::Triangulation & shared_tria, it != p4est_map.end(); ++it) { - AssertThrow( - shared_map[it->first] == it->second, - ExcMessage("Not all CellIds map to correct level subdomain_ids.")) + AssertThrow(shared_map[it->first] == it->second, + ExcMessage( + "Not all CellIds map to correct level subdomain_ids.")) } diff --git a/tests/slepc/solve_01.cc b/tests/slepc/solve_01.cc index 6ae8d6cd87..6f95002b88 100644 --- a/tests/slepc/solve_01.cc +++ b/tests/slepc/solve_01.cc @@ -90,8 +90,10 @@ main(int argc, char **argv) Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); { - SolverControl control( - 5000, 1e-11 /*1000*PETSC_MACHINE_EPSILON*/, false, false); + SolverControl control(5000, + 1e-11 /*1000*PETSC_MACHINE_EPSILON*/, + false, + false); const unsigned int size = 46; unsigned int dim = (size - 1) * (size - 1); @@ -141,8 +143,9 @@ main(int argc, char **argv) { SLEPcWrappers::SolverGeneralizedDavidson::AdditionalData data(true); - SLEPcWrappers::SolverGeneralizedDavidson solver( - control, PETSC_COMM_SELF, data); + SLEPcWrappers::SolverGeneralizedDavidson solver(control, + PETSC_COMM_SELF, + data); check_solve(solver, control, A, B, u, v); } diff --git a/tests/slepc/solve_04.cc b/tests/slepc/solve_04.cc index 3b1cc8fd10..07074ee5e3 100644 --- a/tests/slepc/solve_04.cc +++ b/tests/slepc/solve_04.cc @@ -72,25 +72,35 @@ check_solve(SolverType & solver, check_solver_within_range((void)true, solver_control.last_step(), 5, 5); break; case 2: - check_solver_within_range( - (void)true, solver_control.last_step(), 24, 24); + check_solver_within_range((void)true, + solver_control.last_step(), + 24, + 24); break; case 3: - check_solver_within_range( - (void)true, solver_control.last_step(), 21, 21); + check_solver_within_range((void)true, + solver_control.last_step(), + 21, + 21); break; // below the spread is bigger since Slepc 3.8: case 4: - check_solver_within_range( - (void)true, solver_control.last_step(), 119, 128); + check_solver_within_range((void)true, + solver_control.last_step(), + 119, + 128); break; case 5: - check_solver_within_range( - (void)true, solver_control.last_step(), 127, 138); + check_solver_within_range((void)true, + solver_control.last_step(), + 127, + 138); break; case 6: - check_solver_within_range( - (void)true, solver_control.last_step(), 44, 51); + check_solver_within_range((void)true, + solver_control.last_step(), + 44, + 51); break; default: Assert(false, ExcNotImplemented()); @@ -115,8 +125,10 @@ main(int argc, char **argv) Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); { - SolverControl control( - 500, 1e-12 /*1000*PETSC_MACHINE_EPSILON*/, false, false); + SolverControl control(500, + 1e-12 /*1000*PETSC_MACHINE_EPSILON*/, + false, + false); const unsigned int size = 31; @@ -158,8 +170,9 @@ main(int argc, char **argv) { SLEPcWrappers::SolverGeneralizedDavidson::AdditionalData data(true); - SLEPcWrappers::SolverGeneralizedDavidson solver( - control, PETSC_COMM_SELF, data); + SLEPcWrappers::SolverGeneralizedDavidson solver(control, + PETSC_COMM_SELF, + data); check_solve(solver, 5, control, A, u, v); } diff --git a/tests/slepc/step-36_parallel.cc b/tests/slepc/step-36_parallel.cc index 9f97cea9cb..9bcc1fb3b7 100644 --- a/tests/slepc/step-36_parallel.cc +++ b/tests/slepc/step-36_parallel.cc @@ -126,15 +126,21 @@ test(std::string solver_name, std::string preconditioner_name) for (unsigned int i = 0; i < n_mpi_processes; i++) n_locally_owned_dofs[i] = locally_owned_dofs_per_processor[i].n_elements(); - dealii::SparsityTools::distribute_sparsity_pattern( - csp, n_locally_owned_dofs, mpi_communicator, locally_relevant_dofs); + dealii::SparsityTools::distribute_sparsity_pattern(csp, + n_locally_owned_dofs, + mpi_communicator, + locally_relevant_dofs); // initialize the stiffness and mass matrices - stiffness_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + stiffness_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); - mass_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + mass_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); eigenfunctions.resize(5); for (unsigned int i = 0; i < eigenfunctions.size(); ++i) @@ -156,11 +162,12 @@ test(std::string solver_name, std::string preconditioner_name) mass_matrix = 0; dealii::QGauss quadrature_formula(2); - dealii::FEValues fe_values( - fe, - quadrature_formula, - dealii::update_values | dealii::update_gradients | - dealii::update_quadrature_points | dealii::update_JxW_values); + dealii::FEValues fe_values(fe, + quadrature_formula, + dealii::update_values | + dealii::update_gradients | + dealii::update_quadrature_points | + dealii::update_JxW_values); const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); @@ -197,10 +204,12 @@ test(std::string solver_name, std::string preconditioner_name) cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_stiffness_matrix, local_dof_indices, stiffness_matrix); - constraints.distribute_local_to_global( - cell_mass_matrix, local_dof_indices, mass_matrix); + constraints.distribute_local_to_global(cell_stiffness_matrix, + local_dof_indices, + stiffness_matrix); + constraints.distribute_local_to_global(cell_mass_matrix, + local_dof_indices, + mass_matrix); } stiffness_matrix.compress(dealii::VectorOperation::add); @@ -246,8 +255,10 @@ test(std::string solver_name, std::string preconditioner_name) mpi_communicator); linear_solver.initialize(*preconditioner); - dealii::SolverControl solver_control( - 100, 1e-11, /*log_history*/ false, /*log_results*/ false); + dealii::SolverControl solver_control(100, + 1e-11, + /*log_history*/ false, + /*log_results*/ false); dealii::SLEPcWrappers::SolverBase *eigensolver; @@ -255,8 +266,9 @@ test(std::string solver_name, std::string preconditioner_name) // Get a handle on the wanted eigenspectrum solver if (solver_name == "KrylovSchur") { - eigensolver = new dealii::SLEPcWrappers::SolverKrylovSchur( - solver_control, mpi_communicator); + eigensolver = + new dealii::SLEPcWrappers::SolverKrylovSchur(solver_control, + mpi_communicator); } else if (solver_name == "GeneralizedDavidson") @@ -266,13 +278,15 @@ test(std::string solver_name, std::string preconditioner_name) } else if (solver_name == "JacobiDavidson") { - eigensolver = new dealii::SLEPcWrappers::SolverJacobiDavidson( - solver_control, mpi_communicator); + eigensolver = + new dealii::SLEPcWrappers::SolverJacobiDavidson(solver_control, + mpi_communicator); } else if (solver_name == "Lanczos") { - eigensolver = new dealii::SLEPcWrappers::SolverLanczos( - solver_control, mpi_communicator); + eigensolver = + new dealii::SLEPcWrappers::SolverLanczos(solver_control, + mpi_communicator); } else { @@ -280,8 +294,9 @@ test(std::string solver_name, std::string preconditioner_name) // Make compiler happy and not complaining about non // uninitialized variables - eigensolver = new dealii::SLEPcWrappers::SolverKrylovSchur( - solver_control, mpi_communicator); + eigensolver = + new dealii::SLEPcWrappers::SolverKrylovSchur(solver_control, + mpi_communicator); } SLEPcWrappers::TransformationShiftInvert::AdditionalData additional_data( @@ -353,8 +368,9 @@ main(int argc, char **argv) try { - dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, 1); + dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, + argv, + 1); { test("KrylovSchur", "Jacobi"); test("KrylovSchur", "BlockJacobi"); diff --git a/tests/slepc/step-36_parallel_02.cc b/tests/slepc/step-36_parallel_02.cc index 7ac4e42212..be7c7b629d 100644 --- a/tests/slepc/step-36_parallel_02.cc +++ b/tests/slepc/step-36_parallel_02.cc @@ -126,15 +126,21 @@ test(std::string solver_name, std::string preconditioner_name) for (unsigned int i = 0; i < n_mpi_processes; i++) n_locally_owned_dofs[i] = locally_owned_dofs_per_processor[i].n_elements(); - dealii::SparsityTools::distribute_sparsity_pattern( - csp, n_locally_owned_dofs, mpi_communicator, locally_relevant_dofs); + dealii::SparsityTools::distribute_sparsity_pattern(csp, + n_locally_owned_dofs, + mpi_communicator, + locally_relevant_dofs); // initialize the stiffness and mass matrices - stiffness_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + stiffness_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); - mass_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + mass_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); eigenfunctions.resize(5); for (unsigned int i = 0; i < eigenfunctions.size(); ++i) @@ -156,11 +162,12 @@ test(std::string solver_name, std::string preconditioner_name) mass_matrix = 0; dealii::QGauss quadrature_formula(2); - dealii::FEValues fe_values( - fe, - quadrature_formula, - dealii::update_values | dealii::update_gradients | - dealii::update_quadrature_points | dealii::update_JxW_values); + dealii::FEValues fe_values(fe, + quadrature_formula, + dealii::update_values | + dealii::update_gradients | + dealii::update_quadrature_points | + dealii::update_JxW_values); const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); @@ -197,10 +204,12 @@ test(std::string solver_name, std::string preconditioner_name) cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_stiffness_matrix, local_dof_indices, stiffness_matrix); - constraints.distribute_local_to_global( - cell_mass_matrix, local_dof_indices, mass_matrix); + constraints.distribute_local_to_global(cell_stiffness_matrix, + local_dof_indices, + stiffness_matrix); + constraints.distribute_local_to_global(cell_mass_matrix, + local_dof_indices, + mass_matrix); } stiffness_matrix.compress(dealii::VectorOperation::add); @@ -246,8 +255,10 @@ test(std::string solver_name, std::string preconditioner_name) mpi_communicator); linear_solver.initialize(*preconditioner); - dealii::SolverControl solver_control( - 100, 1e-11, /*log_history*/ false, /*log_results*/ false); + dealii::SolverControl solver_control(100, + 1e-11, + /*log_history*/ false, + /*log_results*/ false); dealii::SLEPcWrappers::SolverBase *eigensolver; @@ -255,8 +266,9 @@ test(std::string solver_name, std::string preconditioner_name) // Get a handle on the wanted eigenspectrum solver if (solver_name == "KrylovSchur") { - eigensolver = new dealii::SLEPcWrappers::SolverKrylovSchur( - solver_control, mpi_communicator); + eigensolver = + new dealii::SLEPcWrappers::SolverKrylovSchur(solver_control, + mpi_communicator); } else if (solver_name == "GeneralizedDavidson") @@ -266,13 +278,15 @@ test(std::string solver_name, std::string preconditioner_name) } else if (solver_name == "JacobiDavidson") { - eigensolver = new dealii::SLEPcWrappers::SolverJacobiDavidson( - solver_control, mpi_communicator); + eigensolver = + new dealii::SLEPcWrappers::SolverJacobiDavidson(solver_control, + mpi_communicator); } else if (solver_name == "Lanczos") { - eigensolver = new dealii::SLEPcWrappers::SolverLanczos( - solver_control, mpi_communicator); + eigensolver = + new dealii::SLEPcWrappers::SolverLanczos(solver_control, + mpi_communicator); } else { @@ -280,8 +294,9 @@ test(std::string solver_name, std::string preconditioner_name) // Make compiler happy and not complaining about non // uninitialized variables - eigensolver = new dealii::SLEPcWrappers::SolverKrylovSchur( - solver_control, mpi_communicator); + eigensolver = + new dealii::SLEPcWrappers::SolverKrylovSchur(solver_control, + mpi_communicator); } PETScWrappers::set_option_value("-st_pc_factor_mat_solver_package", @@ -350,8 +365,9 @@ main(int argc, char **argv) try { - dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, 1); + dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, + argv, + 1); { test("KrylovSchur", "Jacobi"); test("KrylovSchur", "BlockJacobi"); diff --git a/tests/slepc/step-36_parallel_03.cc b/tests/slepc/step-36_parallel_03.cc index cdd350d50b..fbe6b5f791 100644 --- a/tests/slepc/step-36_parallel_03.cc +++ b/tests/slepc/step-36_parallel_03.cc @@ -126,15 +126,21 @@ test(std::string solver_name, std::string preconditioner_name) for (unsigned int i = 0; i < n_mpi_processes; i++) n_locally_owned_dofs[i] = locally_owned_dofs_per_processor[i].n_elements(); - dealii::SparsityTools::distribute_sparsity_pattern( - csp, n_locally_owned_dofs, mpi_communicator, locally_relevant_dofs); + dealii::SparsityTools::distribute_sparsity_pattern(csp, + n_locally_owned_dofs, + mpi_communicator, + locally_relevant_dofs); // initialize the stiffness and mass matrices - stiffness_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + stiffness_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); - mass_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, csp, mpi_communicator); + mass_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + csp, + mpi_communicator); eigenfunctions.resize(5); for (unsigned int i = 0; i < eigenfunctions.size(); ++i) @@ -156,11 +162,12 @@ test(std::string solver_name, std::string preconditioner_name) mass_matrix = 0; dealii::QGauss quadrature_formula(2); - dealii::FEValues fe_values( - fe, - quadrature_formula, - dealii::update_values | dealii::update_gradients | - dealii::update_quadrature_points | dealii::update_JxW_values); + dealii::FEValues fe_values(fe, + quadrature_formula, + dealii::update_values | + dealii::update_gradients | + dealii::update_quadrature_points | + dealii::update_JxW_values); const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); @@ -197,10 +204,12 @@ test(std::string solver_name, std::string preconditioner_name) cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_stiffness_matrix, local_dof_indices, stiffness_matrix); - constraints.distribute_local_to_global( - cell_mass_matrix, local_dof_indices, mass_matrix); + constraints.distribute_local_to_global(cell_stiffness_matrix, + local_dof_indices, + stiffness_matrix); + constraints.distribute_local_to_global(cell_mass_matrix, + local_dof_indices, + mass_matrix); } stiffness_matrix.compress(dealii::VectorOperation::add); @@ -246,8 +255,10 @@ test(std::string solver_name, std::string preconditioner_name) mpi_communicator); linear_solver.initialize(*preconditioner); - dealii::SolverControl solver_control( - 100, 1e-12, /*log_history*/ false, /*log_results*/ false); + dealii::SolverControl solver_control(100, + 1e-12, + /*log_history*/ false, + /*log_results*/ false); dealii::SLEPcWrappers::SolverBase *eigensolver; @@ -255,8 +266,9 @@ test(std::string solver_name, std::string preconditioner_name) // Get a handle on the wanted eigenspectrum solver if (solver_name == "KrylovSchur") { - eigensolver = new dealii::SLEPcWrappers::SolverKrylovSchur( - solver_control, mpi_communicator); + eigensolver = + new dealii::SLEPcWrappers::SolverKrylovSchur(solver_control, + mpi_communicator); } else if (solver_name == "GeneralizedDavidson") @@ -266,13 +278,15 @@ test(std::string solver_name, std::string preconditioner_name) } else if (solver_name == "JacobiDavidson") { - eigensolver = new dealii::SLEPcWrappers::SolverJacobiDavidson( - solver_control, mpi_communicator); + eigensolver = + new dealii::SLEPcWrappers::SolverJacobiDavidson(solver_control, + mpi_communicator); } else if (solver_name == "Lanczos") { - eigensolver = new dealii::SLEPcWrappers::SolverLanczos( - solver_control, mpi_communicator); + eigensolver = + new dealii::SLEPcWrappers::SolverLanczos(solver_control, + mpi_communicator); } else { @@ -280,8 +294,9 @@ test(std::string solver_name, std::string preconditioner_name) // Make compiler happy and not complaining about non // uninitialized variables - eigensolver = new dealii::SLEPcWrappers::SolverKrylovSchur( - solver_control, mpi_communicator); + eigensolver = + new dealii::SLEPcWrappers::SolverKrylovSchur(solver_control, + mpi_communicator); } // Set the initial vector. This is optional, if not done the initial vector @@ -291,8 +306,10 @@ test(std::string solver_name, std::string preconditioner_name) eigensolver->set_which_eigenpairs(EPS_LARGEST_REAL); eigensolver->set_problem_type(EPS_HEP); - eigensolver->solve( - stiffness_matrix, eigenvalues, eigenfunctions, eigenfunctions.size()); + eigensolver->solve(stiffness_matrix, + eigenvalues, + eigenfunctions, + eigenfunctions.size()); // TODO make this robust on different platforms. Seems related to GHEP // as solve_04 works ok. @@ -343,8 +360,9 @@ main(int argc, char **argv) try { - dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, 1); + dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, + argv, + 1); { test("KrylovSchur", "Jacobi"); test("KrylovSchur", "BlockJacobi"); diff --git a/tests/slepc/testmatrix.h b/tests/slepc/testmatrix.h index 2493079c3d..d4d6bd2753 100644 --- a/tests/slepc/testmatrix.h +++ b/tests/slepc/testmatrix.h @@ -56,9 +56,9 @@ private: // --------------- inline and template functions ----------------- -inline FDDiagMatrix::FDDiagMatrix(unsigned int nx, unsigned int ny) : - nx(nx), - ny(ny) +inline FDDiagMatrix::FDDiagMatrix(unsigned int nx, unsigned int ny) + : nx(nx) + , ny(ny) {} @@ -149,7 +149,8 @@ private: // --------------- inline and template functions ----------------- -inline FD1DLaplaceMatrix::FD1DLaplaceMatrix(unsigned int n) : n(n) +inline FD1DLaplaceMatrix::FD1DLaplaceMatrix(unsigned int n) + : n(n) {} diff --git a/tests/sparsity/sparsity_pattern.cc b/tests/sparsity/sparsity_pattern.cc index f78ffda214..fa9a0385ca 100644 --- a/tests/sparsity/sparsity_pattern.cc +++ b/tests/sparsity/sparsity_pattern.cc @@ -85,8 +85,10 @@ main() sparsity.back().insert(p->column()); }; SparsityPattern sp4; - sp4.copy_from( - (N - 1) * (N - 1), (N - 1) * (N - 1), sparsity.begin(), sparsity.end()); + sp4.copy_from((N - 1) * (N - 1), + (N - 1) * (N - 1), + sparsity.begin(), + sparsity.end()); // now check for equivalence of sp3 and sp4 for (unsigned int row = 0; row < sp3.n_rows(); ++row) @@ -110,9 +112,9 @@ main() const SparsityPattern &sp = (loop == 1 ? sp1 : (loop == 2 ? sp2 : (loop == 3 ? sp3 : sp4))); for (unsigned int i = 0; i < sp.n_nonzero_elements(); ++i) - AssertThrow( - sp(sp.matrix_position(i).first, sp.matrix_position(i).second) == i, - ExcInternalError()); + AssertThrow(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) diff --git a/tests/sparsity/sparsity_pattern_common.h b/tests/sparsity/sparsity_pattern_common.h index d517f2d206..3bc953c64f 100644 --- a/tests/sparsity/sparsity_pattern_common.h +++ b/tests/sparsity/sparsity_pattern_common.h @@ -246,8 +246,10 @@ do_copy_from( const std::list>> &sparsity, SparsityPattern & sp4) { - sp4.copy_from( - (N - 1) * (N - 1), (N - 1) * (N - 1), sparsity.begin(), sparsity.end()); + sp4.copy_from((N - 1) * (N - 1), + (N - 1) * (N - 1), + sparsity.begin(), + sparsity.end()); } @@ -415,21 +417,21 @@ copy_from_4() // and copy if (sp4.stores_only_added_elements() == true) { - AssertThrow( - sp4.n_nonzero_elements() == - static_cast(sparsity_pattern.frobenius_norm() * - sparsity_pattern.frobenius_norm() + - 0.5), - ExcInternalError()); + AssertThrow(sp4.n_nonzero_elements() == + static_cast( + sparsity_pattern.frobenius_norm() * + sparsity_pattern.frobenius_norm() + + 0.5), + ExcInternalError()); } else { - AssertThrow( - sp4.n_nonzero_elements() >= - static_cast(sparsity_pattern.frobenius_norm() * - sparsity_pattern.frobenius_norm() + - 0.5), - ExcInternalError()); + AssertThrow(sp4.n_nonzero_elements() >= + static_cast( + sparsity_pattern.frobenius_norm() * + sparsity_pattern.frobenius_norm() + + 0.5), + ExcInternalError()); } for (unsigned int i = 0; i < M; ++i) diff --git a/tests/sundials/copy_01.cc b/tests/sundials/copy_01.cc index 5ebd05192a..3f9736457e 100644 --- a/tests/sundials/copy_01.cc +++ b/tests/sundials/copy_01.cc @@ -67,10 +67,10 @@ main(int argc, char **argv) PETScWrappers::MPI::Vector vec2(local_dofs, MPI_COMM_WORLD); SUNDIALS::internal::copy(vec2, sundials_vector); - AssertThrow( - vec2 == vec, - ExcMessage("The two PETSc vectors should be equal since they are " - "copies (by means of an intermediate SUNDIALs vector)")); + AssertThrow(vec2 == vec, + ExcMessage( + "The two PETSc vectors should be equal since they are " + "copies (by means of an intermediate SUNDIALs vector)")); deallog << "n_local_dofs: " << n_local_dofs << std::endl; deallog << "OK" << std::endl; diff --git a/tests/sundials/harmonic_oscillator_01.cc b/tests/sundials/harmonic_oscillator_01.cc index 8079a82ca7..33d7830c3c 100644 --- a/tests/sundials/harmonic_oscillator_01.cc +++ b/tests/sundials/harmonic_oscillator_01.cc @@ -59,15 +59,15 @@ class HarmonicOscillator public: HarmonicOscillator( double _kappa, - const typename SUNDIALS::IDA>::AdditionalData &data) : - time_stepper(data), - y(2), - y_dot(2), - J(2, 2), - A(2, 2), - Jinv(2, 2), - kappa(_kappa), - out("output") + const typename SUNDIALS::IDA>::AdditionalData &data) + : time_stepper(data) + , y(2) + , y_dot(2) + , J(2, 2) + , A(2, 2) + , Jinv(2, 2) + , kappa(_kappa) + , out("output") { typedef Vector VectorType; diff --git a/tests/tensors/symmetric_tensor_02.cc b/tests/tensors/symmetric_tensor_02.cc index 3f2b469d8d..08a7867036 100644 --- a/tests/tensors/symmetric_tensor_02.cc +++ b/tests/tensors/symmetric_tensor_02.cc @@ -48,10 +48,10 @@ main() AssertThrow(t == transpose(t), ExcInternalError()); // check norm of tensor - AssertThrow( - std::fabs(t.norm() - std::sqrt(1. * 1 + 2 * 2 + 3 * 3 + 2 * 14 * 14 + - 2 * 5 * 5 + 2 * 6 * 6)) < 1e-14, - ExcInternalError()); + AssertThrow(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 diff --git a/tests/tensors/symmetric_tensor_15.cc b/tests/tensors/symmetric_tensor_15.cc index 0c2cff620f..ac3ab4a548 100644 --- a/tests/tensors/symmetric_tensor_15.cc +++ b/tests/tensors/symmetric_tensor_15.cc @@ -34,8 +34,9 @@ test() // test 1: check trace-like operator { - const SymmetricTensor<4, dim> T = outer_product( - unit_symmetric_tensor(), unit_symmetric_tensor()); + const SymmetricTensor<4, dim> T = + outer_product(unit_symmetric_tensor(), + unit_symmetric_tensor()); // T*t should yield a diagonal tensor // where the diagonal elements are the diff --git a/tests/tensors/symmetric_tensor_17.cc b/tests/tensors/symmetric_tensor_17.cc index 6af294ace6..4adad658fb 100644 --- a/tests/tensors/symmetric_tensor_17.cc +++ b/tests/tensors/symmetric_tensor_17.cc @@ -57,10 +57,10 @@ test() // t_times_1 should be a multiple of the // unit tensor, given the structure we have // given to it - AssertThrow( - (t_times_1 - (dim * 10000 + 2 * 100) * unit_symmetric_tensor()) - .norm() < 1e-14 * t_times_1.norm(), - ExcInternalError()); + AssertThrow((t_times_1 - + (dim * 10000 + 2 * 100) * unit_symmetric_tensor()) + .norm() < 1e-14 * t_times_1.norm(), + ExcInternalError()); } diff --git a/tests/tensors/symmetric_tensor_35.cc b/tests/tensors/symmetric_tensor_35.cc index ca08a6896f..0d59387780 100644 --- a/tests/tensors/symmetric_tensor_35.cc +++ b/tests/tensors/symmetric_tensor_35.cc @@ -76,11 +76,11 @@ main() SymmetricTensor<2, 1> t1; t1[0][0] = 2.0; deallog << invert(t1) << std::endl; - Assert( - (static_cast>(invert(t1)) * static_cast>(t1) - - unit_symmetric_tensor<1>()) - .norm() < 1e-12, - ExcMessage("Dim 1 inverse symmetric tensor definition is incorrect")); + Assert((static_cast>(invert(t1)) * + static_cast>(t1) - + unit_symmetric_tensor<1>()) + .norm() < 1e-12, + ExcMessage("Dim 1 inverse symmetric tensor definition is incorrect")); deallog << "Symmetric Tensor dim 2" << std::endl; SymmetricTensor<2, 2> t2; @@ -88,11 +88,11 @@ main() t2[0][1] = 1.0; t2[1][1] = 1.5; deallog << invert(t2) << std::endl; - Assert( - (static_cast>(invert(t2)) * static_cast>(t2) - - unit_symmetric_tensor<2>()) - .norm() < 1e-12, - ExcMessage("Dim 2 inverse symmetric tensor definition is incorrect")); + Assert((static_cast>(invert(t2)) * + static_cast>(t2) - + unit_symmetric_tensor<2>()) + .norm() < 1e-12, + ExcMessage("Dim 2 inverse symmetric tensor definition is incorrect")); deallog << "Symmetric Tensor dim 3" << std::endl; SymmetricTensor<2, 3> t3; @@ -103,11 +103,11 @@ main() t3[1][2] = 0.25; t3[2][2] = 1.25; deallog << invert(t3) << std::endl; - Assert( - (static_cast>(invert(t3)) * static_cast>(t3) - - unit_symmetric_tensor<3>()) - .norm() < 1e-12, - ExcMessage("Dim 3 inverse symmetric tensor definition is incorrect")); + Assert((static_cast>(invert(t3)) * + static_cast>(t3) - + unit_symmetric_tensor<3>()) + .norm() < 1e-12, + ExcMessage("Dim 3 inverse symmetric tensor definition is incorrect")); deallog << "OK" << std::endl; } diff --git a/tests/tensors/symmetric_tensor_37.cc b/tests/tensors/symmetric_tensor_37.cc index 364c4f335a..a58c101d70 100644 --- a/tests/tensors/symmetric_tensor_37.cc +++ b/tests/tensors/symmetric_tensor_37.cc @@ -37,8 +37,9 @@ test_symm_tensor_contract_3(const T1 & l, const T3 & r) { const double res1 = contract3(l, m, r); - const double res2 = contract3( - static_cast>(l), m, static_cast>(r)); + const double res2 = contract3(static_cast>(l), + m, + static_cast>(r)); Assert(std::abs(res1 - res2) < 1e-12, ExcMessage("Result from symmetric tensor contract3 is incorrect.")); } diff --git a/tests/tensors/tensor_25.cc b/tests/tensors/tensor_25.cc index bf2859f681..c0048b5073 100644 --- a/tests/tensors/tensor_25.cc +++ b/tests/tensors/tensor_25.cc @@ -36,12 +36,13 @@ check() for (unsigned int j = 0; j < dim; ++j) for (unsigned int k = 0; k < dim; ++k) { - AssertThrow( - TableIndices<3>(i, j, k) == - T::unrolled_to_component_indices(i * dim * dim + j * dim + k), - ExcInternalError()); - AssertThrow(T::component_to_unrolled_index(TableIndices<3>( - i, j, k)) == i * dim * dim + j * dim + k, + AssertThrow(TableIndices<3>(i, j, k) == + T::unrolled_to_component_indices(i * dim * dim + + j * dim + k), + ExcInternalError()); + AssertThrow(T::component_to_unrolled_index( + TableIndices<3>(i, j, k)) == + i * dim * dim + j * dim + k, ExcInternalError()); AssertThrow(t[TableIndices<3>(i, j, k)] == t[i][j][k], ExcInternalError()); diff --git a/tests/tensors/tensor_accessors_04.cc b/tests/tensors/tensor_accessors_04.cc index 565fc38444..91a7511e3b 100644 --- a/tests/tensors/tensor_accessors_04.cc +++ b/tests/tensors/tensor_accessors_04.cc @@ -144,8 +144,9 @@ main() deallog << "middle: " << middle4 << std::endl; deallog << "right: " << middle << std::endl; deallog << "Result: " - << TensorAccessors::contract3<2, 2, 5, long int>( - left2, middle4, middle) + << TensorAccessors::contract3<2, 2, 5, long int>(left2, + middle4, + middle) << std::endl; deallog << std::endl; // manually verified to be equal to the old implementation diff --git a/tests/testmatrix.h b/tests/testmatrix.h index 3d0469b15d..8994682804 100644 --- a/tests/testmatrix.h +++ b/tests/testmatrix.h @@ -78,7 +78,9 @@ private: // --------------- inline and template functions ----------------- -inline FDMatrix::FDMatrix(unsigned int nx, unsigned int ny) : nx(nx), ny(ny) +inline FDMatrix::FDMatrix(unsigned int nx, unsigned int ny) + : nx(nx) + , ny(ny) {} diff --git a/tests/tests.h b/tests/tests.h index 665e20bdce..1ee7d71242 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -353,8 +353,10 @@ unify_pretty_function(const std::string &text) * steps. */ -#define check_solver_within_range( \ - SolverType_COMMAND, CONTROL_COMMAND, MIN_ALLOWED, MAX_ALLOWED) \ +#define check_solver_within_range(SolverType_COMMAND, \ + CONTROL_COMMAND, \ + MIN_ALLOWED, \ + MAX_ALLOWED) \ { \ const unsigned int previous_depth = deallog.depth_file(0); \ try \ diff --git a/tests/trilinos/64.cc b/tests/trilinos/64.cc index 8fb62f3219..4dc43444ef 100644 --- a/tests/trilinos/64.cc +++ b/tests/trilinos/64.cc @@ -72,10 +72,10 @@ main(int argc, char **argv) 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(n_dofs), - static_cast(n_local_dofs), - Utilities::Trilinos::comm_world()); + Epetra_Map map(static_cast(n_dofs), + static_cast( + n_local_dofs), + Utilities::Trilinos::comm_world()); TrilinosWrappers::SparseMatrix v2(map, 5); test(v2); } diff --git a/tests/trilinos/assemble_matrix_parallel_01.cc b/tests/trilinos/assemble_matrix_parallel_01.cc index dd4d348df9..6d0348b975 100644 --- a/tests/trilinos/assemble_matrix_parallel_01.cc +++ b/tests/trilinos/assemble_matrix_parallel_01.cc @@ -65,18 +65,18 @@ namespace Assembly struct Data { Data(const hp::FECollection &fe, - const hp::QCollection & quadrature) : - hp_fe_values(fe, - quadrature, - update_values | update_gradients | - update_quadrature_points | update_JxW_values) + const hp::QCollection & quadrature) + : hp_fe_values(fe, + quadrature, + update_values | update_gradients | + update_quadrature_points | update_JxW_values) {} - Data(const Data &data) : - hp_fe_values(data.hp_fe_values.get_mapping_collection(), - data.hp_fe_values.get_fe_collection(), - data.hp_fe_values.get_quadrature_collection(), - data.hp_fe_values.get_update_flags()) + Data(const Data &data) + : hp_fe_values(data.hp_fe_values.get_mapping_collection(), + data.hp_fe_values.get_fe_collection(), + data.hp_fe_values.get_quadrature_collection(), + data.hp_fe_values.get_update_flags()) {} hp::FEValues hp_fe_values; @@ -158,7 +158,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -182,7 +183,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -203,9 +205,9 @@ RightHandSide::value(const Point &p, template -LaplaceProblem::LaplaceProblem() : - dof_handler(triangulation), - max_degree(5) +LaplaceProblem::LaplaceProblem() + : dof_handler(triangulation) + , max_degree(5) { if (dim == 2) for (unsigned int degree = 2; degree <= max_degree; ++degree) @@ -264,8 +266,10 @@ LaplaceProblem::setup_system() // 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. - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); graph = GraphColoring::make_graph_coloring( @@ -280,8 +284,9 @@ LaplaceProblem::setup_system() DynamicSparsityPattern csp(dof_handler.n_dofs(), dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false); - reference_matrix.reinit( - dof_handler.locally_owned_dofs(), csp, MPI_COMM_WORLD); + reference_matrix.reinit(dof_handler.locally_owned_dofs(), + csp, + MPI_COMM_WORLD); test_matrix.reinit(reference_matrix); } @@ -380,19 +385,20 @@ LaplaceProblem::assemble_test() test_matrix = 0; test_rhs = 0; - WorkStream::run( - graph, - std::bind(&LaplaceProblem::local_assemble, - this, - std::placeholders::_1, - std::placeholders::_2, - std::placeholders::_3), - std::bind( - &LaplaceProblem::copy_local_to_global, this, std::placeholders::_1), - Assembly::Scratch::Data(fe_collection, quadrature_collection), - Assembly::Copy::Data(), - 2 * MultithreadInfo::n_threads(), - 1); + WorkStream::run(graph, + std::bind(&LaplaceProblem::local_assemble, + this, + std::placeholders::_1, + std::placeholders::_2, + std::placeholders::_3), + std::bind(&LaplaceProblem::copy_local_to_global, + this, + std::placeholders::_1), + Assembly::Scratch::Data(fe_collection, + quadrature_collection), + Assembly::Copy::Data(), + 2 * MultithreadInfo::n_threads(), + 1); test_matrix.compress(VectorOperation::add); test_rhs.compress(VectorOperation::add); @@ -414,8 +420,10 @@ LaplaceProblem::postprocess() for (unsigned int i = 0; i < estimated_error_per_cell.size(); ++i) estimated_error_per_cell(i) = i; - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); for (typename hp::DoFHandler::active_cell_iterator cell = diff --git a/tests/trilinos/assemble_matrix_parallel_02.cc b/tests/trilinos/assemble_matrix_parallel_02.cc index d569522806..7f46068832 100644 --- a/tests/trilinos/assemble_matrix_parallel_02.cc +++ b/tests/trilinos/assemble_matrix_parallel_02.cc @@ -67,18 +67,18 @@ namespace Assembly template struct Data { - Data(const FiniteElement &fe, const Quadrature &quadrature) : - fe_values(fe, - quadrature, - update_values | update_gradients | update_quadrature_points | - update_JxW_values) + Data(const FiniteElement &fe, const Quadrature &quadrature) + : fe_values(fe, + quadrature, + update_values | update_gradients | + update_quadrature_points | update_JxW_values) {} - Data(const Data &data) : - fe_values(data.fe_values.get_mapping(), - data.fe_values.get_fe(), - data.fe_values.get_quadrature(), - data.fe_values.get_update_flags()) + Data(const Data &data) + : fe_values(data.fe_values.get_mapping(), + data.fe_values.get_fe(), + data.fe_values.get_quadrature(), + data.fe_values.get_update_flags()) {} FEValues fe_values; @@ -89,8 +89,8 @@ namespace Assembly { struct Data { - Data(const bool assemble_reference) : - assemble_reference(assemble_reference) + Data(const bool assemble_reference) + : assemble_reference(assemble_reference) {} std::vector local_dof_indices; FullMatrix local_matrix; @@ -165,7 +165,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -189,7 +190,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -210,11 +212,11 @@ RightHandSide::value(const Point &p, template -LaplaceProblem::LaplaceProblem() : - triangulation(MPI_COMM_WORLD), - dof_handler(triangulation), - fe(1), - quadrature(fe.degree + 1) +LaplaceProblem::LaplaceProblem() + : triangulation(MPI_COMM_WORLD) + , dof_handler(triangulation) + , fe(1) + , quadrature(fe.degree + 1) {} @@ -256,8 +258,10 @@ LaplaceProblem::setup_system() // 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. - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); typedef FilteredIterator::active_cell_iterator> @@ -428,8 +432,10 @@ LaplaceProblem::postprocess() for (unsigned int i = 0; i < estimated_error_per_cell.size(); ++i) estimated_error_per_cell(i) = i; - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/trilinos/assemble_matrix_parallel_03.cc b/tests/trilinos/assemble_matrix_parallel_03.cc index 78df3f607e..74a709efdd 100644 --- a/tests/trilinos/assemble_matrix_parallel_03.cc +++ b/tests/trilinos/assemble_matrix_parallel_03.cc @@ -68,18 +68,18 @@ namespace Assembly template struct Data { - Data(const FiniteElement &fe, const Quadrature &quadrature) : - fe_values(fe, - quadrature, - update_values | update_gradients | update_quadrature_points | - update_JxW_values) + Data(const FiniteElement &fe, const Quadrature &quadrature) + : fe_values(fe, + quadrature, + update_values | update_gradients | + update_quadrature_points | update_JxW_values) {} - Data(const Data &data) : - fe_values(data.fe_values.get_mapping(), - data.fe_values.get_fe(), - data.fe_values.get_quadrature(), - data.fe_values.get_update_flags()) + Data(const Data &data) + : fe_values(data.fe_values.get_mapping(), + data.fe_values.get_fe(), + data.fe_values.get_quadrature(), + data.fe_values.get_update_flags()) {} FEValues fe_values; @@ -90,8 +90,8 @@ namespace Assembly { struct Data { - Data(const bool assemble_reference) : - assemble_reference(assemble_reference) + Data(const bool assemble_reference) + : assemble_reference(assemble_reference) {} std::vector local_dof_indices; FullMatrix local_matrix; @@ -166,7 +166,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -190,7 +191,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -211,11 +213,11 @@ RightHandSide::value(const Point &p, template -LaplaceProblem::LaplaceProblem() : - triangulation(MPI_COMM_WORLD), - dof_handler(triangulation), - fe(1), - quadrature(fe.degree + 1) +LaplaceProblem::LaplaceProblem() + : triangulation(MPI_COMM_WORLD) + , dof_handler(triangulation) + , fe(1) + , quadrature(fe.degree + 1) {} @@ -257,8 +259,10 @@ LaplaceProblem::setup_system() // 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. - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); typedef FilteredIterator::active_cell_iterator> @@ -432,8 +436,10 @@ LaplaceProblem::postprocess() for (unsigned int i = 0; i < estimated_error_per_cell.size(); ++i) estimated_error_per_cell(i) = i; - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/trilinos/assemble_matrix_parallel_04.cc b/tests/trilinos/assemble_matrix_parallel_04.cc index 4423c72958..53d5d77fd1 100644 --- a/tests/trilinos/assemble_matrix_parallel_04.cc +++ b/tests/trilinos/assemble_matrix_parallel_04.cc @@ -69,18 +69,18 @@ namespace Assembly template struct Data { - Data(const FiniteElement &fe, const Quadrature &quadrature) : - fe_values(fe, - quadrature, - update_values | update_gradients | update_quadrature_points | - update_JxW_values) + Data(const FiniteElement &fe, const Quadrature &quadrature) + : fe_values(fe, + quadrature, + update_values | update_gradients | + update_quadrature_points | update_JxW_values) {} - Data(const Data &data) : - fe_values(data.fe_values.get_mapping(), - data.fe_values.get_fe(), - data.fe_values.get_quadrature(), - data.fe_values.get_update_flags()) + Data(const Data &data) + : fe_values(data.fe_values.get_mapping(), + data.fe_values.get_fe(), + data.fe_values.get_quadrature(), + data.fe_values.get_update_flags()) {} FEValues fe_values; @@ -91,8 +91,8 @@ namespace Assembly { struct Data { - Data(const bool assemble_reference) : - assemble_reference(assemble_reference) + Data(const bool assemble_reference) + : assemble_reference(assemble_reference) {} std::vector local_dof_indices; FullMatrix local_matrix; @@ -167,7 +167,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function(2) + BoundaryValues() + : Function(2) {} virtual double @@ -191,7 +192,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -212,11 +214,11 @@ RightHandSide::value(const Point &p, template -LaplaceProblem::LaplaceProblem() : - triangulation(MPI_COMM_WORLD), - dof_handler(triangulation), - fe(FE_Q(1), 1, FE_Q(2), 1), - quadrature(3) +LaplaceProblem::LaplaceProblem() + : triangulation(MPI_COMM_WORLD) + , dof_handler(triangulation) + , fe(FE_Q(1), 1, FE_Q(2), 1) + , quadrature(3) {} @@ -261,8 +263,10 @@ LaplaceProblem::setup_system() // 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. - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); typedef FilteredIterator::active_cell_iterator> @@ -450,8 +454,10 @@ LaplaceProblem::postprocess() for (unsigned int i = 0; i < estimated_error_per_cell.size(); ++i) estimated_error_per_cell(i) = i; - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/trilinos/assemble_matrix_parallel_05.cc b/tests/trilinos/assemble_matrix_parallel_05.cc index 8bddb11f2a..75c72b2787 100644 --- a/tests/trilinos/assemble_matrix_parallel_05.cc +++ b/tests/trilinos/assemble_matrix_parallel_05.cc @@ -69,18 +69,18 @@ namespace Assembly template struct Data { - Data(const FiniteElement &fe, const Quadrature &quadrature) : - fe_values(fe, - quadrature, - update_values | update_gradients | update_quadrature_points | - update_JxW_values) + Data(const FiniteElement &fe, const Quadrature &quadrature) + : fe_values(fe, + quadrature, + update_values | update_gradients | + update_quadrature_points | update_JxW_values) {} - Data(const Data &data) : - fe_values(data.fe_values.get_mapping(), - data.fe_values.get_fe(), - data.fe_values.get_quadrature(), - data.fe_values.get_update_flags()) + Data(const Data &data) + : fe_values(data.fe_values.get_mapping(), + data.fe_values.get_fe(), + data.fe_values.get_quadrature(), + data.fe_values.get_update_flags()) {} FEValues fe_values; @@ -91,8 +91,8 @@ namespace Assembly { struct Data { - Data(const bool assemble_reference) : - assemble_reference(assemble_reference) + Data(const bool assemble_reference) + : assemble_reference(assemble_reference) {} std::vector local_dof_indices; FullMatrix local_matrix; @@ -167,7 +167,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -191,7 +192,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -212,11 +214,11 @@ RightHandSide::value(const Point &p, template -LaplaceProblem::LaplaceProblem() : - triangulation(MPI_COMM_WORLD), - dof_handler(triangulation), - fe(1), - quadrature(fe.degree + 1) +LaplaceProblem::LaplaceProblem() + : triangulation(MPI_COMM_WORLD) + , dof_handler(triangulation) + , fe(1) + , quadrature(fe.degree + 1) {} @@ -258,8 +260,10 @@ LaplaceProblem::setup_system() // 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. - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); typedef FilteredIterator::active_cell_iterator> @@ -288,8 +292,9 @@ LaplaceProblem::setup_system() { IndexSet relevant_set; DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_set); - DynamicSparsityPattern csp( - dof_handler.n_dofs(), dof_handler.n_dofs(), relevant_set); + DynamicSparsityPattern csp(dof_handler.n_dofs(), + dof_handler.n_dofs(), + relevant_set); DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false); test_matrix.reinit(locally_owned, csp, MPI_COMM_WORLD, true); test_rhs.reinit(locally_owned, relevant_set, MPI_COMM_WORLD, true); @@ -429,8 +434,10 @@ LaplaceProblem::postprocess() for (unsigned int i = 0; i < estimated_error_per_cell.size(); ++i) estimated_error_per_cell(i) = i; - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/trilinos/assemble_matrix_parallel_06.cc b/tests/trilinos/assemble_matrix_parallel_06.cc index f62ea166f9..36b4a76942 100644 --- a/tests/trilinos/assemble_matrix_parallel_06.cc +++ b/tests/trilinos/assemble_matrix_parallel_06.cc @@ -71,18 +71,18 @@ namespace Assembly template struct Data { - Data(const FiniteElement &fe, const Quadrature &quadrature) : - fe_values(fe, - quadrature, - update_values | update_gradients | update_quadrature_points | - update_JxW_values) + Data(const FiniteElement &fe, const Quadrature &quadrature) + : fe_values(fe, + quadrature, + update_values | update_gradients | + update_quadrature_points | update_JxW_values) {} - Data(const Data &data) : - fe_values(data.fe_values.get_mapping(), - data.fe_values.get_fe(), - data.fe_values.get_quadrature(), - data.fe_values.get_update_flags()) + Data(const Data &data) + : fe_values(data.fe_values.get_mapping(), + data.fe_values.get_fe(), + data.fe_values.get_quadrature(), + data.fe_values.get_update_flags()) {} FEValues fe_values; @@ -93,8 +93,8 @@ namespace Assembly { struct Data { - Data(const bool assemble_reference) : - assemble_reference(assemble_reference) + Data(const bool assemble_reference) + : assemble_reference(assemble_reference) {} std::vector local_dof_indices; FullMatrix local_matrix; @@ -169,7 +169,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function(2) + BoundaryValues() + : Function(2) {} virtual double @@ -193,7 +194,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -214,11 +216,11 @@ RightHandSide::value(const Point &p, template -LaplaceProblem::LaplaceProblem() : - triangulation(MPI_COMM_WORLD), - dof_handler(triangulation), - fe(FE_Q(1), 1, FE_Q(2), 1), - quadrature(3) +LaplaceProblem::LaplaceProblem() + : triangulation(MPI_COMM_WORLD) + , dof_handler(triangulation) + , fe(FE_Q(1), 1, FE_Q(2), 1) + , quadrature(3) {} @@ -263,8 +265,10 @@ LaplaceProblem::setup_system() // 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. - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); typedef FilteredIterator::active_cell_iterator> @@ -451,8 +455,10 @@ LaplaceProblem::postprocess() for (unsigned int i = 0; i < estimated_error_per_cell.size(); ++i) estimated_error_per_cell(i) = i; - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/trilinos/assemble_matrix_parallel_07.cc b/tests/trilinos/assemble_matrix_parallel_07.cc index cf61fe5fbe..02ddd93512 100644 --- a/tests/trilinos/assemble_matrix_parallel_07.cc +++ b/tests/trilinos/assemble_matrix_parallel_07.cc @@ -68,18 +68,18 @@ namespace Assembly template struct Data { - Data(const FiniteElement &fe, const Quadrature &quadrature) : - fe_values(fe, - quadrature, - update_values | update_gradients | update_quadrature_points | - update_JxW_values) + Data(const FiniteElement &fe, const Quadrature &quadrature) + : fe_values(fe, + quadrature, + update_values | update_gradients | + update_quadrature_points | update_JxW_values) {} - Data(const Data &data) : - fe_values(data.fe_values.get_mapping(), - data.fe_values.get_fe(), - data.fe_values.get_quadrature(), - data.fe_values.get_update_flags()) + Data(const Data &data) + : fe_values(data.fe_values.get_mapping(), + data.fe_values.get_fe(), + data.fe_values.get_quadrature(), + data.fe_values.get_update_flags()) {} FEValues fe_values; @@ -90,8 +90,8 @@ namespace Assembly { struct Data { - Data(const bool assemble_reference) : - assemble_reference(assemble_reference) + Data(const bool assemble_reference) + : assemble_reference(assemble_reference) {} std::vector local_dof_indices; FullMatrix local_matrix; @@ -166,7 +166,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -190,7 +191,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -211,11 +213,11 @@ RightHandSide::value(const Point &p, template -LaplaceProblem::LaplaceProblem() : - triangulation(MPI_COMM_WORLD), - dof_handler(triangulation), - fe(1), - quadrature(fe.degree + 1) +LaplaceProblem::LaplaceProblem() + : triangulation(MPI_COMM_WORLD) + , dof_handler(triangulation) + , fe(1) + , quadrature(fe.degree + 1) {} @@ -257,8 +259,10 @@ LaplaceProblem::setup_system() // 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. - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); typedef FilteredIterator::active_cell_iterator> @@ -438,8 +442,10 @@ LaplaceProblem::postprocess() for (unsigned int i = 0; i < estimated_error_per_cell.size(); ++i) estimated_error_per_cell(i) = i; - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.3, 0.03); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.3, + 0.03); triangulation.execute_coarsening_and_refinement(); } diff --git a/tests/trilinos/block_vector_iterator_03.cc b/tests/trilinos/block_vector_iterator_03.cc index f8d05a38d4..aed6d4d8a9 100644 --- a/tests/trilinos/block_vector_iterator_03.cc +++ b/tests/trilinos/block_vector_iterator_03.cc @@ -169,11 +169,12 @@ test() deallog << "Check 6: " << (v1 == v2 ? "true" : "false") << std::endl; // check std::transform - std::transform( - v1.begin(), - v1.end(), - v2.begin(), - std::bind(std::multiplies(), std::placeholders::_1, 2.0)); + std::transform(v1.begin(), + v1.end(), + v2.begin(), + std::bind(std::multiplies(), + std::placeholders::_1, + 2.0)); v2 *= 1. / 2.; deallog << "Check 7: " << (v1 == v2 ? "true" : "false") << std::endl; diff --git a/tests/trilinos/copy_to_dealvec.cc b/tests/trilinos/copy_to_dealvec.cc index 81ff06ac0b..c296e86413 100644 --- a/tests/trilinos/copy_to_dealvec.cc +++ b/tests/trilinos/copy_to_dealvec.cc @@ -49,8 +49,9 @@ test() TrilinosWrappers::MPI::Vector vb(local_active, MPI_COMM_WORLD); TrilinosWrappers::MPI::Vector v(local_active, local_relevant, MPI_COMM_WORLD); - LinearAlgebra::distributed::Vector copied( - local_active, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector copied(local_active, + local_relevant, + MPI_COMM_WORLD); // set local values vb(myid * 2) = myid * 2.0; diff --git a/tests/trilinos/copy_to_dealvec_block.cc b/tests/trilinos/copy_to_dealvec_block.cc index b7fa3eba32..7d283b7bfd 100644 --- a/tests/trilinos/copy_to_dealvec_block.cc +++ b/tests/trilinos/copy_to_dealvec_block.cc @@ -49,11 +49,13 @@ test() local_relevant.add_range(1, 2); TrilinosWrappers::MPI::Vector vb_one(local_active, MPI_COMM_WORLD); - TrilinosWrappers::MPI::Vector v_one( - local_active, local_relevant, MPI_COMM_WORLD); + TrilinosWrappers::MPI::Vector v_one(local_active, + local_relevant, + MPI_COMM_WORLD); - LinearAlgebra::distributed::Vector copied_one( - local_active, local_relevant, MPI_COMM_WORLD); + LinearAlgebra::distributed::Vector copied_one(local_active, + local_relevant, + MPI_COMM_WORLD); // set local values vb_one(myid * 2) = myid * 2.0; diff --git a/tests/trilinos/deal_solver_01.cc b/tests/trilinos/deal_solver_01.cc index ab148b5f28..c274cfbda7 100644 --- a/tests/trilinos/deal_solver_01.cc +++ b/tests/trilinos/deal_solver_01.cc @@ -79,7 +79,9 @@ main(int argc, char **argv) deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 42, 44); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 42, + 44); } } diff --git a/tests/trilinos/deal_solver_02.cc b/tests/trilinos/deal_solver_02.cc index 5bbeca1677..1d40a52c17 100644 --- a/tests/trilinos/deal_solver_02.cc +++ b/tests/trilinos/deal_solver_02.cc @@ -80,7 +80,9 @@ main(int argc, char **argv) deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 49, 51); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 49, + 51); } } diff --git a/tests/trilinos/deal_solver_03.cc b/tests/trilinos/deal_solver_03.cc index 2dd5584206..9e02ec0842 100644 --- a/tests/trilinos/deal_solver_03.cc +++ b/tests/trilinos/deal_solver_03.cc @@ -81,7 +81,9 @@ main(int argc, char **argv) deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 74, 76); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 74, + 76); } } diff --git a/tests/trilinos/deal_solver_04.cc b/tests/trilinos/deal_solver_04.cc index c19f058f5e..95b10aa83b 100644 --- a/tests/trilinos/deal_solver_04.cc +++ b/tests/trilinos/deal_solver_04.cc @@ -80,7 +80,9 @@ main(int argc, char **argv) deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 0, 42); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 0, + 42); } } diff --git a/tests/trilinos/deal_solver_05.cc b/tests/trilinos/deal_solver_05.cc index effb508cc6..c2317055e7 100644 --- a/tests/trilinos/deal_solver_05.cc +++ b/tests/trilinos/deal_solver_05.cc @@ -78,7 +78,9 @@ main(int argc, char **argv) PreconditionIdentity preconditioner; deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 45, 47); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 45, + 47); } } diff --git a/tests/trilinos/deal_solver_06.cc b/tests/trilinos/deal_solver_06.cc index 493a173518..2d6623f53a 100644 --- a/tests/trilinos/deal_solver_06.cc +++ b/tests/trilinos/deal_solver_06.cc @@ -78,7 +78,9 @@ main(int argc, char **argv) PreconditionIdentity preconditioner; deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 5269, 5271); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 5269, + 5271); } } diff --git a/tests/trilinos/direct_solver.cc b/tests/trilinos/direct_solver.cc index a49c6469bb..e051e48715 100644 --- a/tests/trilinos/direct_solver.cc +++ b/tests/trilinos/direct_solver.cc @@ -77,7 +77,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -90,7 +91,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -124,7 +126,9 @@ BoundaryValues::value(const Point &p, template -Step4::Step4() : fe(1), dof_handler(triangulation) +Step4::Step4() + : fe(1) + , dof_handler(triangulation) {} @@ -146,8 +150,10 @@ Step4::setup_system() constraints.clear(); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); diff --git a/tests/trilinos/direct_solver_2.cc b/tests/trilinos/direct_solver_2.cc index 598576dfd8..08d5f0faff 100644 --- a/tests/trilinos/direct_solver_2.cc +++ b/tests/trilinos/direct_solver_2.cc @@ -85,7 +85,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -97,7 +98,8 @@ template class RightHandSideTwo : public Function { public: - RightHandSideTwo() : Function() + RightHandSideTwo() + : Function() {} virtual double @@ -110,7 +112,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -156,13 +159,13 @@ BoundaryValues::value(const Point &p, template -Step4::Step4() : - triangulation(MPI_COMM_WORLD, - typename Triangulation::MeshSmoothing( - Triangulation::smoothing_on_refinement | - Triangulation::smoothing_on_coarsening)), - fe(1), - dof_handler(triangulation) +Step4::Step4() + : triangulation(MPI_COMM_WORLD, + typename Triangulation::MeshSmoothing( + Triangulation::smoothing_on_refinement | + Triangulation::smoothing_on_coarsening)) + , fe(1) + , dof_handler(triangulation) {} @@ -184,8 +187,10 @@ Step4::setup_system() constraints.clear(); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs(); @@ -202,16 +207,22 @@ Step4::setup_system() MPI_COMM_WORLD, locally_relevant_dofs); - system_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, dsp, MPI_COMM_WORLD); + system_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + dsp, + MPI_COMM_WORLD); solution.reinit(locally_relevant_dofs, MPI_COMM_WORLD); - system_rhs.reinit( - locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD, true); + system_rhs.reinit(locally_owned_dofs, + locally_relevant_dofs, + MPI_COMM_WORLD, + true); - system_rhs_two.reinit( - locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD, true); + system_rhs_two.reinit(locally_owned_dofs, + locally_relevant_dofs, + MPI_COMM_WORLD, + true); } @@ -276,8 +287,9 @@ Step4::assemble_system() system_matrix, system_rhs); - constraints.distribute_local_to_global( - cell_rhs_two, local_dof_indices, system_rhs_two); + constraints.distribute_local_to_global(cell_rhs_two, + local_dof_indices, + system_rhs_two); } } system_matrix.compress(VectorOperation::add); diff --git a/tests/trilinos/direct_solver_3.cc b/tests/trilinos/direct_solver_3.cc index 99bcd75ace..c5bb19f743 100644 --- a/tests/trilinos/direct_solver_3.cc +++ b/tests/trilinos/direct_solver_3.cc @@ -87,7 +87,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -100,7 +101,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -119,13 +121,13 @@ BoundaryValues::value(const Point &p, template -Step4::Step4() : - triangulation(MPI_COMM_WORLD, - typename Triangulation::MeshSmoothing( - Triangulation::smoothing_on_refinement | - Triangulation::smoothing_on_coarsening)), - fe(1), - dof_handler(triangulation) +Step4::Step4() + : triangulation(MPI_COMM_WORLD, + typename Triangulation::MeshSmoothing( + Triangulation::smoothing_on_refinement | + Triangulation::smoothing_on_coarsening)) + , fe(1) + , dof_handler(triangulation) {} @@ -147,8 +149,10 @@ Step4::setup_system() constraints.clear(); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs(); @@ -165,15 +169,18 @@ Step4::setup_system() MPI_COMM_WORLD, locally_relevant_dofs); - system_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, dsp, MPI_COMM_WORLD); + system_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + dsp, + MPI_COMM_WORLD); solution.reinit(locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD); system_rhs.reinit(locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD); - system_rhs_two.reinit( - locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD); + system_rhs_two.reinit(locally_owned_dofs, + locally_relevant_dofs, + MPI_COMM_WORLD); } @@ -226,13 +233,18 @@ Step4::assemble_system() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, system_matrix); - - constraints.distribute_local_to_global( - cell_rhs, local_dof_indices, system_rhs, cell_matrix); - constraints.distribute_local_to_global( - cell_rhs_two, local_dof_indices, system_rhs_two, cell_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + system_matrix); + + constraints.distribute_local_to_global(cell_rhs, + local_dof_indices, + system_rhs, + cell_matrix); + constraints.distribute_local_to_global(cell_rhs_two, + local_dof_indices, + system_rhs_two, + cell_matrix); } } system_matrix.compress(VectorOperation::add); @@ -272,8 +284,9 @@ Step4::solve() QGauss(3), VectorTools::L2_norm); deallog << " L2 error: " - << VectorTools::compute_global_error( - triangulation, cellwise_error, VectorTools::L2_norm) + << VectorTools::compute_global_error(triangulation, + cellwise_error, + VectorTools::L2_norm) << std::endl; // do solve 2 without refactorizing diff --git a/tests/trilinos/elide_zeros.cc b/tests/trilinos/elide_zeros.cc index 7feb590663..08df6aa8ae 100644 --- a/tests/trilinos/elide_zeros.cc +++ b/tests/trilinos/elide_zeros.cc @@ -133,12 +133,12 @@ namespace LinearAdvectionTest template - AdvectionProblem::AdvectionProblem() : - n_mpi_processes(Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD)), - this_mpi_process(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)), - triangulation(MPI_COMM_WORLD), - fe(1), - dof_handler(triangulation) + AdvectionProblem::AdvectionProblem() + : n_mpi_processes(Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD)) + , this_mpi_process(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)) + , triangulation(MPI_COMM_WORLD) + , fe(1) + , dof_handler(triangulation) { std::vector repetitions(2); repetitions[0] = 2; @@ -146,8 +146,10 @@ namespace LinearAdvectionTest const Point<2> p0(0.0, 0.0); const Point<2> p1(2.0, 1.0); - GridGenerator::subdivided_hyper_rectangle( - triangulation, repetitions, p0, p1); + GridGenerator::subdivided_hyper_rectangle(triangulation, + repetitions, + p0, + p1); } template diff --git a/tests/trilinos/n_nonzeros_02.cc b/tests/trilinos/n_nonzeros_02.cc index 1e1ebf06bc..884c8b46e4 100644 --- a/tests/trilinos/n_nonzeros_02.cc +++ b/tests/trilinos/n_nonzeros_02.cc @@ -47,13 +47,13 @@ test() // create an empty sparsity pattern TrilinosWrappers::SparsityPattern sparsity; sparsity.reinit(dof_handler.n_dofs(), dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern( - dof_handler, - coupling, - sparsity, - ConstraintMatrix(), - false, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(dof_handler, + coupling, + sparsity, + ConstraintMatrix(), + false, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); sparsity.compress(); // attach a sparse matrix to it diff --git a/tests/trilinos/n_nonzeros_02_parallel.cc b/tests/trilinos/n_nonzeros_02_parallel.cc index 4334a9880b..998579172e 100644 --- a/tests/trilinos/n_nonzeros_02_parallel.cc +++ b/tests/trilinos/n_nonzeros_02_parallel.cc @@ -58,13 +58,13 @@ test() system_partitioning, system_relevant_set, MPI_COMM_WORLD); - DoFTools::make_sparsity_pattern( - dof_handler, - coupling, - sparsity, - ConstraintMatrix(), - false, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(dof_handler, + coupling, + sparsity, + ConstraintMatrix(), + false, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); sparsity.compress(); // attach a sparse matrix to it diff --git a/tests/trilinos/parallel_block_vector_copy_01.cc b/tests/trilinos/parallel_block_vector_copy_01.cc index 97aaed48d4..fb17bccc10 100644 --- a/tests/trilinos/parallel_block_vector_copy_01.cc +++ b/tests/trilinos/parallel_block_vector_copy_01.cc @@ -49,9 +49,10 @@ main(int argc, char **argv) for (unsigned int b = 0; b < n_blocks; ++b) { locally_owned_partitioning[b].set_size(n_dofs_per_block); - locally_owned_partitioning[b].add_range( - this_mpi_process * (n_dofs_per_block / 2), - (this_mpi_process + 1) * (n_dofs_per_block / 2)); + locally_owned_partitioning[b].add_range(this_mpi_process * + (n_dofs_per_block / 2), + (this_mpi_process + 1) * + (n_dofs_per_block / 2)); } BlockVector parallel_vector; diff --git a/tests/trilinos/precondition.cc b/tests/trilinos/precondition.cc index 301e4f31d9..9cbebeed67 100644 --- a/tests/trilinos/precondition.cc +++ b/tests/trilinos/precondition.cc @@ -78,7 +78,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -91,7 +92,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -125,7 +127,9 @@ BoundaryValues::value(const Point &p, template -Step4::Step4() : fe(1), dof_handler(triangulation) +Step4::Step4() + : fe(1) + , dof_handler(triangulation) {} @@ -147,8 +151,10 @@ Step4::setup_system() constraints.clear(); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); diff --git a/tests/trilinos/precondition_amg_dgp.cc b/tests/trilinos/precondition_amg_dgp.cc index 57eecbd433..b324fa8c01 100644 --- a/tests/trilinos/precondition_amg_dgp.cc +++ b/tests/trilinos/precondition_amg_dgp.cc @@ -137,7 +137,9 @@ private: template -Step4::Step4() : fe(1), dof_handler(triangulation) +Step4::Step4() + : fe(1) + , dof_handler(triangulation) {} @@ -196,8 +198,9 @@ Step4::solve() deallog.push(Utilities::int_to_string(dof_handler.n_dofs(), 5)); TrilinosWrappers::PreconditionAMG preconditioner; TrilinosWrappers::PreconditionAMG::AdditionalData data; - DoFTools::extract_constant_modes( - dof_handler, std::vector(1, true), data.constant_modes); + DoFTools::extract_constant_modes(dof_handler, + std::vector(1, true), + data.constant_modes); data.smoother_sweeps = 2; { solution = 0; diff --git a/tests/trilinos/precondition_amg_smoother.cc b/tests/trilinos/precondition_amg_smoother.cc index 5541511e4d..808894d6a0 100644 --- a/tests/trilinos/precondition_amg_smoother.cc +++ b/tests/trilinos/precondition_amg_smoother.cc @@ -77,7 +77,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -90,7 +91,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -124,7 +126,9 @@ BoundaryValues::value(const Point &p, template -Step4::Step4() : fe(1), dof_handler(triangulation) +Step4::Step4() + : fe(1) + , dof_handler(triangulation) {} @@ -146,8 +150,10 @@ Step4::setup_system() constraints.clear(); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); diff --git a/tests/trilinos/precondition_muelu_dgp.cc b/tests/trilinos/precondition_muelu_dgp.cc index 7a52dc9e1e..286f6ddd89 100644 --- a/tests/trilinos/precondition_muelu_dgp.cc +++ b/tests/trilinos/precondition_muelu_dgp.cc @@ -137,7 +137,9 @@ private: template -Step4::Step4() : fe(1), dof_handler(triangulation) +Step4::Step4() + : fe(1) + , dof_handler(triangulation) {} @@ -196,8 +198,9 @@ Step4::solve() deallog.push(Utilities::int_to_string(dof_handler.n_dofs(), 5)); TrilinosWrappers::PreconditionAMGMueLu preconditioner; TrilinosWrappers::PreconditionAMGMueLu::AdditionalData data; - DoFTools::extract_constant_modes( - dof_handler, std::vector(1, true), data.constant_modes); + DoFTools::extract_constant_modes(dof_handler, + std::vector(1, true), + data.constant_modes); data.smoother_sweeps = 2; { solution = 0; diff --git a/tests/trilinos/precondition_muelu_q_iso_q1.cc b/tests/trilinos/precondition_muelu_q_iso_q1.cc index 768bb62256..932e7557e3 100644 --- a/tests/trilinos/precondition_muelu_q_iso_q1.cc +++ b/tests/trilinos/precondition_muelu_q_iso_q1.cc @@ -84,7 +84,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -97,7 +98,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -131,11 +133,11 @@ BoundaryValues::value(const Point &p, template -Step4::Step4() : - fe(3), - dof_handler(triangulation), - fe_precondition(3), - dof_handler_precondition(triangulation) +Step4::Step4() + : fe(3) + , dof_handler(triangulation) + , fe_precondition(3) + , dof_handler_precondition(triangulation) {} @@ -158,8 +160,10 @@ Step4::setup_system() constraints.clear(); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); @@ -267,8 +271,9 @@ Step4::assemble_preconditioner() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, preconditioner_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + preconditioner_matrix); } preconditioner_matrix.compress(VectorOperation::add); } diff --git a/tests/trilinos/precondition_muelu_smoother.cc b/tests/trilinos/precondition_muelu_smoother.cc index 0ad5b8bb88..dff77a7752 100644 --- a/tests/trilinos/precondition_muelu_smoother.cc +++ b/tests/trilinos/precondition_muelu_smoother.cc @@ -77,7 +77,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -90,7 +91,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -124,7 +126,9 @@ BoundaryValues::value(const Point &p, template -Step4::Step4() : fe(1), dof_handler(triangulation) +Step4::Step4() + : fe(1) + , dof_handler(triangulation) {} @@ -146,8 +150,10 @@ Step4::setup_system() constraints.clear(); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); diff --git a/tests/trilinos/precondition_q_iso_q1.cc b/tests/trilinos/precondition_q_iso_q1.cc index 8d2506b1fe..0ac5b98fd8 100644 --- a/tests/trilinos/precondition_q_iso_q1.cc +++ b/tests/trilinos/precondition_q_iso_q1.cc @@ -84,7 +84,8 @@ template class RightHandSide : public Function { public: - RightHandSide() : Function() + RightHandSide() + : Function() {} virtual double @@ -97,7 +98,8 @@ template class BoundaryValues : public Function { public: - BoundaryValues() : Function() + BoundaryValues() + : Function() {} virtual double @@ -131,11 +133,11 @@ BoundaryValues::value(const Point &p, template -Step4::Step4() : - fe(3), - dof_handler(triangulation), - fe_precondition(3), - dof_handler_precondition(triangulation) +Step4::Step4() + : fe(3) + , dof_handler(triangulation) + , fe_precondition(3) + , dof_handler_precondition(triangulation) {} @@ -158,8 +160,10 @@ Step4::setup_system() constraints.clear(); std::map boundary_values; - VectorTools::interpolate_boundary_values( - dof_handler, 0, BoundaryValues(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + BoundaryValues(), + constraints); constraints.close(); DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); @@ -267,8 +271,9 @@ Step4::assemble_preconditioner() } cell->get_dof_indices(local_dof_indices); - constraints.distribute_local_to_global( - cell_matrix, local_dof_indices, preconditioner_matrix); + constraints.distribute_local_to_global(cell_matrix, + local_dof_indices, + preconditioner_matrix); } preconditioner_matrix.compress(VectorOperation::add); } diff --git a/tests/trilinos/renumbering_01.cc b/tests/trilinos/renumbering_01.cc index 50b897f397..9f0d6b9e5b 100644 --- a/tests/trilinos/renumbering_01.cc +++ b/tests/trilinos/renumbering_01.cc @@ -70,13 +70,13 @@ private: TrilinosWrappers::SparseMatrix system_matrix; public: - Test(const bool do_renumber) : - mpi_communicator(MPI_COMM_WORLD), - rank(Utilities::MPI::this_mpi_process(mpi_communicator)), - n_ranks(Utilities::MPI::n_mpi_processes(mpi_communicator)), - triangulation(mpi_communicator), - dof_handler(triangulation), - fe(1) + Test(const bool do_renumber) + : mpi_communicator(MPI_COMM_WORLD) + , rank(Utilities::MPI::this_mpi_process(mpi_communicator)) + , n_ranks(Utilities::MPI::n_mpi_processes(mpi_communicator)) + , triangulation(mpi_communicator) + , dof_handler(triangulation) + , fe(1) { deallog << "Start"; @@ -131,8 +131,10 @@ private: MPI_COMM_WORLD, locally_relevant_dofs); - system_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, sparsity_pattern, MPI_COMM_WORLD); + system_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + sparsity_pattern, + MPI_COMM_WORLD); deallog << "local_range: " << system_matrix.local_range().first << " - " << system_matrix.local_range().second << std::endl; } diff --git a/tests/trilinos/solver_03.cc b/tests/trilinos/solver_03.cc index 982cb153ba..f6d2355a67 100644 --- a/tests/trilinos/solver_03.cc +++ b/tests/trilinos/solver_03.cc @@ -74,7 +74,9 @@ main(int argc, char **argv) deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 42, 44); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 42, + 44); } } diff --git a/tests/trilinos/solver_05.cc b/tests/trilinos/solver_05.cc index 4143c9f92b..3218e2a091 100644 --- a/tests/trilinos/solver_05.cc +++ b/tests/trilinos/solver_05.cc @@ -74,7 +74,9 @@ main(int argc, char **argv) deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 70, 72); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 70, + 72); } } diff --git a/tests/trilinos/solver_07.cc b/tests/trilinos/solver_07.cc index 9e0066c67d..62931e2706 100644 --- a/tests/trilinos/solver_07.cc +++ b/tests/trilinos/solver_07.cc @@ -73,7 +73,9 @@ main(int argc, char **argv) deallog << "Solver type: " << typeid(solver).name() << std::endl; - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 40, 42); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 40, + 42); } } diff --git a/tests/trilinos/solver_control_01.cc b/tests/trilinos/solver_control_01.cc index fd898f656c..fbb8c5fb38 100644 --- a/tests/trilinos/solver_control_01.cc +++ b/tests/trilinos/solver_control_01.cc @@ -75,8 +75,10 @@ main(int argc, char **argv) // Expects success SolverControl control(2000, 1.e-3); TrilinosWrappers::SolverCG solver(control); - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 42, 44); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 42, + 44); } deallog.pop(); @@ -86,8 +88,10 @@ main(int argc, char **argv) // Expects failure SolverControl control(20, 1.e-3); TrilinosWrappers::SolverCG solver(control); - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 0, 19); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 0, + 19); } deallog.pop(); } diff --git a/tests/trilinos/solver_control_02.cc b/tests/trilinos/solver_control_02.cc index 53f6d682ed..8d2f6ec198 100644 --- a/tests/trilinos/solver_control_02.cc +++ b/tests/trilinos/solver_control_02.cc @@ -75,8 +75,10 @@ main(int argc, char **argv) // Expects success ReductionControl control(2000, 1.e-30, 1e-6); TrilinosWrappers::SolverCG solver(control); - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 49, 51); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 49, + 51); } deallog.pop(); @@ -86,8 +88,10 @@ main(int argc, char **argv) // Expects success ReductionControl control(2000, 1.e-3, 1e-9); TrilinosWrappers::SolverCG solver(control); - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 42, 44); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 42, + 44); } deallog.pop(); @@ -97,8 +101,10 @@ main(int argc, char **argv) // Expects failure ReductionControl control(20, 1.e-30, 1e-6); TrilinosWrappers::SolverCG solver(control); - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 0, 19); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 0, + 19); } deallog.pop(); } diff --git a/tests/trilinos/solver_control_03.cc b/tests/trilinos/solver_control_03.cc index 1a0910b7a1..4b42b6fb29 100644 --- a/tests/trilinos/solver_control_03.cc +++ b/tests/trilinos/solver_control_03.cc @@ -75,8 +75,10 @@ main(int argc, char **argv) // Expects success IterationNumberControl control(2000, 1.e-3); TrilinosWrappers::SolverCG solver(control); - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 42, 44); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 42, + 44); } deallog.pop(); @@ -86,8 +88,10 @@ main(int argc, char **argv) // Expects success IterationNumberControl control(20, 1.e-3); TrilinosWrappers::SolverCG solver(control); - check_solver_within_range( - solver.solve(A, u, f, preconditioner), control.last_step(), 19, 21); + check_solver_within_range(solver.solve(A, u, f, preconditioner), + control.last_step(), + 19, + 21); } deallog.pop(); } diff --git a/tests/trilinos/solver_control_06.cc b/tests/trilinos/solver_control_06.cc index 184054f1b8..f52fea4620 100644 --- a/tests/trilinos/solver_control_06.cc +++ b/tests/trilinos/solver_control_06.cc @@ -119,17 +119,18 @@ private: TimerOutput timer; }; -Test_Solver_Output::Test_Solver_Output() : - mpi_comm(MPI_COMM_WORLD), - n_mpi_proc(Utilities::MPI::n_mpi_processes(mpi_comm)), - this_mpi_proc(Utilities::MPI::this_mpi_process(mpi_comm)), - triangulation(mpi_comm, - typename Triangulation<2>::MeshSmoothing( - Triangulation<2>::smoothing_on_refinement | - Triangulation<2>::smoothing_on_coarsening)), - dof_handler(triangulation), - fe(1), - pcout(std::cout, (Utilities::MPI::this_mpi_process(mpi_comm) == 0)), +Test_Solver_Output::Test_Solver_Output() + : mpi_comm(MPI_COMM_WORLD) + , n_mpi_proc(Utilities::MPI::n_mpi_processes(mpi_comm)) + , this_mpi_proc(Utilities::MPI::this_mpi_process(mpi_comm)) + , triangulation(mpi_comm, + typename Triangulation<2>::MeshSmoothing( + Triangulation<2>::smoothing_on_refinement | + Triangulation<2>::smoothing_on_coarsening)) + , dof_handler(triangulation) + , fe(1) + , pcout(std::cout, (Utilities::MPI::this_mpi_process(mpi_comm) == 0)) + , // pcout(deallog.get_file_stream(), // (Utilities::MPI::this_mpi_process(mpi_comm) == 0)), timer(mpi_comm, pcout, TimerOutput::never, TimerOutput::wall_times) @@ -199,15 +200,18 @@ Test_Solver_Output::setup_system() locally_owned_dofs = dof_handler.locally_owned_dofs(); DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs); - locally_relevant_solution.reinit( - locally_owned_dofs, locally_relevant_dofs, mpi_comm); + locally_relevant_solution.reinit(locally_owned_dofs, + locally_relevant_dofs, + mpi_comm); system_rhs.reinit(locally_owned_dofs, mpi_comm); constraints.clear(); constraints.reinit(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - VectorTools::interpolate_boundary_values( - dof_handler, 0, Functions::ZeroFunction<2>(), constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + Functions::ZeroFunction<2>(), + constraints); constraints.close(); DynamicSparsityPattern dsp(locally_relevant_dofs); @@ -298,10 +302,13 @@ Test_Solver_Output::solve_base() SolverControl solver_control(100, 1e-12); TrilinosWrappers::SolverBase::AdditionalData solver_data(true); - TrilinosWrappers::SolverBase solver( - TrilinosWrappers::SolverBase::cg, solver_control, solver_data); - solver.solve( - system_matrix, completely_distributed_solution, system_rhs, prec); + TrilinosWrappers::SolverBase solver(TrilinosWrappers::SolverBase::cg, + solver_control, + solver_data); + solver.solve(system_matrix, + completely_distributed_solution, + system_rhs, + prec); pcout << " Solved in " << solver_control.last_step() << " iterations." << std::endl; @@ -325,8 +332,10 @@ Test_Solver_Output::solve_cg() SolverControl solver_control(100, 1e-12); LA::SolverCG::AdditionalData solver_data(true); LA::SolverCG solver(solver_control, solver_data); - solver.solve( - system_matrix, completely_distributed_solution, system_rhs, prec); + solver.solve(system_matrix, + completely_distributed_solution, + system_rhs, + prec); pcout << " Solved in " << solver_control.last_step() << " iterations." << std::endl; @@ -350,8 +359,10 @@ Test_Solver_Output::solve_cgs() SolverControl solver_control(100, 1e-12); TrilinosWrappers::SolverCGS::AdditionalData solver_data(true); TrilinosWrappers::SolverCGS solver(solver_control, solver_data); - solver.solve( - system_matrix, completely_distributed_solution, system_rhs, prec); + solver.solve(system_matrix, + completely_distributed_solution, + system_rhs, + prec); pcout << " Solved in " << solver_control.last_step() << " iterations." << std::endl; @@ -375,8 +386,10 @@ Test_Solver_Output::solve_gmres() SolverControl solver_control(100, 1e-12); LA::SolverGMRES::AdditionalData solver_data(true, 25); LA::SolverGMRES solver(solver_control, solver_data); - solver.solve( - system_matrix, completely_distributed_solution, system_rhs, prec); + solver.solve(system_matrix, + completely_distributed_solution, + system_rhs, + prec); pcout << " Solved in " << solver_control.last_step() << " iterations." << std::endl; @@ -400,8 +413,10 @@ Test_Solver_Output::solve_bicgstab() SolverControl solver_control(100, 1e-12); TrilinosWrappers::SolverBicgstab::AdditionalData solver_data(true); TrilinosWrappers::SolverBicgstab solver(solver_control, solver_data); - solver.solve( - system_matrix, completely_distributed_solution, system_rhs, prec); + solver.solve(system_matrix, + completely_distributed_solution, + system_rhs, + prec); pcout << " Solved in " << solver_control.last_step() << " iterations." << std::endl; @@ -425,8 +440,10 @@ Test_Solver_Output::solve_tfqmr() SolverControl solver_control(100, 1e-12); TrilinosWrappers::SolverTFQMR::AdditionalData solver_data(true); TrilinosWrappers::SolverTFQMR solver(solver_control, solver_data); - solver.solve( - system_matrix, completely_distributed_solution, system_rhs, prec); + solver.solve(system_matrix, + completely_distributed_solution, + system_rhs, + prec); pcout << " Solved in " << solver_control.last_step() << " iterations." << std::endl; diff --git a/tests/trilinos/subtract_mean_value_04.cc b/tests/trilinos/subtract_mean_value_04.cc index ee84ef3356..b27239ffdc 100644 --- a/tests/trilinos/subtract_mean_value_04.cc +++ b/tests/trilinos/subtract_mean_value_04.cc @@ -72,8 +72,9 @@ main(int argc, char *argv[]) deallog << "OK" << std::endl; } { - TrilinosWrappers::MPI::BlockVector v( - std::vector(1, local_range), MPI_COMM_WORLD); + TrilinosWrappers::MPI::BlockVector v(std::vector(1, + local_range), + MPI_COMM_WORLD); test(v); } } diff --git a/tests/trilinos/trilinos_sparsity_pattern_02.cc b/tests/trilinos/trilinos_sparsity_pattern_02.cc index c59639534f..e321a2a637 100644 --- a/tests/trilinos/trilinos_sparsity_pattern_02.cc +++ b/tests/trilinos/trilinos_sparsity_pattern_02.cc @@ -91,8 +91,9 @@ namespace Step22 DoFRenumbering::component_wise(dof_handler, block_component); std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block( - dof_handler, dofs_per_block, block_component); + DoFTools::count_dofs_per_block(dof_handler, + dofs_per_block, + block_component); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; { @@ -117,12 +118,12 @@ namespace Step22 owned_partitioning, relevant_partitioning, mpi_communicator); - DoFTools::make_sparsity_pattern( - dof_handler, - bsp, - new_constraints, - false, - Utilities::MPI::this_mpi_process(mpi_communicator)); + DoFTools::make_sparsity_pattern(dof_handler, + bsp, + new_constraints, + false, + Utilities::MPI::this_mpi_process( + mpi_communicator)); bsp.compress(); } diff --git a/tests/trilinos/trilinos_sparsity_pattern_05.cc b/tests/trilinos/trilinos_sparsity_pattern_05.cc index 47cc2ff433..1fc7088dac 100644 --- a/tests/trilinos/trilinos_sparsity_pattern_05.cc +++ b/tests/trilinos/trilinos_sparsity_pattern_05.cc @@ -58,12 +58,12 @@ test() relevant_partitioning, MPI_COMM_WORLD); - DoFTools::make_sparsity_pattern( - dh, - sp, - constraints, - true, - Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + DoFTools::make_sparsity_pattern(dh, + sp, + constraints, + true, + Utilities::MPI::this_mpi_process( + MPI_COMM_WORLD)); sp.compress(); // output diff --git a/tests/vector/complex_vector_21_negative.cc b/tests/vector/complex_vector_21_negative.cc index 92e4bf0d28..d49d9288dd 100644 --- a/tests/vector/complex_vector_21_negative.cc +++ b/tests/vector/complex_vector_21_negative.cc @@ -45,12 +45,12 @@ test(Vector> &v) // check that the entries are ok for (unsigned int i = 0; i < v.size(); ++i) - AssertThrow( - ((pattern[i] == true) && - (v(i) - (-1. * i * std::complex(i + 1., i + 2.) * 3. / 4.) == - std::complex(0))) || - ((pattern[i] == false) && (v(i) == std::complex(0))), - ExcInternalError()); + AssertThrow(((pattern[i] == true) && + (v(i) - (-1. * i * std::complex(i + 1., i + 2.) * 3. / + 4.) == + std::complex(0))) || + ((pattern[i] == false) && (v(i) == std::complex(0))), + ExcInternalError()); deallog << "OK" << std::endl; } diff --git a/tests/vector_tools/boundaries.cc b/tests/vector_tools/boundaries.cc index d2ec3074b0..cdc5604202 100644 --- a/tests/vector_tools/boundaries.cc +++ b/tests/vector_tools/boundaries.cc @@ -48,7 +48,8 @@ template class MySquareFunction : public Function { public: - MySquareFunction() : Function(2) + MySquareFunction() + : Function(2) {} virtual double diff --git a/tests/vector_tools/boundaries_complex.cc b/tests/vector_tools/boundaries_complex.cc index 75f737b824..db2ef3c763 100644 --- a/tests/vector_tools/boundaries_complex.cc +++ b/tests/vector_tools/boundaries_complex.cc @@ -50,14 +50,16 @@ template class MySquareFunction : public Function> { public: - MySquareFunction() : Function>(2) + MySquareFunction() + : Function>(2) {} virtual std::complex value(const Point &p, const unsigned int component) const { - return std::complex( - 100 * (component + 1) * p.square() * std::sin(p.square()), 0); + return std::complex(100 * (component + 1) * p.square() * + std::sin(p.square()), + 0); } virtual void diff --git a/tests/vector_tools/boundaries_complex_hp.cc b/tests/vector_tools/boundaries_complex_hp.cc index 8640dd2a30..526b264a21 100644 --- a/tests/vector_tools/boundaries_complex_hp.cc +++ b/tests/vector_tools/boundaries_complex_hp.cc @@ -48,14 +48,16 @@ template class MySquareFunction : public Function> { public: - MySquareFunction() : Function>(2) + MySquareFunction() + : Function>(2) {} virtual std::complex value(const Point &p, const unsigned int component) const { - return std::complex( - 100 * (component + 1) * p.square() * std::sin(p.square()), 0); + return std::complex(100 * (component + 1) * p.square() * + std::sin(p.square()), + 0); } virtual void diff --git a/tests/vector_tools/integrate_difference_01.cc b/tests/vector_tools/integrate_difference_01.cc index 60231e82a7..7eb8d5543e 100644 --- a/tests/vector_tools/integrate_difference_01.cc +++ b/tests/vector_tools/integrate_difference_01.cc @@ -46,7 +46,8 @@ template class Ref : public Function { public: - Ref() : Function(dim) + Ref() + : Function(dim) {} double diff --git a/tests/vector_tools/integrate_difference_01_complex_01.cc b/tests/vector_tools/integrate_difference_01_complex_01.cc index 468a1b1186..609064cc37 100644 --- a/tests/vector_tools/integrate_difference_01_complex_01.cc +++ b/tests/vector_tools/integrate_difference_01_complex_01.cc @@ -47,7 +47,8 @@ template class Ref : public Function> { public: - Ref() : Function>(dim) + Ref() + : Function>(dim) {} std::complex diff --git a/tests/vector_tools/integrate_difference_01_complex_02.cc b/tests/vector_tools/integrate_difference_01_complex_02.cc index 6e50879370..0ccba1d6d0 100644 --- a/tests/vector_tools/integrate_difference_01_complex_02.cc +++ b/tests/vector_tools/integrate_difference_01_complex_02.cc @@ -47,7 +47,8 @@ template class Ref : public Function> { public: - Ref() : Function>(dim) + Ref() + : Function>(dim) {} std::complex diff --git a/tests/vector_tools/integrate_difference_01_complex_03.cc b/tests/vector_tools/integrate_difference_01_complex_03.cc index f4bc4ce621..1a87e48f12 100644 --- a/tests/vector_tools/integrate_difference_01_complex_03.cc +++ b/tests/vector_tools/integrate_difference_01_complex_03.cc @@ -48,7 +48,8 @@ template class Ref : public Function> { public: - Ref() : Function>(dim) + Ref() + : Function>(dim) {} std::complex diff --git a/tests/vector_tools/integrate_difference_02.cc b/tests/vector_tools/integrate_difference_02.cc index 306789c8c6..1586a78740 100644 --- a/tests/vector_tools/integrate_difference_02.cc +++ b/tests/vector_tools/integrate_difference_02.cc @@ -47,7 +47,8 @@ template class Ref : public Function { public: - Ref() : Function(dim) + Ref() + : Function(dim) {} double diff --git a/tests/vector_tools/integrate_difference_03.cc b/tests/vector_tools/integrate_difference_03.cc index 15430b1cd8..1d2364a5d6 100644 --- a/tests/vector_tools/integrate_difference_03.cc +++ b/tests/vector_tools/integrate_difference_03.cc @@ -48,7 +48,8 @@ template class Ref : public Function { public: - Ref() : Function(dim) + Ref() + : Function(dim) {} double diff --git a/tests/vector_tools/integrate_difference_04.cc b/tests/vector_tools/integrate_difference_04.cc index efb48f32ff..eeb93872a4 100644 --- a/tests/vector_tools/integrate_difference_04.cc +++ b/tests/vector_tools/integrate_difference_04.cc @@ -48,7 +48,8 @@ template class Ref : public Function { public: - Ref() : Function(dim) + Ref() + : Function(dim) {} double diff --git a/tests/vector_tools/integrate_difference_04_hp.cc b/tests/vector_tools/integrate_difference_04_hp.cc index 5eefb2104b..b63b489921 100644 --- a/tests/vector_tools/integrate_difference_04_hp.cc +++ b/tests/vector_tools/integrate_difference_04_hp.cc @@ -54,7 +54,8 @@ template class Ref : public Function { public: - Ref() : Function(dim) + Ref() + : Function(dim) {} double diff --git a/tests/vector_tools/integrate_difference_04_hp_02.cc b/tests/vector_tools/integrate_difference_04_hp_02.cc index 4926061e7b..1602b5ca77 100644 --- a/tests/vector_tools/integrate_difference_04_hp_02.cc +++ b/tests/vector_tools/integrate_difference_04_hp_02.cc @@ -58,7 +58,8 @@ template class Ref : public Function { public: - Ref() : Function(dim) + Ref() + : Function(dim) {} double diff --git a/tests/vector_tools/integrate_difference_05.cc b/tests/vector_tools/integrate_difference_05.cc index 11b5c8abd8..2e5e0f91b8 100644 --- a/tests/vector_tools/integrate_difference_05.cc +++ b/tests/vector_tools/integrate_difference_05.cc @@ -51,7 +51,8 @@ template class Ref : public Function { public: - Ref() : Function(2 * dim) + Ref() + : Function(2 * dim) {} void diff --git a/tests/zoltan/zoltan_01.cc b/tests/zoltan/zoltan_01.cc index 2f4a4c6b13..5e8a59e810 100644 --- a/tests/zoltan/zoltan_01.cc +++ b/tests/zoltan/zoltan_01.cc @@ -37,8 +37,9 @@ test() // subdivides into 5 subdomains deallog << "Partitioning" << std::endl; - GridTools::partition_triangulation( - 5, triangulation, SparsityTools::Partitioner::zoltan); + GridTools::partition_triangulation(5, + triangulation, + SparsityTools::Partitioner::zoltan); for (typename Triangulation::active_cell_iterator cell = triangulation.begin_active(); cell != triangulation.end(); -- 2.39.5