From 2a81412d1f1336cbf2d5b25cb07085d47c13b35d Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 1 Nov 2019 09:50:54 -0600 Subject: [PATCH] Use identity<...>::type in the right place. --- include/deal.II/hp/refinement.h | 26 +++++++++++++++----------- source/hp/refinement.cc | 21 ++++++++++++--------- source/hp/refinement.inst.in | 12 ++++++------ 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/include/deal.II/hp/refinement.h b/include/deal.II/hp/refinement.h index c87db67890..8cd5ae50eb 100644 --- a/include/deal.II/hp/refinement.h +++ b/include/deal.II/hp/refinement.h @@ -138,8 +138,7 @@ namespace hp */ template using ComparisonFunction = - std::function::type &, - const typename identity::type &)>; + std::function; /** * @name Setting p-adaptivity flags @@ -207,8 +206,10 @@ namespace hp const Vector & criteria, const Number p_refine_threshold, const Number p_coarsen_threshold, - const ComparisonFunction &compare_refine = std::greater(), - const ComparisonFunction &compare_coarsen = std::less()); + const ComparisonFunction::type> + &compare_refine = std::greater(), + const ComparisonFunction::type> + &compare_coarsen = std::less()); /** * Adapt which finite element to use on cells whose criteria meet a certain @@ -247,8 +248,10 @@ namespace hp const Vector & criteria, const double p_refine_fraction = 0.5, const double p_coarsen_fraction = 0.5, - const ComparisonFunction &compare_refine = std::greater(), - const ComparisonFunction &compare_coarsen = std::less()); + const ComparisonFunction::type> + &compare_refine = std::greater(), + const ComparisonFunction::type> + &compare_coarsen = std::less()); /** * Adapt which finite element to use on cells based on the regularity of the @@ -317,11 +320,12 @@ namespace hp template void p_adaptivity_from_reference( - const hp::DoFHandler &dof_handler, - const Vector & criteria, - const Vector & references, - const ComparisonFunction & compare_refine, - const ComparisonFunction & compare_coarsen); + const hp::DoFHandler & dof_handler, + const Vector & criteria, + const Vector & references, + const ComparisonFunction::type> &compare_refine, + const ComparisonFunction::type> + &compare_coarsen); /** * @} */ diff --git a/source/hp/refinement.cc b/source/hp/refinement.cc index 2d60af474a..c160347b1c 100644 --- a/source/hp/refinement.cc +++ b/source/hp/refinement.cc @@ -91,8 +91,9 @@ namespace hp const Vector & criteria, const Number p_refine_threshold, const Number p_coarsen_threshold, - const ComparisonFunction & compare_refine, - const ComparisonFunction & compare_coarsen) + const ComparisonFunction::type> &compare_refine, + const ComparisonFunction::type> + &compare_coarsen) { AssertDimension(dof_handler.get_triangulation().n_active_cells(), criteria.size()); @@ -122,8 +123,9 @@ namespace hp const Vector & criteria, const double p_refine_fraction, const double p_coarsen_fraction, - const ComparisonFunction & compare_refine, - const ComparisonFunction & compare_coarsen) + const ComparisonFunction::type> &compare_refine, + const ComparisonFunction::type> + &compare_coarsen) { AssertDimension(dof_handler.get_triangulation().n_active_cells(), criteria.size()); @@ -259,11 +261,12 @@ namespace hp template void p_adaptivity_from_reference( - const hp::DoFHandler &dof_handler, - const Vector & criteria, - const Vector & references, - const ComparisonFunction & compare_refine, - const ComparisonFunction & compare_coarsen) + const hp::DoFHandler & dof_handler, + const Vector & criteria, + const Vector & references, + const ComparisonFunction::type> &compare_refine, + const ComparisonFunction::type> + &compare_coarsen) { AssertDimension(dof_handler.get_triangulation().n_active_cells(), criteria.size()); diff --git a/source/hp/refinement.inst.in b/source/hp/refinement.inst.in index f0ffb98195..fdbf312fe8 100644 --- a/source/hp/refinement.inst.in +++ b/source/hp/refinement.inst.in @@ -59,8 +59,8 @@ for (deal_II_dimension : DIMENSIONS; S : REAL_SCALARS; const Vector &, const S, const S, - const std::function &, - const std::function &); + const ComparisonFunction::type> &, + const ComparisonFunction::type> &); template void p_adaptivity_from_relative_threshold &, const double, const double, - const std::function &, - const std::function &); + const ComparisonFunction::type> &, + const ComparisonFunction::type> &); template void p_adaptivity_from_regularity &, const Vector &, const Vector &, - const std::function &, - const std::function &); + const ComparisonFunction::type> &, + const ComparisonFunction::type> &); template void predict_error( -- 2.39.5