From 579e1dd6e508543f0916ed8c175d2b9c92ce2ccc Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 11 Jun 2018 16:53:59 +0200 Subject: [PATCH] Avoid FunctionMap in code base --- examples/step-13/step-13.cc | 11 +- examples/step-14/step-14.cc | 14 +- examples/step-15/step-15.cc | 11 +- examples/step-16/step-16.cc | 20 +- examples/step-17/step-17.cc | 19 +- examples/step-18/step-18.cc | 19 +- examples/step-22/step-22.cc | 13 +- examples/step-26/step-26.cc | 11 +- examples/step-27/step-27.cc | 11 +- examples/step-28/step-28.cc | 11 +- examples/step-31/step-31.cc | 11 +- examples/step-32/step-32.cc | 2 +- examples/step-40/step-40.cc | 11 +- examples/step-42/step-42.cc | 11 +- examples/step-45/step-45.cc | 13 +- examples/step-46/doc/intro.dox | 4 +- examples/step-46/step-46.cc | 28 +- examples/step-50/step-50.cc | 16 +- examples/step-51/step-51.cc | 9 +- examples/step-55/step-55.cc | 13 +- examples/step-57/step-57.cc | 13 +- examples/step-6/step-6.cc | 23 +- examples/step-7/step-7.cc | 2 +- examples/step-8/step-8.cc | 11 +- include/deal.II/dofs/dof_handler.h | 4 +- include/deal.II/hp/dof_handler.h | 4 +- .../deal.II/multigrid/mg_constrained_dofs.h | 13 +- include/deal.II/multigrid/mg_tools.h | 14 +- include/deal.II/numerics/error_estimator.h | 50 ++-- .../numerics/error_estimator.templates.h | 56 ++-- include/deal.II/numerics/matrix_tools.h | 2 - include/deal.II/numerics/vector_tools.h | 27 +- .../deal.II/numerics/vector_tools.templates.h | 38 +-- source/multigrid/mg_tools.cc | 26 +- source/multigrid/mg_tools.inst.in | 6 +- source/numerics/error_estimator.inst.in | 256 ++++++++++-------- source/numerics/error_estimator_1d.cc | 46 ++-- source/numerics/error_estimator_1d.inst.in | 240 ++++++++-------- .../numerics/vector_tools_constraints.inst.in | 40 +-- 39 files changed, 612 insertions(+), 517 deletions(-) diff --git a/examples/step-13/step-13.cc b/examples/step-13/step-13.cc index 6dd3566ef3..6d06b10df0 100644 --- a/examples/step-13/step-13.cc +++ b/examples/step-13/step-13.cc @@ -1239,11 +1239,12 @@ namespace Step13 { Vector estimated_error_per_cell( this->triangulation->n_active_cells()); - KellyErrorEstimator::estimate(this->dof_handler, - QGauss(3), - typename FunctionMap::type(), - this->solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate( + this->dof_handler, + QGauss(3), + std::map *>(), + this->solution, + estimated_error_per_cell); GridRefinement::refine_and_coarsen_fixed_number(*this->triangulation, estimated_error_per_cell, 0.3, diff --git a/examples/step-14/step-14.cc b/examples/step-14/step-14.cc index 34c3db408c..94db5a16e8 100644 --- a/examples/step-14/step-14.cc +++ b/examples/step-14/step-14.cc @@ -894,11 +894,12 @@ namespace Step14 { Vector estimated_error_per_cell( this->triangulation->n_active_cells()); - KellyErrorEstimator::estimate(this->dof_handler, - QGauss(3), - typename FunctionMap::type(), - this->solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate( + this->dof_handler, + QGauss(3), + std::map *>(), + this->solution, + estimated_error_per_cell); GridRefinement::refine_and_coarsen_fixed_number(*this->triangulation, estimated_error_per_cell, 0.3, @@ -970,9 +971,10 @@ namespace Step14 // here is described in more detail in the documentation of that class. Vector estimated_error_per_cell( this->triangulation->n_active_cells()); + std::map *> dummy_function_map; KellyErrorEstimator::estimate(this->dof_handler, *this->face_quadrature, - typename FunctionMap::type(), + dummy_function_map, this->solution, estimated_error_per_cell); diff --git a/examples/step-15/step-15.cc b/examples/step-15/step-15.cc index daf5166d6c..4fb050a82c 100644 --- a/examples/step-15/step-15.cc +++ b/examples/step-15/step-15.cc @@ -377,11 +377,12 @@ namespace Step15 { Vector estimated_error_per_cell(triangulation.n_active_cells()); - KellyErrorEstimator::estimate(dof_handler, - QGauss(3), - typename FunctionMap::type(), - present_solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate( + dof_handler, + QGauss(3), + std::map *>(), + present_solution, + estimated_error_per_cell); GridRefinement::refine_and_coarsen_fixed_number(triangulation, estimated_error_per_cell, diff --git a/examples/step-16/step-16.cc b/examples/step-16/step-16.cc index 3e9faf5c41..dafed9e4d2 100644 --- a/examples/step-16/step-16.cc +++ b/examples/step-16/step-16.cc @@ -280,10 +280,11 @@ namespace Step16 constraints.clear(); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - std::set dirichlet_boundary_ids = {0}; - Functions::ZeroFunction homogeneous_dirichlet_bc; - const typename FunctionMap::type dirichlet_boundary_functions = { - {types::boundary_id(0), &homogeneous_dirichlet_bc}}; + std::set dirichlet_boundary_ids = {0}; + Functions::ZeroFunction homogeneous_dirichlet_bc; + const std::map *> + dirichlet_boundary_functions = { + {types::boundary_id(0), &homogeneous_dirichlet_bc}}; VectorTools::interpolate_boundary_values( static_cast &>(dof_handler), dirichlet_boundary_functions, @@ -575,11 +576,12 @@ namespace Step16 { Vector estimated_error_per_cell(triangulation.n_active_cells()); - KellyErrorEstimator::estimate(dof_handler, - QGauss(3), - typename FunctionMap::type(), - solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate( + dof_handler, + QGauss(3), + std::map *>(), + solution, + estimated_error_per_cell); GridRefinement::refine_and_coarsen_fixed_number(triangulation, estimated_error_per_cell, 0.3, diff --git a/examples/step-17/step-17.cc b/examples/step-17/step-17.cc index 24c4d3390c..2b82fa39d4 100644 --- a/examples/step-17/step-17.cc +++ b/examples/step-17/step-17.cc @@ -763,15 +763,16 @@ namespace Step17 const Vector localized_solution(solution); Vector local_error_per_cell(triangulation.n_active_cells()); - KellyErrorEstimator::estimate(dof_handler, - QGauss(2), - typename FunctionMap::type(), - localized_solution, - local_error_per_cell, - ComponentMask(), - nullptr, - MultithreadInfo::n_threads(), - this_mpi_process); + KellyErrorEstimator::estimate( + dof_handler, + QGauss(2), + std::map *>(), + localized_solution, + local_error_per_cell, + ComponentMask(), + nullptr, + MultithreadInfo::n_threads(), + this_mpi_process); // Now all processes have computed error indicators for their own // cells and stored them in the respective elements of the diff --git a/examples/step-18/step-18.cc b/examples/step-18/step-18.cc index d741d992c3..d1d3d4a448 100644 --- a/examples/step-18/step-18.cc +++ b/examples/step-18/step-18.cc @@ -1444,15 +1444,16 @@ namespace Step18 { // First, let each process compute error indicators for the cells it owns: Vector error_per_cell(triangulation.n_active_cells()); - KellyErrorEstimator::estimate(dof_handler, - QGauss(2), - typename FunctionMap::type(), - incremental_displacement, - error_per_cell, - ComponentMask(), - nullptr, - MultithreadInfo::n_threads(), - this_mpi_process); + KellyErrorEstimator::estimate( + dof_handler, + QGauss(2), + std::map *>(), + incremental_displacement, + error_per_cell, + ComponentMask(), + nullptr, + MultithreadInfo::n_threads(), + this_mpi_process); // Then set up a global vector into which we merge the local indicators // from each of the %parallel processes: diff --git a/examples/step-22/step-22.cc b/examples/step-22/step-22.cc index dcb7a8138a..dadec522f1 100644 --- a/examples/step-22/step-22.cc +++ b/examples/step-22/step-22.cc @@ -939,12 +939,13 @@ namespace Step22 Vector estimated_error_per_cell(triangulation.n_active_cells()); FEValuesExtractors::Scalar pressure(dim); - KellyErrorEstimator::estimate(dof_handler, - QGauss(degree + 1), - typename FunctionMap::type(), - solution, - estimated_error_per_cell, - fe.component_mask(pressure)); + KellyErrorEstimator::estimate( + dof_handler, + QGauss(degree + 1), + std::map *>(), + solution, + estimated_error_per_cell, + fe.component_mask(pressure)); GridRefinement::refine_and_coarsen_fixed_number(triangulation, estimated_error_per_cell, diff --git a/examples/step-26/step-26.cc b/examples/step-26/step-26.cc index 449118ff4a..b2438c9f92 100644 --- a/examples/step-26/step-26.cc +++ b/examples/step-26/step-26.cc @@ -338,11 +338,12 @@ namespace Step26 { Vector estimated_error_per_cell(triangulation.n_active_cells()); - KellyErrorEstimator::estimate(dof_handler, - QGauss(fe.degree + 1), - typename FunctionMap::type(), - solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate( + dof_handler, + QGauss(fe.degree + 1), + std::map *>(), + solution, + estimated_error_per_cell); GridRefinement::refine_and_coarsen_fixed_fraction(triangulation, estimated_error_per_cell, diff --git a/examples/step-27/step-27.cc b/examples/step-27/step-27.cc index 5999537050..10b0a24f5b 100644 --- a/examples/step-27/step-27.cc +++ b/examples/step-27/step-27.cc @@ -411,11 +411,12 @@ namespace Step27 // class as always. Estimating the smoothness is done in the respective // function of this class; that function is discussed further down below: Vector estimated_error_per_cell(triangulation.n_active_cells()); - KellyErrorEstimator::estimate(dof_handler, - face_quadrature_collection, - typename FunctionMap::type(), - solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate( + dof_handler, + face_quadrature_collection, + std::map *>(), + solution, + estimated_error_per_cell); Vector smoothness_indicators(triangulation.n_active_cells()); diff --git a/examples/step-28/step-28.cc b/examples/step-28/step-28.cc index 09982a4c9c..de76f24baf 100644 --- a/examples/step-28/step-28.cc +++ b/examples/step-28/step-28.cc @@ -1053,11 +1053,12 @@ namespace Step28 template void EnergyGroup::estimate_errors(Vector &error_indicators) const { - KellyErrorEstimator::estimate(dof_handler, - QGauss(fe.degree + 1), - typename FunctionMap::type(), - solution, - error_indicators); + KellyErrorEstimator::estimate( + dof_handler, + QGauss(fe.degree + 1), + std::map *>(), + solution, + error_indicators); error_indicators /= solution.linfty_norm(); } diff --git a/examples/step-31/step-31.cc b/examples/step-31/step-31.cc index 85fc938fc5..cfddddc28c 100644 --- a/examples/step-31/step-31.cc +++ b/examples/step-31/step-31.cc @@ -1973,11 +1973,12 @@ namespace Step31 { Vector estimated_error_per_cell(triangulation.n_active_cells()); - KellyErrorEstimator::estimate(temperature_dof_handler, - QGauss(temperature_degree + 1), - typename FunctionMap::type(), - temperature_solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate( + temperature_dof_handler, + QGauss(temperature_degree + 1), + std::map *>(), + temperature_solution, + estimated_error_per_cell); GridRefinement::refine_and_coarsen_fixed_fraction(triangulation, estimated_error_per_cell, diff --git a/examples/step-32/step-32.cc b/examples/step-32/step-32.cc index 80a9488193..04d905bbff 100644 --- a/examples/step-32/step-32.cc +++ b/examples/step-32/step-32.cc @@ -3486,7 +3486,7 @@ namespace Step32 KellyErrorEstimator::estimate( temperature_dof_handler, QGauss(parameters.temperature_degree + 1), - typename FunctionMap::type(), + std::map *>(), temperature_solution, estimated_error_per_cell, ComponentMask(), diff --git a/examples/step-40/step-40.cc b/examples/step-40/step-40.cc index 98794c8e70..adfcdb0b7e 100644 --- a/examples/step-40/step-40.cc +++ b/examples/step-40/step-40.cc @@ -527,11 +527,12 @@ namespace Step40 TimerOutput::Scope t(computing_timer, "refine"); Vector estimated_error_per_cell(triangulation.n_active_cells()); - KellyErrorEstimator::estimate(dof_handler, - QGauss(3), - typename FunctionMap::type(), - locally_relevant_solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate( + dof_handler, + QGauss(3), + std::map *>(), + locally_relevant_solution, + estimated_error_per_cell); parallel::distributed::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-42/step-42.cc b/examples/step-42/step-42.cc index 9ceafbe03e..76fd79da01 100644 --- a/examples/step-42/step-42.cc +++ b/examples/step-42/step-42.cc @@ -1918,11 +1918,12 @@ namespace Step42 else { Vector estimated_error_per_cell(triangulation.n_active_cells()); - KellyErrorEstimator::estimate(dof_handler, - QGauss(fe.degree + 2), - typename FunctionMap::type(), - solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate( + dof_handler, + QGauss(fe.degree + 2), + std::map *>(), + solution, + estimated_error_per_cell); parallel::distributed::GridRefinement ::refine_and_coarsen_fixed_number( triangulation, estimated_error_per_cell, 0.3, 0.03); diff --git a/examples/step-45/step-45.cc b/examples/step-45/step-45.cc index a971228999..b46802807a 100644 --- a/examples/step-45/step-45.cc +++ b/examples/step-45/step-45.cc @@ -723,12 +723,13 @@ namespace Step45 Vector estimated_error_per_cell(triangulation.n_active_cells()); FEValuesExtractors::Scalar pressure(dim); - KellyErrorEstimator::estimate(dof_handler, - QGauss(degree + 1), - typename FunctionMap::type(), - solution, - estimated_error_per_cell, - fe.component_mask(pressure)); + KellyErrorEstimator::estimate( + dof_handler, + QGauss(degree + 1), + std::map *>(), + solution, + estimated_error_per_cell, + fe.component_mask(pressure)); parallel::distributed::GridRefinement::refine_and_coarsen_fixed_number( triangulation, estimated_error_per_cell, 0.3, 0.0); diff --git a/examples/step-46/doc/intro.dox b/examples/step-46/doc/intro.dox index 720d1aa788..e4a31b6bc1 100644 --- a/examples/step-46/doc/intro.dox +++ b/examples/step-46/doc/intro.dox @@ -618,7 +618,7 @@ code like the following: stokes_component_mask[d] = true; KellyErrorEstimator::estimate (dof_handler, face_q_collection, - typename FunctionMap::type(), + std::map*>(), solution, stokes_estimated_error_per_cell, stokes_component_mask); @@ -628,7 +628,7 @@ code like the following: elasticity_component_mask[dim+1+d] = true; KellyErrorEstimator::estimate (dof_handler, face_q_collection, - typename FunctionMap::type(), + std::map*>(), solution, elasticity_estimated_error_per_cell, elasticity_component_mask); diff --git a/examples/step-46/step-46.cc b/examples/step-46/step-46.cc index 945239a67d..169acd16e6 100644 --- a/examples/step-46/step-46.cc +++ b/examples/step-46/step-46.cc @@ -949,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, + std::map *>(), + 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, + std::map *>(), + 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 diff --git a/examples/step-50/step-50.cc b/examples/step-50/step-50.cc index c1dcc3a79a..4936ee9e2c 100644 --- a/examples/step-50/step-50.cc +++ b/examples/step-50/step-50.cc @@ -281,8 +281,8 @@ namespace Step50 constraints.reinit(locally_relevant_set); DoFTools::make_hanging_node_constraints(mg_dof_handler, constraints); - std::set dirichlet_boundary_ids; - typename FunctionMap::type dirichlet_boundary; + std::set dirichlet_boundary_ids; + std::map *> dirichlet_boundary; Functions::ConstantFunction homogeneous_dirichlet_bc(1.0); dirichlet_boundary_ids.insert(0); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; @@ -842,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( + mg_dof_handler, + QGauss(degree + 1), + std::map *>(), + 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 80fe60211d..a6c78f5d33 100644 --- a/examples/step-51/step-51.cc +++ b/examples/step-51/step-51.cc @@ -448,8 +448,8 @@ namespace Step51 constraints.clear(); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - typename FunctionMap::type boundary_functions; - Solution solution_function; + std::map *> boundary_functions; + Solution solution_function; boundary_functions[0] = &solution_function; VectorTools::project_boundary_values(dof_handler, boundary_functions, @@ -1329,8 +1329,9 @@ namespace Step51 Vector estimated_error_per_cell( triangulation.n_active_cells()); - FEValuesExtractors::Scalar scalar(dim); - typename FunctionMap::type neumann_boundary; + FEValuesExtractors::Scalar scalar(dim); + std::map *> + neumann_boundary; KellyErrorEstimator::estimate(dof_handler_local, QGauss(3), neumann_boundary, diff --git a/examples/step-55/step-55.cc b/examples/step-55/step-55.cc index 6b4aecf036..dead482824 100644 --- a/examples/step-55/step-55.cc +++ b/examples/step-55/step-55.cc @@ -690,12 +690,13 @@ namespace Step55 Vector estimated_error_per_cell(triangulation.n_active_cells()); FEValuesExtractors::Vector velocities(0); - KellyErrorEstimator::estimate(dof_handler, - QGauss(3), - typename FunctionMap::type(), - locally_relevant_solution, - estimated_error_per_cell, - fe.component_mask(velocities)); + KellyErrorEstimator::estimate( + dof_handler, + QGauss(3), + std::map *>(), + locally_relevant_solution, + estimated_error_per_cell, + fe.component_mask(velocities)); parallel::distributed::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-57/step-57.cc b/examples/step-57/step-57.cc index dd0f40b980..3ccca1355d 100644 --- a/examples/step-57/step-57.cc +++ b/examples/step-57/step-57.cc @@ -588,12 +588,13 @@ namespace Step57 { Vector estimated_error_per_cell(triangulation.n_active_cells()); FEValuesExtractors::Vector velocity(0); - KellyErrorEstimator::estimate(dof_handler, - QGauss(degree + 1), - typename FunctionMap::type(), - present_solution, - estimated_error_per_cell, - fe.component_mask(velocity)); + KellyErrorEstimator::estimate( + dof_handler, + QGauss(degree + 1), + std::map *>(), + present_solution, + estimated_error_per_cell, + fe.component_mask(velocity)); GridRefinement::refine_and_coarsen_fixed_number(triangulation, estimated_error_per_cell, diff --git a/examples/step-6/step-6.cc b/examples/step-6/step-6.cc index 5aed7ce384..0afc1ef5aa 100644 --- a/examples/step-6/step-6.cc +++ b/examples/step-6/step-6.cc @@ -469,12 +469,12 @@ void Step6::solve() // Secondly, the function wants a list of boundary indicators for those // boundaries where we have imposed Neumann values of the kind // $\partial_n u(\mathbf x) = h(\mathbf x)$, along with a function $h(\mathbf -// x)$ for each such boundary. This information is represented by an object of -// type FunctionMap::type that is a typedef to a map from boundary -// indicators to function objects describing the Neumann boundary values. In the -// present example program, we do not use Neumann boundary values, so this map -// is empty, and in fact constructed using the default constructor of the map in -// the place where the function call expects the respective function argument. +// x)$ for each such boundary. This information is represented by a map from +// boundary indicators to function objects describing the Neumann boundary +// values. In the present example program, we do not use Neumann boundary +// values, so this map is empty, and in fact constructed using the default +// constructor of the map in the place where the function call expects the +// respective function argument. // // The output is a vector of values for all active cells. While it may // make sense to compute the value of a solution degree of freedom @@ -487,11 +487,12 @@ void Step6::refine_grid() { Vector estimated_error_per_cell(triangulation.n_active_cells()); - KellyErrorEstimator::estimate(dof_handler, - QGauss(3), - typename FunctionMap::type(), - solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate( + dof_handler, + QGauss(3), + std::map *>(), + solution, + estimated_error_per_cell); // The above function returned one error indicator value for each cell in // the estimated_error_per_cell array. Refinement is now done diff --git a/examples/step-7/step-7.cc b/examples/step-7/step-7.cc index ee0a7947b8..2fac5b0c77 100644 --- a/examples/step-7/step-7.cc +++ b/examples/step-7/step-7.cc @@ -819,7 +819,7 @@ namespace Step7 KellyErrorEstimator::estimate( dof_handler, QGauss(3), - typename FunctionMap::type(), + std::map *>(), solution, estimated_error_per_cell); diff --git a/examples/step-8/step-8.cc b/examples/step-8/step-8.cc index 684bd6ac1b..f219e8997b 100644 --- a/examples/step-8/step-8.cc +++ b/examples/step-8/step-8.cc @@ -487,11 +487,12 @@ namespace Step8 { Vector estimated_error_per_cell(triangulation.n_active_cells()); - KellyErrorEstimator::estimate(dof_handler, - QGauss(2), - typename FunctionMap::type(), - solution, - estimated_error_per_cell); + KellyErrorEstimator::estimate( + dof_handler, + QGauss(2), + std::map *>(), + solution, + estimated_error_per_cell); GridRefinement::refine_and_coarsen_fixed_number(triangulation, estimated_error_per_cell, diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index e0118fcb45..557abd90b6 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -29,7 +30,6 @@ #include #include #include -#include #include #include @@ -855,8 +855,6 @@ public: * reason that a @p map rather than a @p set is used is the same as * described in the documentation of that variant of * DoFTools::make_boundary_sparsity_pattern() that takes a map. - * To this end, the type of the @p boundary_ids argument is the same - * as typename FunctionMap::type. * * There is, however, another overload of this function that takes * a @p set argument (see below). diff --git a/include/deal.II/hp/dof_handler.h b/include/deal.II/hp/dof_handler.h index 1da049a872..d2dbda18a2 100644 --- a/include/deal.II/hp/dof_handler.h +++ b/include/deal.II/hp/dof_handler.h @@ -21,13 +21,13 @@ #include #include +#include #include #include #include #include #include -#include #include #include @@ -648,8 +648,6 @@ namespace hp * reason that a @p map rather than a @p set is used is the same as * described in the documentation of that variant of * DoFTools::make_boundary_sparsity_pattern() that takes a map. - * To this end, the type of the @p boundary_ids argument is the same - * as typename FunctionMap::type. * * There is, however, another overload of this function that takes * a @p set argument (see below). diff --git a/include/deal.II/multigrid/mg_constrained_dofs.h b/include/deal.II/multigrid/mg_constrained_dofs.h index 2bd38545a4..04d443cd03 100644 --- a/include/deal.II/multigrid/mg_constrained_dofs.h +++ b/include/deal.II/multigrid/mg_constrained_dofs.h @@ -31,8 +31,6 @@ DEAL_II_NAMESPACE_OPEN template class DoFHandler; -template -struct FunctionMap; /** @@ -81,8 +79,9 @@ public: */ template DEAL_II_DEPRECATED void - initialize(const DoFHandler & dof, - const typename FunctionMap::type &function_map, + initialize(const DoFHandler &dof, + const std::map *> + & function_map, const ComponentMask &component_mask = ComponentMask()); /** @@ -272,9 +271,9 @@ MGConstrainedDoFs::initialize(const DoFHandler &dof) template inline void MGConstrainedDoFs::initialize( - const DoFHandler & dof, - const typename FunctionMap::type &function_map, - const ComponentMask & component_mask) + const DoFHandler & dof, + const std::map *> &function_map, + const ComponentMask &component_mask) { initialize(dof); diff --git a/include/deal.II/multigrid/mg_tools.h b/include/deal.II/multigrid/mg_tools.h index b571e7c9cf..229e2ef72b 100644 --- a/include/deal.II/multigrid/mg_tools.h +++ b/include/deal.II/multigrid/mg_tools.h @@ -208,8 +208,9 @@ namespace MGTools template void make_boundary_list( - const DoFHandler & mg_dof, - const typename FunctionMap::type & function_map, + const DoFHandler &mg_dof, + const std::map *> + & function_map, std::vector> &boundary_indices, const ComponentMask &component_mask = ComponentMask()); @@ -222,10 +223,11 @@ namespace MGTools */ template void - make_boundary_list(const DoFHandler & mg_dof, - const typename FunctionMap::type &function_map, - std::vector & boundary_indices, - const ComponentMask &component_mask = ComponentMask()); + make_boundary_list(const DoFHandler & mg_dof, + const std::map *> &function_map, + std::vector &boundary_indices, + const ComponentMask & component_mask = ComponentMask()); /** * The same function as above, but return an IndexSet rather than a diff --git a/include/deal.II/numerics/error_estimator.h b/include/deal.II/numerics/error_estimator.h index 499d995b32..973ad4fe1c 100644 --- a/include/deal.II/numerics/error_estimator.h +++ b/include/deal.II/numerics/error_estimator.h @@ -22,8 +22,6 @@ #include #include -#include - #include #include @@ -339,7 +337,8 @@ public: const Mapping &mapping, const DoFHandlerType & dof, const Quadrature & quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const InputVector & solution, Vector & error, @@ -359,7 +358,8 @@ public: estimate( const DoFHandlerType & dof, const Quadrature &quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const InputVector & solution, Vector & error, @@ -389,7 +389,8 @@ public: const Mapping &mapping, const DoFHandlerType & dof, const Quadrature & quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const std::vector &solutions, std::vector *> & errors, @@ -409,7 +410,8 @@ public: estimate( const DoFHandlerType & dof, const Quadrature &quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const std::vector &solutions, std::vector *> & errors, @@ -431,7 +433,8 @@ public: const Mapping & mapping, const DoFHandlerType & dof, const hp::QCollection &quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const InputVector & solution, Vector & error, @@ -452,7 +455,8 @@ public: estimate( const DoFHandlerType & dof, const hp::QCollection &quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const InputVector & solution, Vector & error, @@ -474,7 +478,8 @@ public: const Mapping & mapping, const DoFHandlerType & dof, const hp::QCollection &quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const std::vector &solutions, std::vector *> & errors, @@ -495,7 +500,8 @@ public: estimate( const DoFHandlerType & dof, const hp::QCollection &quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const std::vector &solutions, std::vector *> & errors, @@ -619,7 +625,8 @@ public: const Mapping<1, spacedim> &mapping, const DoFHandlerType & dof, const Quadrature<0> & quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const InputVector & solution, Vector & error, @@ -639,7 +646,8 @@ public: estimate( const DoFHandlerType &dof, const Quadrature<0> & quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const InputVector & solution, Vector & error, @@ -669,7 +677,8 @@ public: const Mapping<1, spacedim> &mapping, const DoFHandlerType & dof, const Quadrature<0> & quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const std::vector &solutions, std::vector *> & errors, @@ -689,7 +698,8 @@ public: estimate( const DoFHandlerType &dof, const Quadrature<0> & quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const std::vector &solutions, std::vector *> & errors, @@ -711,7 +721,8 @@ public: const Mapping<1, spacedim> &mapping, const DoFHandlerType & dof, const hp::QCollection<0> & quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const InputVector & solution, Vector & error, @@ -732,7 +743,8 @@ public: estimate( const DoFHandlerType & dof, const hp::QCollection<0> &quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const InputVector & solution, Vector & error, @@ -754,7 +766,8 @@ public: const Mapping<1, spacedim> &mapping, const DoFHandlerType & dof, const hp::QCollection<0> & quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const std::vector &solutions, std::vector *> & errors, @@ -775,7 +788,8 @@ public: estimate( const DoFHandlerType & dof, const hp::QCollection<0> &quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const std::vector &solutions, std::vector *> & errors, diff --git a/include/deal.II/numerics/error_estimator.templates.h b/include/deal.II/numerics/error_estimator.templates.h index e4b84d1b80..ee5fdc2aa6 100644 --- a/include/deal.II/numerics/error_estimator.templates.h +++ b/include/deal.II/numerics/error_estimator.templates.h @@ -176,9 +176,10 @@ namespace internal * Some more references to input data to the * KellyErrorEstimator::estimate() function. */ - const typename FunctionMap::type *neumann_bc; - const ComponentMask component_mask; - const Function * coefficients; + const std::map *> + * neumann_bc; + const ComponentMask component_mask; + const Function *coefficients; /** * Constructor. @@ -192,9 +193,10 @@ namespace internal const unsigned int n_solution_vectors, const types::subdomain_id subdomain_id, const types::material_id material_id, - const typename FunctionMap::type *neumann_bc, - const ComponentMask & component_mask, - const Function * coefficients); + const std::map *> + * neumann_bc, + const ComponentMask & component_mask, + const Function *coefficients); /** * Resize the arrays so that they fit the number of quadrature points @@ -216,9 +218,10 @@ namespace internal const unsigned int n_solution_vectors, const types::subdomain_id subdomain_id, const types::material_id material_id, - const typename FunctionMap::type *neumann_bc, - const ComponentMask & component_mask, - const Function * coefficients) + const std::map *> + * neumann_bc, + const ComponentMask & component_mask, + const Function *coefficients) : finite_element(fe) , face_quadratures(face_quadratures) , fe_face_values_cell(mapping, @@ -1075,7 +1078,8 @@ KellyErrorEstimator::estimate( const Mapping &mapping, const DoFHandlerType & dof_handler, const Quadrature & quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const InputVector & solution, Vector & error, @@ -1110,7 +1114,8 @@ void KellyErrorEstimator::estimate( const DoFHandlerType & dof_handler, const Quadrature &quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const InputVector & solution, Vector & error, @@ -1143,7 +1148,8 @@ KellyErrorEstimator::estimate( const Mapping & mapping, const DoFHandlerType & dof_handler, const hp::QCollection &quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const InputVector & solution, Vector & error, @@ -1178,7 +1184,8 @@ void KellyErrorEstimator::estimate( const DoFHandlerType & dof_handler, const hp::QCollection &quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const InputVector & solution, Vector & error, @@ -1212,7 +1219,8 @@ KellyErrorEstimator::estimate( const Mapping & mapping, const DoFHandlerType & dof_handler, const hp::QCollection &face_quadratures, - const typename FunctionMap::type + const std::map *> & neumann_bc, const std::vector &solutions, std::vector *> & errors, @@ -1256,13 +1264,10 @@ KellyErrorEstimator::estimate( Assert(solutions.size() == errors.size(), ExcIncompatibleNumberOfElements(solutions.size(), errors.size())); - for (typename FunctionMap::type:: - const_iterator i = neumann_bc.begin(); - i != neumann_bc.end(); - ++i) - Assert(i->second->n_components == n_components, - ExcInvalidBoundaryFunction(i->first, - i->second->n_components, + for (const auto &boundary_function : neumann_bc) + Assert(boundary_function.second->n_components == n_components, + ExcInvalidBoundaryFunction(boundary_function.first, + boundary_function.second->n_components, n_components)); Assert(component_mask.represents_n_components(n_components), @@ -1383,7 +1388,8 @@ KellyErrorEstimator::estimate( const Mapping &mapping, const DoFHandlerType & dof_handler, const Quadrature & quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const std::vector &solutions, std::vector *> & errors, @@ -1416,7 +1422,8 @@ void KellyErrorEstimator::estimate( const DoFHandlerType & dof_handler, const Quadrature &quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const std::vector &solutions, std::vector *> & errors, @@ -1449,7 +1456,8 @@ void KellyErrorEstimator::estimate( const DoFHandlerType & dof_handler, const hp::QCollection &quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const std::vector &solutions, std::vector *> & errors, diff --git a/include/deal.II/numerics/matrix_tools.h b/include/deal.II/numerics/matrix_tools.h index d5d7269c46..66b5686478 100644 --- a/include/deal.II/numerics/matrix_tools.h +++ b/include/deal.II/numerics/matrix_tools.h @@ -23,8 +23,6 @@ #include #include -#include - #include #include diff --git a/include/deal.II/numerics/vector_tools.h b/include/deal.II/numerics/vector_tools.h index 905ac1e478..dba9a1ced1 100644 --- a/include/deal.II/numerics/vector_tools.h +++ b/include/deal.II/numerics/vector_tools.h @@ -20,11 +20,11 @@ #include #include +#include #include #include #include -#include #include #include @@ -1006,8 +1006,7 @@ namespace VectorTools * The keys of this map correspond to the number @p boundary_id of the face. * numbers::internal_face_boundary_id is an illegal value for this key since * it is reserved for interior faces. For an example of how to use this - * argument with a non-empty map, see the step-16 tutorial program. (Note - * that the argument type is equal to the FunctionMap type.) + * argument with a non-empty map, see the step-16 tutorial program. * * The flags in the last parameter, @p component_mask denote which * components of the finite element space shall be interpolated. If it is @@ -1972,11 +1971,12 @@ namespace VectorTools template class DoFHandlerType> void compute_nonzero_normal_flux_constraints( - const DoFHandlerType & dof_handler, - const unsigned int first_vector_component, - const std::set & boundary_ids, - typename FunctionMap::type &function_map, - AffineConstraints & constraints, + const DoFHandlerType &dof_handler, + const unsigned int first_vector_component, + const std::set & boundary_ids, + const std::map *> + & function_map, + AffineConstraints & constraints, const Mapping &mapping = StaticMappingQ1::mapping); /** @@ -2019,11 +2019,12 @@ namespace VectorTools template class DoFHandlerType> void compute_nonzero_tangential_flux_constraints( - const DoFHandlerType & dof_handler, - const unsigned int first_vector_component, - const std::set & boundary_ids, - typename FunctionMap::type &function_map, - AffineConstraints & constraints, + const DoFHandlerType &dof_handler, + const unsigned int first_vector_component, + const std::set & boundary_ids, + const std::map *> + & function_map, + AffineConstraints & constraints, const Mapping &mapping = StaticMappingQ1::mapping); /** diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index 6a930eae8e..437bb13a2a 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -6916,8 +6916,8 @@ namespace VectorTools AffineConstraints & constraints, const Mapping & mapping) { - ZeroFunction zero_function(dim); - typename FunctionMap::type function_map; + ZeroFunction zero_function(dim); + std::map *> function_map; std::set::const_iterator it = boundary_ids.begin(); for (; it != boundary_ids.end(); ++it) function_map[*it] = &zero_function; @@ -6932,12 +6932,13 @@ namespace VectorTools template class DoFHandlerType> void compute_nonzero_normal_flux_constraints( - const DoFHandlerType & dof_handler, - const unsigned int first_vector_component, - const std::set & boundary_ids, - typename FunctionMap::type &function_map, - AffineConstraints & constraints, - const Mapping & mapping) + const DoFHandlerType &dof_handler, + const unsigned int first_vector_component, + const std::set & boundary_ids, + const std::map *> + & function_map, + AffineConstraints & constraints, + const Mapping &mapping) { Assert(dim > 1, ExcMessage("This function is not useful in 1d because it amounts " @@ -7117,7 +7118,7 @@ namespace VectorTools const Point point = fe_values.quadrature_point(i); Vector b_values(dim); - function_map[*b_id]->vector_value(point, b_values); + function_map.at(*b_id)->vector_value(point, b_values); // now enter the (dofs,(normal_vector,cell)) entry into // the map @@ -7528,8 +7529,8 @@ namespace VectorTools AffineConstraints & constraints, const Mapping & mapping) { - ZeroFunction zero_function(dim); - typename FunctionMap::type function_map; + ZeroFunction zero_function(dim); + std::map *> function_map; std::set::const_iterator it = boundary_ids.begin(); for (; it != boundary_ids.end(); ++it) function_map[*it] = &zero_function; @@ -7544,12 +7545,13 @@ namespace VectorTools template class DoFHandlerType> void compute_nonzero_tangential_flux_constraints( - const DoFHandlerType & dof_handler, - const unsigned int first_vector_component, - const std::set & boundary_ids, - typename FunctionMap::type &function_map, - AffineConstraints & constraints, - const Mapping & mapping) + const DoFHandlerType &dof_handler, + const unsigned int first_vector_component, + const std::set & boundary_ids, + const std::map *> + & function_map, + AffineConstraints & constraints, + const Mapping &mapping) { AffineConstraints no_normal_flux_constraints( constraints.get_local_lines()); @@ -7647,7 +7649,7 @@ namespace VectorTools const Point point = fe_values.quadrature_point(i); const double b_value = - function_map[*b_id]->value(point, component); + function_map.at(*b_id)->value(point, component); dof_to_b_value.insert( std::make_pair(face_dofs[i], b_value)); } diff --git a/source/multigrid/mg_tools.cc b/source/multigrid/mg_tools.cc index e686c79c6d..db1aee61e8 100644 --- a/source/multigrid/mg_tools.cc +++ b/source/multigrid/mg_tools.cc @@ -1253,8 +1253,9 @@ namespace MGTools template void make_boundary_list( - const DoFHandler & dof, - const typename FunctionMap::type & function_map, + const DoFHandler &dof, + const std::map *> + & function_map, std::vector> &boundary_indices, const ComponentMask & component_mask) { @@ -1263,10 +1264,8 @@ namespace MGTools dof.get_triangulation().n_global_levels())); std::set boundary_ids; - typename std::map *>::const_iterator - it = function_map.begin(); - for (; it != function_map.end(); ++it) - boundary_ids.insert(it->first); + for (const auto &boundary_function : function_map) + boundary_ids.insert(boundary_function.first); std::vector boundary_indexset; make_boundary_list(dof, boundary_ids, boundary_indexset, component_mask); @@ -1278,20 +1277,19 @@ namespace MGTools template void - make_boundary_list(const DoFHandler & dof, - const typename FunctionMap::type &function_map, - std::vector & boundary_indices, - const ComponentMask & component_mask) + make_boundary_list(const DoFHandler & dof, + const std::map *> &function_map, + std::vector &boundary_indices, + const ComponentMask & component_mask) { Assert(boundary_indices.size() == dof.get_triangulation().n_global_levels(), ExcDimensionMismatch(boundary_indices.size(), dof.get_triangulation().n_global_levels())); std::set boundary_ids; - typename std::map *>::const_iterator - it = function_map.begin(); - for (; it != function_map.end(); ++it) - boundary_ids.insert(it->first); + for (const auto &boundary_function : function_map) + boundary_ids.insert(boundary_function.first); make_boundary_list(dof, boundary_ids, boundary_indices, component_mask); } diff --git a/source/multigrid/mg_tools.inst.in b/source/multigrid/mg_tools.inst.in index cf997ecd8d..1a78b8e2ef 100644 --- a/source/multigrid/mg_tools.inst.in +++ b/source/multigrid/mg_tools.inst.in @@ -106,14 +106,16 @@ for (deal_II_dimension : DIMENSIONS) #if deal_II_dimension > 1 template void make_boundary_list(const DoFHandler &, - const FunctionMap::type &, + const std::map *> &, std::vector> &, const ComponentMask &); #endif template void make_boundary_list(const DoFHandler &, - const FunctionMap::type &, + const std::map *> &, std::vector &, const ComponentMask &); diff --git a/source/numerics/error_estimator.inst.in b/source/numerics/error_estimator.inst.in index dd9e3cfe5e..209fb89958 100644 --- a/source/numerics/error_estimator.inst.in +++ b/source/numerics/error_estimator.inst.in @@ -29,136 +29,160 @@ for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS; #if deal_II_dimension != 1 && deal_II_dimension <= deal_II_space_dimension template void - KellyErrorEstimator:: - estimate>( - const Mapping &, - const DH &, - const Quadrature &, - const FunctionMap::type &, - const VEC &, - Vector &, - const ComponentMask &, - const Function *, - const unsigned int, - const types::subdomain_id, - const types::material_id, - const KellyErrorEstimator::Strategy); + KellyErrorEstimator::estimate< + VEC, + DH>( + const Mapping &, + const DH &, + const Quadrature &, + const std::map *> + &, + const VEC &, + Vector &, + const ComponentMask &, + const Function *, + const unsigned int, + const types::subdomain_id, + const types::material_id, + const KellyErrorEstimator::Strategy); template void - KellyErrorEstimator:: - estimate>( - const DH &, - const Quadrature &, - const FunctionMap::type &, - const VEC &, - Vector &, - const ComponentMask &, - const Function *, - const unsigned int, - const types::subdomain_id, - const types::material_id, - const KellyErrorEstimator::Strategy); + KellyErrorEstimator::estimate< + VEC, + DH>( + const DH &, + const Quadrature &, + const std::map *> + &, + const VEC &, + Vector &, + const ComponentMask &, + const Function *, + const unsigned int, + const types::subdomain_id, + const types::material_id, + const KellyErrorEstimator::Strategy); template void - KellyErrorEstimator:: - estimate>( - const Mapping &, - const DH &, - const Quadrature &, - const FunctionMap::type &, - const std::vector &, - std::vector *> &, - const ComponentMask &, - const Function *, - const unsigned int, - const types::subdomain_id, - const types::material_id, - const KellyErrorEstimator::Strategy); + KellyErrorEstimator::estimate< + VEC, + DH>( + const Mapping &, + const DH &, + const Quadrature &, + const std::map *> + &, + const std::vector &, + std::vector *> &, + const ComponentMask &, + const Function *, + const unsigned int, + const types::subdomain_id, + const types::material_id, + const KellyErrorEstimator::Strategy); template void - KellyErrorEstimator:: - estimate>( - const DH &, - const Quadrature &, - const FunctionMap::type &, - const std::vector &, - std::vector *> &, - const ComponentMask &, - const Function *, - const unsigned int, - const types::subdomain_id, - const types::material_id, - const KellyErrorEstimator::Strategy); + KellyErrorEstimator::estimate< + VEC, + DH>( + const DH &, + const Quadrature &, + const std::map *> + &, + const std::vector &, + std::vector *> &, + const ComponentMask &, + const Function *, + const unsigned int, + const types::subdomain_id, + const types::material_id, + const KellyErrorEstimator::Strategy); template void - KellyErrorEstimator:: - estimate>( - const Mapping &, - const DH &, - const hp::QCollection &, - const FunctionMap::type &, - const VEC &, - Vector &, - const ComponentMask &, - const Function *, - const unsigned int, - const types::subdomain_id, - const types::material_id, - const KellyErrorEstimator::Strategy); + KellyErrorEstimator::estimate< + VEC, + DH>( + const Mapping &, + const DH &, + const hp::QCollection &, + const std::map *> + &, + const VEC &, + Vector &, + const ComponentMask &, + const Function *, + const unsigned int, + const types::subdomain_id, + const types::material_id, + const KellyErrorEstimator::Strategy); template void - KellyErrorEstimator:: - estimate>( - const DH &, - const hp::QCollection &, - const FunctionMap::type &, - const VEC &, - Vector &, - const ComponentMask &, - const Function *, - const unsigned int, - const types::subdomain_id, - const types::material_id, - const KellyErrorEstimator::Strategy); + KellyErrorEstimator::estimate< + VEC, + DH>( + const DH &, + const hp::QCollection &, + const std::map *> + &, + const VEC &, + Vector &, + const ComponentMask &, + const Function *, + const unsigned int, + const types::subdomain_id, + const types::material_id, + const KellyErrorEstimator::Strategy); template void - KellyErrorEstimator:: - estimate>( - const Mapping &, - const DH &, - const hp::QCollection &, - const FunctionMap::type &, - const std::vector &, - std::vector *> &, - const ComponentMask &, - const Function *, - const unsigned int, - const types::subdomain_id, - const types::material_id, - const KellyErrorEstimator::Strategy); + KellyErrorEstimator::estimate< + VEC, + DH>( + const Mapping &, + const DH &, + const hp::QCollection &, + const std::map *> + &, + const std::vector &, + std::vector *> &, + const ComponentMask &, + const Function *, + const unsigned int, + const types::subdomain_id, + const types::material_id, + const KellyErrorEstimator::Strategy); template void - KellyErrorEstimator:: - estimate>( - const DH &, - const hp::QCollection &, - const FunctionMap::type &, - const std::vector &, - std::vector *> &, - const ComponentMask &, - const Function *, - const unsigned int, - const types::subdomain_id, - const types::material_id, - const KellyErrorEstimator::Strategy); + KellyErrorEstimator::estimate< + VEC, + DH>( + const DH &, + const hp::QCollection &, + const std::map *> + &, + const std::vector &, + std::vector *> &, + const ComponentMask &, + const Function *, + const unsigned int, + const types::subdomain_id, + const types::material_id, + const KellyErrorEstimator::Strategy); #endif } diff --git a/source/numerics/error_estimator_1d.cc b/source/numerics/error_estimator_1d.cc index fdf20c7ef0..badb32ca89 100644 --- a/source/numerics/error_estimator_1d.cc +++ b/source/numerics/error_estimator_1d.cc @@ -64,7 +64,8 @@ KellyErrorEstimator<1, spacedim>::estimate( const Mapping<1, spacedim> &mapping, const DoFHandlerType & dof_handler, const Quadrature<0> & quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const InputVector & solution, Vector & error, @@ -100,7 +101,8 @@ void KellyErrorEstimator<1, spacedim>::estimate( const DoFHandlerType &dof_handler, const Quadrature<0> & quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const InputVector & solution, Vector & error, @@ -133,7 +135,8 @@ void KellyErrorEstimator<1, spacedim>::estimate( const DoFHandlerType &dof_handler, const Quadrature<0> & quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const std::vector &solutions, std::vector *> & errors, @@ -167,7 +170,8 @@ KellyErrorEstimator<1, spacedim>::estimate( const Mapping<1, spacedim> &mapping, const DoFHandlerType & dof_handler, const hp::QCollection<0> & quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const InputVector & solution, Vector & error, @@ -202,7 +206,8 @@ void KellyErrorEstimator<1, spacedim>::estimate( const DoFHandlerType & dof_handler, const hp::QCollection<0> &quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const InputVector & solution, Vector & error, @@ -235,7 +240,8 @@ void KellyErrorEstimator<1, spacedim>::estimate( const DoFHandlerType & dof_handler, const hp::QCollection<0> &quadrature, - const typename FunctionMap::type + const std::map *> & neumann_bc, const std::vector &solutions, std::vector *> & errors, @@ -269,7 +275,8 @@ KellyErrorEstimator<1, spacedim>::estimate( const Mapping<1, spacedim> & /*mapping*/, const DoFHandlerType & /*dof_handler*/, const hp::QCollection<0> &, - const typename FunctionMap::type + const std::map *> & /*neumann_bc*/, const std::vector & /*solutions*/, std::vector *> & /*errors*/, @@ -292,7 +299,8 @@ KellyErrorEstimator<1, spacedim>::estimate( const Mapping<1, spacedim> &mapping, const DoFHandlerType & dof_handler, const Quadrature<0> &, - const typename FunctionMap::type + const std::map *> & neumann_bc, const std::vector &solutions, std::vector *> & errors, @@ -340,13 +348,10 @@ KellyErrorEstimator<1, spacedim>::estimate( "indicator for internal boundaries in your boundary " "value map.")); - for (typename FunctionMap::type:: - const_iterator i = neumann_bc.begin(); - i != neumann_bc.end(); - ++i) - Assert(i->second->n_components == n_components, - ExcInvalidBoundaryFunction(i->first, - i->second->n_components, + for (const auto boundary_function : neumann_bc) + Assert(boundary_function.second->n_components == n_components, + ExcInvalidBoundaryFunction(boundary_function.first, + boundary_function.second->n_components, n_components)); Assert(component_mask.represents_n_components(n_components), @@ -371,13 +376,10 @@ KellyErrorEstimator<1, spacedim>::estimate( (coefficient->n_components == 1), ExcInvalidCoefficient()); - for (typename FunctionMap::type:: - const_iterator i = neumann_bc.begin(); - i != neumann_bc.end(); - ++i) - Assert(i->second->n_components == n_components, - ExcInvalidBoundaryFunction(i->first, - i->second->n_components, + for (const auto &boundary_function : neumann_bc) + Assert(boundary_function.second->n_components == n_components, + ExcInvalidBoundaryFunction(boundary_function.first, + boundary_function.second->n_components, n_components)); // reserve one slot for each cell and set it to zero diff --git a/source/numerics/error_estimator_1d.inst.in b/source/numerics/error_estimator_1d.inst.in index 5fd9c9a088..1c04d51fbd 100644 --- a/source/numerics/error_estimator_1d.inst.in +++ b/source/numerics/error_estimator_1d.inst.in @@ -21,128 +21,152 @@ for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS; #if deal_II_dimension == 1 && deal_II_dimension <= deal_II_space_dimension template void - KellyErrorEstimator:: - estimate>( - const Mapping &, - const DH &, - const Quadrature &, - const FunctionMap::type &, - const VEC &, - Vector &, - const ComponentMask &, - const Function *, - const unsigned int, - const types::subdomain_id, - const types::material_id, - const Strategy); + KellyErrorEstimator::estimate< + VEC, + DH>( + const Mapping &, + const DH &, + const Quadrature &, + const std::map *> + &, + const VEC &, + Vector &, + const ComponentMask &, + const Function *, + const unsigned int, + const types::subdomain_id, + const types::material_id, + const Strategy); template void - KellyErrorEstimator:: - estimate>( - const DH &, - const Quadrature &, - const FunctionMap::type &, - const VEC &, - Vector &, - const ComponentMask &, - const Function *, - const unsigned int, - const types::subdomain_id, - const types::material_id, - const Strategy); + KellyErrorEstimator::estimate< + VEC, + DH>( + const DH &, + const Quadrature &, + const std::map *> + &, + const VEC &, + Vector &, + const ComponentMask &, + const Function *, + const unsigned int, + const types::subdomain_id, + const types::material_id, + const Strategy); template void - KellyErrorEstimator:: - estimate>( - const Mapping &, - const DH &, - const Quadrature &, - const FunctionMap::type &, - const std::vector &, - std::vector *> &, - const ComponentMask &, - const Function *, - const unsigned int, - const types::subdomain_id, - const types::material_id, - const Strategy); + KellyErrorEstimator::estimate< + VEC, + DH>( + const Mapping &, + const DH &, + const Quadrature &, + const std::map *> + &, + const std::vector &, + std::vector *> &, + const ComponentMask &, + const Function *, + const unsigned int, + const types::subdomain_id, + const types::material_id, + const Strategy); template void - KellyErrorEstimator:: - estimate>( - const DH &, - const Quadrature &, - const FunctionMap::type &, - const std::vector &, - std::vector *> &, - const ComponentMask &, - const Function *, - const unsigned int, - const types::subdomain_id, - const types::material_id, - const Strategy); + KellyErrorEstimator::estimate< + VEC, + DH>( + const DH &, + const Quadrature &, + const std::map *> + &, + const std::vector &, + std::vector *> &, + const ComponentMask &, + const Function *, + const unsigned int, + const types::subdomain_id, + const types::material_id, + const Strategy); template void - KellyErrorEstimator:: - estimate>( - const Mapping &, - const DH &, - const hp::QCollection &, - const FunctionMap::type &, - const VEC &, - Vector &, - const ComponentMask &, - const Function *, - const unsigned int, - const types::subdomain_id, - const types::material_id, - const Strategy); + KellyErrorEstimator::estimate< + VEC, + DH>( + const Mapping &, + const DH &, + const hp::QCollection &, + const std::map *> + &, + const VEC &, + Vector &, + const ComponentMask &, + const Function *, + const unsigned int, + const types::subdomain_id, + const types::material_id, + const Strategy); template void - KellyErrorEstimator:: - estimate>( - const DH &, - const hp::QCollection &, - const FunctionMap::type &, - const VEC &, - Vector &, - const ComponentMask &, - const Function *, - const unsigned int, - const types::subdomain_id, - const types::material_id, - const Strategy); + KellyErrorEstimator::estimate< + VEC, + DH>( + const DH &, + const hp::QCollection &, + const std::map *> + &, + const VEC &, + Vector &, + const ComponentMask &, + const Function *, + const unsigned int, + const types::subdomain_id, + const types::material_id, + const Strategy); template void - KellyErrorEstimator:: - estimate>( - const Mapping &, - const DH &, - const hp::QCollection &, - const FunctionMap::type &, - const std::vector &, - std::vector *> &, - const ComponentMask &, - const Function *, - const unsigned int, - const types::subdomain_id, - const types::material_id, - const Strategy); + KellyErrorEstimator::estimate< + VEC, + DH>( + const Mapping &, + const DH &, + const hp::QCollection &, + const std::map *> + &, + const std::vector &, + std::vector *> &, + const ComponentMask &, + const Function *, + const unsigned int, + const types::subdomain_id, + const types::material_id, + const Strategy); template void - KellyErrorEstimator:: - estimate>( - const DH &, - const hp::QCollection &, - const FunctionMap::type &, - const std::vector &, - std::vector *> &, - const ComponentMask &, - const Function *, - const unsigned int, - const types::subdomain_id, - const types::material_id, - const Strategy); + KellyErrorEstimator::estimate< + VEC, + DH>( + const DH &, + const hp::QCollection &, + const std::map *> + &, + const std::vector &, + std::vector *> &, + const ComponentMask &, + const Function *, + const unsigned int, + const types::subdomain_id, + const types::material_id, + const Strategy); #endif } diff --git a/source/numerics/vector_tools_constraints.inst.in b/source/numerics/vector_tools_constraints.inst.in index b8418c43eb..f6bc1448a4 100644 --- a/source/numerics/vector_tools_constraints.inst.in +++ b/source/numerics/vector_tools_constraints.inst.in @@ -26,38 +26,42 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS) # if deal_II_dimension != 1 template void compute_nonzero_normal_flux_constraints( - const DoFHandler & dof_handler, - const unsigned int first_vector_component, - const std::set & boundary_ids, - FunctionMap::type &function_map, - AffineConstraints & constraints, - const Mapping & mapping); + const DoFHandler &dof_handler, + const unsigned int first_vector_component, + const std::set & boundary_ids, + const std::map *> + & function_map, + AffineConstraints & constraints, + const Mapping &mapping); template void compute_nonzero_normal_flux_constraints( const hp::DoFHandler &dof_handler, const unsigned int first_vector_component, const std::set & boundary_ids, - FunctionMap::type & function_map, - AffineConstraints & constraints, - const Mapping & mapping); + const std::map *> + & function_map, + AffineConstraints & constraints, + const Mapping &mapping); template void compute_nonzero_tangential_flux_constraints( - const DoFHandler & dof_handler, - const unsigned int first_vector_component, - const std::set & boundary_ids, - FunctionMap::type &function_map, - AffineConstraints & constraints, - const Mapping & mapping); + const DoFHandler &dof_handler, + const unsigned int first_vector_component, + const std::set & boundary_ids, + const std::map *> + & function_map, + AffineConstraints & constraints, + const Mapping &mapping); template void compute_nonzero_tangential_flux_constraints( const hp::DoFHandler &dof_handler, const unsigned int first_vector_component, const std::set & boundary_ids, - FunctionMap::type & function_map, - AffineConstraints & constraints, - const Mapping & mapping); + const std::map *> + & function_map, + AffineConstraints & constraints, + const Mapping &mapping); template void compute_no_normal_flux_constraints( -- 2.39.5